0
我一直在嘗試使用帶配置單元的測試臺。我有以下代碼:VHDL測試臺,配置單元
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
ENTITY AND_2 IS
PORT (
a,b : IN std_logic;
x : OUT std_logic
);
END ENTITY AND_2;
ARCHITECTURE EX_1 OF AND_2 IS
BEGIN
x <= a and b;
END ARCHITECTURE EX_1;
ARCHITECTURE EX_2 OF AND_2 IS
SIGNAL ab : std_logic_vector(1 DOWNTO 0);
BEGIN
ab <= (a & b);
WITH ab SELECT
x <= '1' WHEN "11",
'0' WHEN OTHERS;
END ARCHITECTURE EX_2;
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
ENTITY TEST_AND_2 IS
END ENTITY TEST_AND_2;
ARCHITECTURE IO OF TEST_AND_2 IS
SIGNAL a, b, x : std_logic;
BEGIN
G1 : ENTITY work.AND_2(EX_1) PORT MAP (a => a, b => b, x => x);
a <= '0', '1' AFTER 100 NS;
b <= '0', '1' AFTER 200 NS;
END ARCHITECTURE IO;
CONFIGURATION TESTER1 OF TEST_AND_2 IS
FOR IO
FOR G1 : AND_2
USE ENTITY work.AND_2(EX_1);
END FOR;
END FOR;
END CONFIGURATION TESTER1;
我編譯時麻煩接收回來以下消息:
錯誤(10482):在AND_2.vhd VHDL錯誤(48):對象 「AND_2」 是已使用但未聲明
我正在閱讀的書不明確在使用測試臺或配置單元時。有人能指出這個錯誤嗎?但很明顯,它可能是。 非常感謝 d
工作了一個款待....謝謝 – hoboBob
@DanielJHall如果答案解決了你的問題是正常的事情是把它標記爲接受http://stackoverflow.com/help/someone-answers –