我一直致力于在MultiSim学生体育版中使用VHDL实现卷积运算。以下代码编译成功,但是当我单击“模拟”时,将得到以下错误:
# vsim
# Start time: 10:32:20 on Apr 26,2015
# Loading std.standard
# ** Error: (vsim-13) Recompile work.convolution because work.convolution has changed.
#
# ** Error (suppressible): (vsim-12) Recompile work.convolution(behavioral) after work.convolution, work.convolution are recompiled.
#
# Error loading design
以下是源代码:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_arith.all;
package Convolution IS
TYPE real_vector is ARRAY(integer RANGE <>) OF real;
end;
use work.Convolution.ALL;
entity convolution is
port (x:in real_vector(0 to 3);
h:in real_vector(0 to 1);
y:out real_vector (0 to 4));
end convolution;
architecture Behavioral of convolution is
BEGIN
process (x,h)
variable sum :real := 0.0;
variable temp :integer := 0;
begin
for k in y'range loop
sum:=0.0;
for n in h'range loop
temp := k-n;
if temp >= 0 then
sum := sum + h(n)*x(temp); --we are assuming all singnals are positively indexed, negative indices deafult to 0.
end if;
end loop;
y(k) <= sum ;
end loop;
end process;
end Behavioral;
请帮我解决这个问题。
发布于 2015-04-26 06:12:55
你有个名字碰撞。在相同的(工作)库中有两个主单元具有相同的名称。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- use IEEE.std_logic_arith.all;
package Convolution_pkg IS
TYPE real_vector is ARRAY(integer RANGE <>) OF real;
end;
use work.Convolution_pkg.ALL;
...
更改其中一个或另一个的名称。(这显示了更改包名)。
您也可以将卷积包分析成一个不同的(例如,它自己的)库。
在同一个库中的两个主单元中使用相同的名称有点像catch 22。
见IEEE Std 1076-2008,13.5阶分析,第5段:
给定的库单元可能受到在给定库单元中引用其名称的任何库单元中的更改的影响。次级单元可能受到其相应的主单元的变化的影响。如果一个库单元被改变(例如,通过对相应的设计单元进行重新分析),那么所有可能受到这种改变影响的库单元都会过时,并且在它们再次被使用之前应该被重新分析。
https://stackoverflow.com/questions/29874092
复制相似问题