我正在研究 t-bird 灯控制器,我的代码中不断出现这些错误,当我浏览代码时,它并没有什么问题!我在VHDL方面没有太多经验,但我可以判断它是对还是错,请我需要你的帮助
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.std_logic_arith.all;
entity tbird is
PORT(clk, lts,rts,haz,brake: IN bit;
lc,lb,la,ra,rb,rc: OUT bit);
end tbird;
architecture one of tbird is
TYPE state_type IS (idle,l1,l2,l3,r1,r2,r3,lr3,lr4);
signal state ,next_state: state_type;
BEGIN
process
BEGIN
WAIT UNTIL clk='1' AND clk'event;
state <= next_state;
end process;
--next state generation
PROCESS(state,rts,lts,haz,brake)
begin
case state is
WHEN idle =>
IF(haz='1' OR (lts='1' AND rts='1' AND break='0')) Then next_state <= lr3;
elsif (haz ='0' AND lts='0' and brake='0' and rts='1') then next_state <= r1;
elsif (haz ='0' and lts='1' and brake='0' and rts='0') then next_state <= l1;
elsif (haz='0' and lts='0' and brake='1' and rts='0') then next_state <= lr4;
else next_state <= idle;
end if;
WHEN l1=> IF(haz='1') THEN next_state <= lr3;
elsif (brake='1') then next_state <= lr4;
ELSE next_state <= l2;
END IF;
WHEN l2=>
IF(haz='1') THEN next_state<= lr3;
elsif(brake ='1') then next_state <= lr4;
ELSE next_state <= l3;
END IF;
WHEN l3=>
next_state <=idle;
WHEN r1=>IF(haz='1') THEN next_state <= lr3;
elsif(brake='1') then next_state <= lr4;
ELSE next_state <= r2;
END IF;
WHEN r2=>IF(haz='1') THEN next_state <= lr3;
IF(brake='1') THEN next_state <= lr4;
ELSE next_state <= r3;
END IF;
WHEN r3=> next_state <= idle;
WHEN lr3=> next_state <= idle;
WHEN lr4=>IF(brake='1')next_state <=lr4;
else next_state <= idle;
END case;
END PROCESS;
PROCESS(state)
BEGIN
case state is
WHEN idle => lc<='0'; lb<='0'; la<='0';ra<='0'; rb <='0'; rc<='0';
WHEN l1 => lc<='0'; lb<='0'; la<='1';ra<='0'; rb <='0'; rc<='0';
WHEN l2 => lc<='0'; lb<='1'; la<='1';ra<='0';rb <='0'; rc<='0';
WHEN l3 => lc<='1'; lb<='1'; la<='1';ra<='0';rb <='0'; rc<='0';
WHEN r1 => lc<='0'; lb<='0'; la<='0';ra<='1';rb <='0'; rc<='0';
WHEN r2 => lc<='0'; lb<='0'; la<='0';ra<='1';rb <='1'; rc<='0';
WHEN r3 => lc<='0'; lb<='0'; la<='0';ra<='1';rb <='1'; rc<='1';
WHEN lr3 => lc<='1'; lb<='1'; la<='1';ra<='1';rb <='1'; rc<='1';
WHEN lr4 => lc<='1'; lb<='1'; la<='1';ra<='1';rb <='1'; rc<='1';
END case;
END PROCESS;
END one;
这些是错误
INFO:HDLCompiler:1061 - Parsing VHDL file "D:/ISE/DSD LABS/assigment/brake.vhd" into library work
ERROR:HDLCompiler:806 - "D:/ISE/DSD LABS/assigment/brake.vhd" Line 53: Syntax error near "WHEN".
ERROR:HDLCompiler:806 - "D:/ISE/DSD LABS/assigment/brake.vhd" Line 55: Syntax error near "WHEN".
ERROR:HDLCompiler:806 - "D:/ISE/DSD LABS/assigment/brake.vhd" Line 56: Syntax error near "WHEN".
ERROR:HDLCompiler:806 - "D:/ISE/DSD LABS/assigment/brake.vhd" Line 58: Syntax error near "case".
ERROR:HDLCompiler:806 - "D:/ISE/DSD LABS/assigment/brake.vhd" Line 63: Syntax error near "BEGIN".
ERROR:HDLCompiler:806 - "D:/ISE/DSD LABS/assigment/brake.vhd" Line 75: Syntax error near "PROCESS".
ERROR:ProjectMgmt - 6 error(s) found while parsing design hierarchy.