开发环境:ise 10.1和modelsim 6.5se
check syntax可以通过,用modelsim仿真工程,出现如下错误:
# vsim -lib work -t 1ps p46_example_4_2_tbw
# ** Note: (vsim-3812) Design is being optimized...
# ** Error: p46_example_4_2_tbw.vhw(48): (vopt-1133) Type mismatch for port "output" in component "p46_example_4_2" when binding to entity "p46_example_4_2".
# ** Error: p46_example_4_2.vhd(36): Vopt Compiler exiting
# Error loading design
# Error: Error loading design
# Pausing macro execution
# MACRO ./p46_example_4_2_tbw.fdo PAUSED at line 7
具体代码:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity p46_example_4_2 is
GENERIC (n : INTEGER := 7);
Port ( input : in STD_LOGIC_VECTOR(n downto 0);
output : out STD_LOGIC);
end p46_example_4_2;
architecture Behavioral of p46_example_4_2 is
begin
PROCESS(input)
VARIABLE temp : STD_LOGIC;
BEGIN
temp := '0';
FOR i IN input'RANGE LOOP
temp := temp XOR input(i);
END LOOP;
output <= temp;
END PROCESS;
end Behavioral;
问题虽已解决,但不知道为什么会出现这种情况,恳请大侠指点,以免以后不再出现。解决的方法是重新建一个仿真文件,及TBW文件。