|
entity test is
generic (depth: integer :=4;
width: integer :=8);
Port ( clk : in STD_LOGIC;
rst : in STD_LOGIC;
din : in STD_LOGIC_VECTOR(width-1 downto 0);
dout : out STD_LOGIC_VECTOR(width-1 downto 0));
end test;
architecture Behavioral of test is
signal a,b:STD_LOGIC_VECTOR (depth-1 downto 0);
begin
PROCESS(clk)
begin
if(clk'event and clk='1')then
if(a=b)then
dout <= din;
end if;
end if;
end process;
PROCESS(clk,rst)
begin
if(rst= '1')then
a <= (others=>'0');
b <= (others=>'1');
elsif(clk'event and clk='1')then
a <= a+1;
b <= b-1;
end if;
end process;
end Behavioral;
这是一个测试语法的代码,为什么编译老是提示if(a=b)then这句话有问题,把他改成if(a(0)=b(0) and a(1)=b(1) and a(2)=b(2) and a(3)=b(3))then就可以啦,这是为什么啊?求高手指点!感激不尽~~
错误提示:ERROR:HDLCompiler:607 - "E:\VHDL_program_test\test1\test.vhd" Line 48: Multiple declarations of "=" included via multiple use clauses; none are made directly visible |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|