Vhdl Modelsim超出范围错误
我在ModelSim 10.1c中遇到此错误: 致命:(vsim-3421)值3079超出范围0到3078 进程wr_addr在C:/videoalgo/run_chkin/veu/median/median/board/sim/../../../../window\u gen/rtl/fifo.vhd第159行出现致命错误 我定义了以下类型和信号。如您所见,声明的索引范围仅为1029到0:Vhdl Modelsim超出范围错误,vhdl,simulation,modelsim,Vhdl,Simulation,Modelsim,我在ModelSim 10.1c中遇到此错误: 致命:(vsim-3421)值3079超出范围0到3078 进程wr_addr在C:/videoalgo/run_chkin/veu/median/median/board/sim/../../../../window\u gen/rtl/fifo.vhd第159行出现致命错误 我定义了以下类型和信号。如您所见,声明的索引范围仅为1029到0: type memory_type is array (natural range <> )
type memory_type is array (natural range <> ) of std_logic_vector(29 downto 0);
signal MEMORY : memory_type(1029 downto 0):= (others => (others => '0'));
signal wr_port_address :std_logic_vector(10 downto 0) := (others => '0');
signal wr_port_address_binary : std_logic_vector(10 downto 0):=(others => '0');
type memory\u type是标准逻辑向量(29到0)的数组(自然范围);
信号存储器:存储器类型(1029至0):=(其他=>(其他=>“0”);
信号wr_端口_地址:标准逻辑_向量(10到0):=(其他=>'0');
信号wr_端口地址_二进制:标准逻辑向量(10到0):=(其他=>'0');
我得到错误的过程是:
if rising_edge(Wr_Clk) then
if A_rst = '1' then
wr_port_address_binary <= (others => '0');
else
if (Wr_Ena = '1') and (fifo_full = '0') then
wr_port_address_binary <= wr_port_address_binary + 1;
-- the following is line 159
MEMORY(to_integer(unsigned(wr_port_address))) <= Wr_Data;
end if;
end if;
end if;
如果上升沿(Wr\U Clk),则
如果A_rst='1',则
wr_端口_地址_二进制“0”);
其他的
如果(Wr_Ena='1')和(fifo_full='0'),则
wr_port_address_binary什么进程驱动wr_port_address
?无法使用[01029]范围之外的数字写入内存
以文件名'fifo.vhd'为提示,每当信号到达内存顶部时,您应该重置wr\u port\u address
信号。我将假定wr\u port\u address\u binary
与wr\u port\u address
是一样的,除了一些奇怪的名称和/或类型更改(如果不是,你应该真正重命名它们)
如果上升沿(Wr\U Clk),则
如果A_rst='1',则
wr_端口_地址“0”);
其他的
如果(Wr_Ena='1')和(fifo_full='0'),则
如果wr_端口_地址<1029,则
wr_port_address我已经格式化并改进了你的问题很多。请检查,如果我做错了什么。请张贴a:尽量减少你的代码,使错误仍然存在。请发布触发错误所需的最小测试台。嗨,马丁,格式化没问题。。这是项目的一部分,所以很难发布与此错误相关的测试台。如果你能为解决这个问题提供一些线索,那会很有帮助。@kaps-Martin的观点是,为了解决你的问题,必须有人做一些工作。他们需要添加一个实体、架构和某种测试平台。与其让他们做那项工作,不如让你去做?我不是说发布你的整个项目,我是说发布一些小的东西,这样可以解决问题。那么,您不仅可以为帮助您的人节省一些时间,而且在这样做的过程中,您很有可能自己发现问题。@kaps:您还没有显示代码的相关部分。致命错误与范围为0到3078的整数子类型有关,该子类型的增量或使用范围超出了有效范围。找到这个整数,就更接近解决问题了。
if rising_edge(Wr_Clk) then
if A_rst = '1' then
wr_port_address <= (others => '0');
else
if (Wr_Ena = '1') and (fifo_full = '0') then
if wr_port_address < 1029 then
wr_port_address <= wr_port_address + 1;
else
wr_port_address <= (others => '0');
end if;
-- the following is line 159
MEMORY(to_integer(unsigned(wr_port_address))) <= Wr_Data;
end if;
end if;
end if;