警告:NUMERIC_STD。"< =":检测到元数据,在Modelmsim中返回FALSE错误

时间:2016-10-12 23:30:18

标签: vhdl modelsim

我收到以下错误:警告:NUMERIC_STD。"< =":检测到metavalue,在我运行代码时在Modelsim中返回FALSE。

只有在使用reg_go和reg_n寄存器时才会发生错误。如果不使用寄存器,代码工作正常。

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

use work.config_pkg.all;
use work.user_pkg.all;

entity memory_map is
port (
    clk     : in  std_logic;
    rst     : in  std_logic;
    wr_en   : in  std_logic;
    wr_addr : in  std_logic_vector(MMAP_ADDR_RANGE);
    wr_data : in  std_logic_vector(MMAP_DATA_RANGE);
    rd_en   : in  std_logic;
    rd_addr : in  std_logic_vector(MMAP_ADDR_RANGE);
    rd_data : out std_logic_vector(MMAP_DATA_RANGE);

    -- application-specific I/O
    go     : out std_logic;
    n      : out std_logic_vector(31 downto 0);
    result : in  std_logic_vector(31 downto 0);
    done   : in  std_logic
    );
end memory_map;

architecture BHV of memory_map is
signal reg_go, reg_go1     :  std_logic;
signal reg_n      :  std_logic_vector(31 downto 0);
begin

process(clk,rst)

begin


    if(rst = '1') then
        reg_go <= '0';
        reg_go <= '0';
        reg_n <= (others => '0');
        rd_data <= (others => '0');

    elsif(clk'event and clk = '1') then

        if(wr_en='1') then

            if(wr_addr=std_logic_vector(to_unsigned(C_GO_ADDR,C_MMAP_ADDR_WIDTH))) then

                    reg_go <= wr_data(0);
                    reg_go1 <= '1';

            elsif(wr_addr=std_logic_vector(to_unsigned(C_N_ADDR,C_MMAP_ADDR_WIDTH))) then
                    reg_n <=wr_data;


            end if;
        end if;

        reg_go1 <= '0';

        if(rd_en='1') then
            if(rd_addr=std_logic_vector(to_unsigned( C_RESULT_ADDR,C_MMAP_ADDR_WIDTH))) then
                rd_data <= result;
            elsif(rd_addr=std_logic_vector(to_unsigned(C_DONE_ADDR,C_MMAP_ADDR_WIDTH))) then

                rd_data(0) <= done;

            end if;
        end if;
    end if;

end process;



go <= reg_go and reg_go1;
n  <= reg_n;





end BHV;

1 个答案:

答案 0 :(得分:0)

我在提供的代码中找不到<=reg_go的比较reg_n我怀疑会发出警告“NUMERIC_STD。”&lt; =“:检测到metavalue,返回FALSE“。

但是,元值是std_logic中不代表'0''1'的额外值,例如'X'。那么警告意味着有一个比较<=,其中一个参数包含例如'X''U',从而无法进行有意义的比较,因此函数返回{ {1}}。

在报告警告时查看模拟器,并检查相关参数的值,检查参数的值。

相关问题