Altera_Forum
Honored Contributor
15 years agoVHDL PROCESS sensitivity help.
I have a VHDL process that seems to be going despite the sensitivity list. Right now, I'm trying to make one turn of a "simon says" game on the DE2 board. Here is the process giving me troubles.
user_process : PROCESS(KEY3, KEY2, KEY1, KEY0)
BEGIN
IF user_turn = '1' THEN
IF KEY3 ='0' OR KEY2 ='0' OR KEY1 ='0' OR KEY0 = '0' THEN
CASE now_state IS
WHEN USER_1 =>
reg(0):= reg_val(0);
reg(1):= reg_val(1);
now_state <= USER_2;
WHEN USER_2 =>
reg(2):= reg_val(0);
reg(3):= reg_val(1);
now_state <= USER_3;
WHEN USER_3 =>
reg(4):= reg_val(0);
reg(5):= reg_val(1);
now_state <= USER_4;
WHEN USER_4 =>
reg(6):= reg_val(0);
reg(7):= reg_val(1);
IF reg = "11011000" THEN
now_state <= DONE;
ELSE
now_state <= USER_1;
END IF;
WHEN DONE =>
user_ledg_0 := '1';
--user_turn := '0';
WHEN OTHERS =>
now_state <= USER_1;
END CASE;
END IF;
END IF;
END PROCESS user_process; reg_val is a temporary register that changes values every time a pushbutton (KEY3-0) changes. user_ledg_0 is tied directly to a green LED. However, when the program gets to this process, the green light immediately turns on, without any pushbutton interaction seemingly ignoring the sensitivity list and IF statements. Quartus also doesn't complain of any syntax errors. Any help?