Modelsim超出范围错误

时间:2016-03-02 18:44:37

标签: vhdl simulation modelsim

我在ModelSim 10.1c中遇到此错误:

  

致命:( vsim-3421)值3079超出0到3078的范围。

     

在C:/ videoalgo / run_chkin / veu / median / median / board / sim /../../../ window_gen / rtl / fifo.vhd第159行处理wr_addr中的致命错误

我定义了以下类型和信号。如您所见,声明的索引范围仅为1029,为0:

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');

我收到错误的过程是:

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;

1 个答案:

答案 0 :(得分:0)

var marker = new google.maps.Marker({ position: new google.maps.LatLng(stop.Latitude, stop.Longitude), map: $scope.map, icon: image }); marker.setZIndex(google.maps.Marker.MAX_ZINDEX + 1); 的哪些流程驱动程序?您无法使用[0,1029]范围之外的数字写入wr_port_address

将文件名“fifo.vhd”作为提示,只要到达内存顶部,就应该重置MEMORY信号。我会假设wr_port_addresswr_port_address_binary相同,除了一些奇怪的名称和/或类型更改(如果不是你应该重命名它们)。

wr_port_address