Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- your sensitivity list only takes care of "SW", which means your process is only executed when there is any change in SW. signals are updated at the end of process, with your code it means the LEDG is assigned with the existing(previous) value. --- Quote End --- As FvM explained, this statement is only true with a simulator. A synthesizer will ignore the sensitivity list, and the best way to simulate what the synthesizer actually does is this code:
process(SW,LEDState)
begin
if(SW = "1") THEN
LEDState <= "11111111";
else
LEDState <= "00000000";
end if;
LEDG <= LEDState;
end process;I've changed the sensitivity list to contain all the signals that are read by the process. If you simulate this, when you change the switch state the process will be executed a first time, update LEDState, then run a second time and update LEDG. Then you get the same behaviour between the simulation and the synthesized code.