case task is
when 1 => task <= 2;
when 2 => task <= 3;
when other =>...
end case
I try to change the switch variable inside the case but it does not effect the value after case clause is passed. What is the proper way to do it?
Since you use a signal assignment
<=I assume thattaskis a signal, not a variable. The new value of task will be available in the next simulation cycle (delta cycle). This usually means that the new value will be visible when the process is executed again, or after a “wait” statement (but you probably don’t want wait statements if you are going to synthesize the code).As an alternative, you can use a variable for
task, and use the variable assignment operator:task := 2;