Forum Discussion
Altera_Forum
Honored Contributor
10 years agoAbout styles of writing FSM
Hi, I find many people on their blog suggest coding FSM as follow.
always @ (posedge clk or negedge rst_n)
if(!rst_n)
current_state <= IDLE;
else
current_state <= next_state;
alw...
Altera_Forum
Honored Contributor
10 years agoAccording to Cliff from Sunburst:
6. one always block fsm style (avoid this style!)one of the most common fsm coding styles in use today is the one sequential always block fsm coding style. this coding style is very similar to coding styles that were popularized by pld programming languages of the mid-1980s, such as abel. for most fsm designs, the one always block fsm coding style is more verbose, more confusing and more error prone than a comparable two always block coding style.
Reference :http://www.sunburst-design.com/papers/cummingsicu2002_fsmfundamentals.pdf At then end of the day, it is still depending on your personal preference.