Pavelll
Newbie level 1
Strange FSM behavior: it goes straight to "work" state without "wait2work"
Hello friends!
I use FSM in my project and it behaves very strange.
During simulation there is never high ¨wait2work¨ signal but the state machine turns in ¨WORK¨ state. Why does it happen?
Thanks.
Hello friends!
I use FSM in my project and it behaves very strange.
Code:
always @(*)
case (state_global)
`WAIT : if (wait2pass) state_next_global = `PASS;
else if (wait2work) state_next_global = `WORK;
else state_next_global = `WAIT;
`PASS : if (pass2wait) state_next_global = `WAIT;
`WORK : if (work2wait) state_next_global = `WAIT;
default : state_next_global = `PASS;
endcase
always @(posedge CLK or negedge RSTn) if (!RSTn) state_global<=`WAIT;
else state_global<=state_next_global;
Thanks.