编辑:我刚刚重新安装了 lattice diamond 和更新,Active-hdl 已自动安装,但模拟仍然给我同样的错误。当我更改库 machXO3 时;使用 machXO3.all;到图书馆 machXO2; 使用 machXO2.all;它编译..
我正在尝试为 OSCH 的简单实现编写一个测试台,但我无法让测试台工作。
几个月前我设法让它工作,但我丢失了我正在处理的文件。
这是我拥有的 vhdl 代码:
library ieee;
use ieee.std_logic_1164.all;
-- For Main Clock --
library machXO3;
use machXO3.all;
--------------------
entity Clock is
port (stdby : in std_logic;
osc_int: out std_logic
);
end Clock;
architecture Clock_behav of Clock is
COMPONENT OSCH
-- synthesis translate_off
GENERIC (NOM_FREQ: string := "2.56");
-- synthesis translate_on
PORT (STDBY : IN std_logic;
OSC : OUT std_logic
);
END COMPONENT;
begin
Clock: OSCH
-- synthesis translate_off
GENERIC MAP( NOM_FREQ => "2.56" )
-- synthesis translate_on
PORT MAP ( STDBY => stdby,
OSC => osc_int
);
end Clock_behav;
这是测试台,大部分是由 lattice-diamond 生成的,我只添加了 stdby <= '0';
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY testbench IS
END testbench;
ARCHITECTURE behavior OF testbench IS
COMPONENT Clock
PORT(
stdby : IN std_logic;
osc_int : OUT std_logic
);
END COMPONENT;
SIGNAL stdby : std_logic;
SIGNAL osc_int : std_logic;
BEGIN
-- Please check and add your generic clause manually
uut: Clock PORT MAP(
stdby => stdby,
osc_int => osc_int
);
stdby <= '0';
-- *** Test Bench - User Defined Section ***
tb : PROCESS
BEGIN
--wait; -- will wait forever
END PROCESS;
-- *** End Test Bench - User Defined Section ***
END;
Lattice-diamond 告诉我一切都很好,但是当我在 Active-hdl 中运行所有内容时,为了模拟,我得到了这些错误:
# Error: COMP96_0059: Main.vhd : (5, 1): Library "machXO3" not found.
# Error: COMP96_0078: Main.vhd : (6, 5): Unknown identifier "machXO3".
# Compile Architecture "Clock_behav" of Entity "Clock"
# Error: COMP96_0056: Main.vhd : (15, 1): Cannot find referenced entity declaration "Clock".
# Compile failure 3 Errors 0 Warnings Analysis time : 16.0 [ms]