在Xillinx中合成此代码时出错。此错误是:
分析库中的实体(架构) 错误: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;
答案 0 :(得分:1)
错误&#39;错误的同步说明&#39;通常意味着您已经描述了硬件中不存在的寄存器(时钟元素)。
对于您的代码,您有:
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;
以这种方式实施它需要你:
如果您没有一个有意义的流程名称,那么您根本不必给它一个。 process (clk)
与p1 : process(clk)
一样有效。