警告:NUMERIC_STD。“<=”:检测到元值,在 Modelmsim 中返回 FALSE 错误

1 vhdl modelsim

当我运行代码时,我收到以下错误:警告:NUMERIC_STD。”<=:在 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;
Run Code Online (Sandbox Code Playgroud)

Mor*_*mer 5

我无法在所提供的代码中找到比较,<=我怀疑会发出警告“NUMERIC_STD。”<=“:检测到元值,返回 FALSE”。reg_goreg_n

然而,元值是那些std_logic不代表'0'和 的额外值'1',例如'X'。因此,警告的含义是存在一个比较,<=其中参数之一包含例如'X''U',因此无法进行有意义的比较,因此该函数返回FALSE

报警告的时候看一下模拟器,检查相关参数的值,检查参数的值。