【问题标题】:Signal current cannot be synthesized, bad synchronous description信号电流不能合成,同步描述不好
【发布时间】:2015-05-21 15:01:07
【问题描述】:

在 Xilinx 中合成此代码时出现错误。这个错误是:

分析库中的实体(架构)。
ERROR:Xst:827 - "C:/Xilinx92i/Parking/Parking.vhd" 第 43 行:信号电流无法合成,同步描述错误。

entity Parking is port(
    A, B ,reset: in std_logic;
    Capacity : out std_logic_vector(7 downto 0));
end Parking;

architecture Behavioral of Parking is
    type state is (NoChange, Aseen, Bseen, ABseen, BAseen, Input, Output, Din, Dout);
    signal current, nxt : state ;
    signal counter : std_logic_vector (7 downto 0) := "00000000";
begin

    p1: process(A, B, reset)
    begin
        if reset = '1' then
            current <= Nochange;
        end if;

        if(A'event and A='1') then
            current <= nxt;
        end if;

        if(A'event and A='0') then
            current <= nxt;
        end if;

        if(B'event and B='1') then
            current <= nxt;
        end if;

        if(B'event and B='0') then
            current <= nxt;
        end if;
    end process;

    p2: process(current, A, B)
    begin
        case current is
            when Aseen =>
                if B='1' then
                    nxt <= ABseen;
                else
                    nxt <= NoChange;
                end if;

            when others =>
                nxt <= Nochange;
        end case;
    end process;

    Capacity <= counter;

end Behavioral;

【问题讨论】:

    标签: vhdl fpga


    【解决方案1】:

    错误“同步描述错误”通常意味着您描述了硬件中不存在的寄存器(时钟元素)。

    就您的代码而言,您有:

    if(A'event and A='1') then
       current <= nxt;
    end if;
    
    if(A'event and A='0') then
        current <= nxt;
    end if;
    
    -- etc
    

    在一个进程中。同步可合成过程通常只有一个时钟,因为像 FPGA 这样的真实硅器件中没有任何元件可以响应两个不同时钟上的事件。像您尝试实施的流程通常看起来更像这样:

    process (clk)   
    begin
        if (rising_edge(clk)) then
            if (a = '1') then
                current <= nxt;
            elsif (a = '0') then
                current <= nxt;
            end if;
        end if;
    end process;
    

    以这种方式实现它需要您:

    1. 系统中的时钟
    2. 满足相对于该时钟的建立/保持时间的输入

    旁注

    如果您没有一个有意义的进程名称,您根本不必给它一个。 process (clk)p1 : process(clk) 一样有效。

    【讨论】:

    • 在这个程序中,我将有两个信号 A 和 B 作为时钟。
    • 如果你需要多个时钟信号,每个时钟都需要有自己的进程,设置/清除信号,然后可以被其他进程监控。你不能做你在代码中写的东西。
    • @mahsa93 A 和 B 真的是时钟还是时钟启用?您也不能描述优先级低于时钟沿的异步复位。你能给我们画一个带 A、B 和电流的波形吗?
    猜你喜欢
    • 1970-01-01
    • 2014-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多