vhdl - IS_X函数综合

标签 vhdl

我在合成使用函数 IS_X() 的实体时遇到一些问题。特别是消息

[Error] name IS_X is unknown

已显示。
可以合成吗?

library IEEE;
use IEEE.std_logic_1164.all;

entity FF2 is
    generic(XOUT, XNOUT: std_logic);
    port(   INPUT, CLK: in std_logic;
            OUTPUT, NOUTPUT: out std_logic
    );
end entity FF2;

architecture behavioral of FF2 is

    signal temp : std_logic := '0';
    begin
        FUNC:process(CLK)
        begin
            if(CLK'event and rising_edge(CLK)) then
                temp <= INPUT;
            end if;
        end process FUNC;

        OUTPUT <= XOUT when is_x(temp) else temp;
        NOUTPUT <= XNOUT when is_x(temp) else (not temp);

end architecture behavioral;

最佳答案

可合成是什么意思?综合工具不应该支持使用 is_x 创建硬件,因为硬件中只有 0 和 1,并且综合后无法为您的代码创建任何内容:

OUTPUT <= XOUT when is_x(temp) else temp;
NOUTPUT <= XNOUT when is_x(temp) else (not temp);

OTOH,在报告语句中使用 is_x 应该被您的综合工具忽略(意味着支持使用 is_x 来报告模拟问题),因为它不会创建任何硬件:

assert not(is_x(temp)) report "captured X on input" severity error;

这对于调试很有帮助,特别是在有大量 X 掩码的状态机中。如果您的综合工具不接受这一点,请务必将其作为错误提交给供应商 - 并在此处报告。

关于vhdl - IS_X函数综合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52895225/

相关文章:

vhdl - 大数组初始化为 0

embedded - VHDL 中的 BRAM_INIT

vhdl - VHDL中的变量究竟是什么?

components - 顶层使用带有 VHDL 记录的端口映射

vhdl - 如何在 vhdl 中使用 3 输入逻辑门?

vhdl - 目标(变量 "")不是 VHDL 中的信号错误

attributes - 将属性放入文件可能吗?

VHDL 项目的 gitignore

arrays - 初始化VHDL中的记录数组

vhdl - 什么是{globally|locally} static {primary|expression|range|subexpression} 它是什么意思?