Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

FSM'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.

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    What do you plan to use this "register group" for if there were such group? I don't think there is one. This reminds me a SignalTap II feature that assists you debugging registers implementing state machine. It may be the most precise way to know how states are encoded in the post-fitting netlist.