我需要写这个状态机控制FIFO数据路径,但似乎在其他地方被忽略语法错误,不要让我完成正常的状态机。错误:HDLCompiler:806部分被忽略的语法错误为什么会被忽略?
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity FIFO_FSM is
Port (CMD_WR_H : in STD_LOGIC;
CMD_RD_H : in STD_LOGIC;
SYS_CLK_H : in STD_LOGIC;
RST_H : in STD_LOGIC;
EMPTY_H : out STD_LOGIC;
FULL_H : out STD_LOGIC;
LD_EN_0_H : out STD_LOGIC;
LD_EN_1_H : out STD_LOGIC;
LD_EN_2_H : out STD_LOGIC;
LD_EN_3_H : out STD_LOGIC;
RD_EN_H : out STD_LOGIC;
WR_EN_H : out STD_LOGIC;
LD_RVR_H : out STD_LOGIC);
end FIFO_FSM;
architecture Behavioral of FIFO_FSM is
signal PresentState,Nextstate: integer := 0;
begin
process(PresentState,CMD_WR_H,CMD_RD_H,RST_H)
begin
case PresentState is
when 0 => -- empty state
LD_EN_0_H <='0';LD_EN_1_H <='0';LD_EN_2_H <='0';LD_EN_3_H <='0';
RD_EN_H<='0';WR_EN_H<='0';LD_RVR_H<='0';
EMPTY_H<='1';FULL_H<='0';
if(RST_H ='1') then Nextstate<=0;
elsif(((CMD_WR_H ='1' and CMD_RD_H='1') and (RST_H='0'))) then Nextstate<=0;
elsif((((CMD_WR_H='0') and (CMD_RD_H='0')) and (RST_H='0')))then Nextstate<=0;
elsif(((CMD_WR_H='0' and (CMD_RD_H='1')) and (RST_H='0')))then Nextstate<=0;
elsif((((CMD_WR_H='1') and CMD_RD_H='0') and (RST_H='0')))then Nextstate<=1;
end if;
when 1 => --loading Reg 0 transition state
LD_EN_0_H <='1';LD_EN_1_H <='0';LD_EN_2_H <='0';LD_EN_3_H <='0';
RD_EN_H<='0';WR_EN_H<='1';LD_RVR_H<='0';
EMPTY_H<='0';FULL_H<='0';
Nextstate<=2;
when 20=> -- unloading R0
LD_EN_0_H <='1';LD_EN_1_H <='1';LD_EN_2_H <='1';LD_EN_3_H <='1';
RD_EN_H<='1';WR_EN_H<='0';LD_RVR_H<='1';
EMPTY_H<='0';FULL_H<='0';
Nextstate<=0;
when 2=> -- Reg 0 stored
LD_EN_0_H <='0';LD_EN_1_H <='0';LD_EN_2_H <='0';LD_EN_3_H <='0';
RD_EN_H<='0';WR_EN_H<='0';LD_RVR_H<='0';
EMPTY_H<='0';FULL_H<='0';
if(RST_H ='1') then Nextstate<=0;
elsif(((CMD_WR_H ='1' and CMD_RD_H='1') and (RST_H='0'))) then Nextstate<=2;
elsif((((CMD_WR_H='0') and (CMD_RD_H='0')) and (RST_H='0')))then Nextstate<=2;
elsif(((CMD_WR_H='0' and (CMD_RD_H='1')) and (RST_H='0')))then Nextstate<=20;
elsif((((CMD_WR_H='1') and CMD_RD_H='0') and (RST_H='0')))then Nextstate<=3;
end if;
when 3=> --Load Reg 1 transition state
LD_EN_0_H <='0';LD_EN_1_H <='1';LD_EN_2_H <='0';LD_EN_3_H <='0';
RD_EN_H<='0';WR_EN_H<='1';LD_RVR_H<='0';
EMPTY_H<='0';FULL_H<='0';
Nextstate<=4;
when 42 => --unloading R1
LD_EN_0_H <='1';LD_EN_1_H <='1';LD_EN_2_H <='1';LD_EN_3_H <='1';
RD_EN_H<='1';WR_EN_H<='0';LD_RVR_H<='1';
EMPTY_H<='0';FULL_H<='0';
Nextstate<=2;
when 4=> --Reg 1 Stored
LD_EN_0_H <='0';LD_EN_1_H <='0';LD_EN_2_H <='0';LD_EN_3_H <='0';
RD_EN_H<='0';WR_EN_H<='0';LD_RVR_H<='0';
EMPTY_H<='0';FULL_H<='0';
if(RST_H ='1') then Nextstate<=0;
elsif(((CMD_WR_H ='1' and CMD_RD_H='1') and (RST_H='0'))) then Nextstate<=4;
elsif((((CMD_WR_H='0') and (CMD_RD_H='0')) and (RST_H='0')))then Nextstate<=4;
elsif(((CMD_WR_H='0' and (CMD_RD_H='1')) and (RST_H='0')))then Nextstate<=42;
elsif((((CMD_WR_H='1') and CMD_RD_H='0') and (RST_H='0')))then Nextstate<=5;
end if;
when 5=> --Load Reg 2 transition state
LD_EN_0_H <='0';LD_EN_1_H <='0';LD_EN_2_H <='1';LD_EN_3_H <='0';
RD_EN_H<='0';WR_EN_H<='1';LD_RVR_H<='0';
EMPTY_H<='0';FULL_H<='0';
Nextstate<=6;
when 64 -- unloading R2
LD_EN_0_H <='1';LD_EN_1_H <='1';LD_EN_2_H <='1';LD_EN_3_H <='1';
RD_EN_H<='1';WR_EN_H<='0';LD_RVR_H<='1';
EMPTY_H<='0';FULL_H<='0';
Nextstate<=4;
when 6=> -- Reg 2 Stored
LD_EN_0_H <='0';LD_EN_1_H <='0';LD_EN_2_H <='0';LD_EN_3_H <='0';
RD_EN_H<='0';WR_EN_H<='0';LD_RVR_H<='0';
EMPTY_H<='0';FULL_H<='0';
if(RST_H ='1') then Nextstate<=0;
elsif(((CMD_WR_H ='1' and CMD_RD_H='1') and (RST_H='0'))) then Nextstate<=6;
elsif((((CMD_WR_H='0') and (CMD_RD_H='0')) and (RST_H='0')))then Nextstate<=6;
elsif(((CMD_WR_H='0' and (CMD_RD_H='1')) and (RST_H='0')))then Nextstate<=64;
elsif((((CMD_WR_H='1') and CMD_RD_H='0') and (RST_H='0')))then Nextstate<=7;
end if;
when 7=> -- Load Reg 3 transition state
LD_EN_0_H <='0';LD_EN_1_H <='0';LD_EN_2_H <='0';LD_EN_3_H <='1';
RD_EN_H<='0';WR_EN_H<='1';LD_RVR_H<='0';
EMPTY_H<='0';FULL_H<='0';
Nextstate<=8;
when 86 -- unloading R3
LD_EN_0_H <='1';LD_EN_1_H <='1';LD_EN_2_H <='1';LD_EN_3_H <='1';
RD_EN_H<='1';WR_EN_H<='0';LD_RVR_H<='1';
EMPTY_H<='0';FULL_H<='0';
Nextstate<=6;
when 8=> -- Reg 3 Stored
LD_EN_0_H <='0';LD_EN_1_H <='0';LD_EN_2_H <='0';LD_EN_3_H <='0';
RD_EN_H<='0';WR_EN_H<='0';LD_RVR_H<='0';
EMPTY_H<='0';FULL_H<='1';
if(RST_H ='1') then Nextstate<=0;
elsif(((CMD_WR_H ='1' and CMD_RD_H='1') and (RST_H='0'))) then Nextstate<=8;
elsif((((CMD_WR_H='0') and (CMD_RD_H='0')) and (RST_H='0')))then Nextstate<=8;
elsif(((CMD_WR_H='0' and (CMD_RD_H='1')) and (RST_H='0')))then Nextstate<=86;
elsif((((CMD_WR_H='1') and CMD_RD_H='0') and (RST_H='0')))then Nextstate<=8;
end if;
end process;
process(CLK) -- State Register
begin
if CLK='1' and CLK'EVENT then -- rising edge of clock
PresentState <= Nextstate;
end if;
end process;
end Behavioral;
我得到这些错误:
ERROR:HDLCompiler:806 - "C:/Users/willow/workspaceVHDL/FSM/FIFO_FSM.vhd" Line 96: Syntax error near "<=".
ERROR:HDLCompiler:806 - "C:/Users/willow/workspaceVHDL/FSM/FIFO_FSM.vhd" Line 119: Syntax error near "<=".
ERROR:HDLCompiler:806 - "C:/Users/willow/workspaceVHDL/FSM/FIFO_FSM.vhd" Line 135: Syntax error near "process".
我想要问的是什么错误,以及如何解决它,因为是说像我不能使用<=
来分配对我的投入和产出有价值,但仅限于某些方面,而不是其他方面。我得到的另一个错误是在对时钟敏感的进程之前的最后进程线附近。
它不清楚你在问什么。请参阅:http://stackoverflow.com/help/how-to-ask了解如何提出一个好问题的信息。 – Ian
抱歉,我的第一个问题在这里,我想问的是错误是什么以及如何解决它,因为我说我不能使用<=为我的输入和输出分配一个值,但仅在某些行,而不是其他的地方,我得到的另一个错误就是在对时钟敏感的过程之前的结束过程行附近。 – willow