Altera_Forum
Honored Contributor
12 years agoFSM's state register is displayed incorrectrly in Node Finder
I'm trying to implement a finite state machine for the first time. I came up with 7 states and decided to encode them simply in 3 bits. I have defined state names as parameters.
module mymodule# ( parameter foo = 3'b000, // Initial state
parameter bar = 3'b001, // Another state
parameter baz = 3'b010, // Yet another state
/* 4 more... */
)(
input clk,
input video_i,
/*...*/
);
reg state; // state register, 3 bits long
initial
begin
/*<...>*/
state = foo; // setting the initial state
end
always@(posedge clk)
case(state)
foo:
if(video_i == 1'b1)
begin
state <= bar; // changing the state
/* Do something else */
end
bar:
/* <...> */
When after compiling the project I list all nodes in Node Finder I can't find the state register group that I expected to see. Instead, there are single registers state.foo, state.bar, state.baz and so on. I tried to abandon the named states but when I did so, there were state.000, state.001, ... . What this dot notation even mean? What am I doing wrong? It's probably this case structure that screws it all up.