| |
最近犯了一个状态机的错误,真的很郁闷,因为前仿真通过了,就以为没有问题了,结果程序运行不起来,后来通过后仿真才发现错误,
1 :当时状态机采用3段法写法
case(next_state )
idle : if ( a )
current_state = start ;
else
current_state = current_state ;
start : if b
current_sate = stop;
else
current_state = current_state
endcase
这种状态机会导致 状态机一直停留在idle状态中,
要采取以下操作
current_state = idle
这样就可以正常工作了。
2 : 状态机多个选择的时候,要采用",' ,而不是“|” ,