Vhdl std#U逻辑的操作:=&x27;X';

Vhdl std#U逻辑的操作:=&x27;X';,vhdl,Vhdl,总结问题在底部。 if (reset_i ='1') then (A) elsif(rising_edge(clk_i)) then (B) end if; 我正在分析和研究现有的VHDL代码。 在这段代码中,端口重置i被初始化为“X”,如下面的代码所示 entity ADC_fsm is Port ( clk_i : in std_logic := 'X'; reset_i : in std_logic :=

总结问题在底部。

if (reset_i ='1') then
(A)
elsif(rising_edge(clk_i)) then
(B)
end if;
我正在分析和研究现有的VHDL代码。 在这段代码中,端口重置i被初始化为“X”,如下面的代码所示

entity ADC_fsm is
Port ( clk_i                :   in  std_logic := 'X';
       reset_i              :   in  std_logic := 'X';
       di_req_i             :   in  std_logic := 'X';
       wr_ack_i             :   in  std_logic := 'X';
       spi_ssel_i           :   in  std_logic := 'X';
       reg_enable_i         :   in  std_logic := 'X';
       reg_data_i           :   in  std_logic_vector(23 downto 0);
       adc_data_i           :   in  std_logic_vector(11 downto 0);
       bitslip_o            :   out std_logic;
       sync_done_o          :   out std_logic; 
       wr_en_o              :   out std_logic;
       spi_data_o           :   out std_logic_vector(23 downto 0) := (others => '0')
      );
end ADC_fsm;
此端口(重置_i)未与其他外部端口或信号连接

在下一个代码中

begin
process(clk_i, reset_i)
    begin
        if (reset_i = '1') then
            wr_en_o       <= '0';
            sync_done_o   <= '0';
            bitslip_o     <= '0';
            spi_data_o    <= (others => '0');

        s_delay_count     <= 0;
        s_write_indicator <= 0;

            state       <= ready;

        elsif rising_edge(clk_i) then

        wr_en_o       <= '0';
            sync_done_o   <= '0';
            bitslip_o     <= '0';
代码(B)是否仅在重置_i='0'时工作? 或者在重置_i='X'时也工作


感谢类型
std_logic
是一种具有9个值的枚举类型,具有以下9个值:

'U','X','0','1','Z','W','L','H','-'
每个值只是一个不同的任意符号。那么,线路呢

if reset_i ='1' then            -- the brackets are not required

当且仅当
reset_i
等于
'1'
时为真。就这样<代码>'X'只是一个不同的任意符号。

IEEE Std 1076-2008 9.2.3关系运算符“等式和不等式运算符(=和/=)为除文件类型和受保护类型以外的所有类型定义。如果两个操作数相等,则相等运算符返回值TRUE,否则返回值FALSE。如果两个操作数相等,则不等运算符返回值FALSE,否则返回值TRUE。”相同类型的两个标量值相等当且仅当值相同时。如果在保留字elsif和then之间缺少要求值的条件(具有布尔值的表达式),则您的上一个代码段不是有效的VHDL。上升沿是一个函数,需要从“0”或“L”转换到“1”或“H”才能返回真值。缺少use子句,可能在包ieee.std_logic_1164中找到。@user1155120我修改了最后的代码!。如果重置为“X”,则采用时钟分支。Vhdl代码非常明确。如果要使用clk将重置为“0”,则需要这样说。注意“X”不能存在于实际硬件中