Results 1 to 5 of 5

Thread: State Machine Names in ModelSim

  1. #1
    Join Date
    Jun 2010
    Posts
    45
    Rep Power
    1

    Default State Machine Names in ModelSim

    Hi All,

    I have a question about state machines in ModelSim. When I simulate a Verilog design that includes a state machine and add the state register to the wave window in modelsim, it shows me the numerical value of the state. It would be nice if it converted that numerical value to the name I gave it in the source code. I've dug around in the documentation but do not see any reference to making that happen.

    My state machine coding style is to declare each state value as a localparam, which then get assigned to a state register. In SignalTap, for instance, these values automatically get converted to names in its waveform window.

    Is there a straightforward way to do this? Or am I simply expecting/wishing for something that does not exist?

  2. #2
    Join Date
    Nov 2009
    Posts
    985
    Rep Power
    1

    Default Re: State Machine Names in ModelSim

    AFAIK, the only way to achieve that is to use System Verilog instead of plain Verilog and use "enum" types for the state.

    Example:
    enum { S_FIRST, S_SECOND, S_THIRD } state;

  3. #3
    Join Date
    Jun 2010
    Posts
    45
    Rep Power
    1

    Default Re: State Machine Names in ModelSim

    Thank you, rbugalho.
    I had not thought of that possibility. I this case however, my design conforms to Verilog 2001, so I hesitate to apply that technique. Should be useful elsewhere though.
    -Martin

  4. #4
    Join Date
    Jan 2012
    Location
    California
    Posts
    95
    Rep Power
    1

    Default Re: State Machine Names in ModelSim

    Questa has automatic state machine recognition.

    In modelsim, you can use a user defined radix to display your state machine symbols. See the radix command in the reference manual or User defined radix in the User Guide.

  5. #5
    Join Date
    Jun 2010
    Posts
    45
    Rep Power
    1

    Default Re: State Machine Names in ModelSim

    Dave_59,
    That is exactly the feature I was looking for!
    Thanks for pointing it out.
    -Martin

Similar Threads

  1. VHDL State Machine: Bad State Transitions
    By Micekey in forum Quartus II and EDA Tools Discussion
    Replies: 5
    Last Post: March 17th, 2012, 02:57 AM
  2. how to show state names in the simulator waveform
    By nuflia in forum Quartus II and EDA Tools Discussion
    Replies: 6
    Last Post: August 7th, 2011, 06:43 AM
  3. Can't display state machine states -- register holding state machine bit "|c
    By mikedsouze in forum General Altera Discussion
    Replies: 4
    Last Post: January 7th, 2010, 03:44 AM
  4. it's weird that my state machine got into a wrong state
    By bigcat in forum General Altera Discussion
    Replies: 1
    Last Post: December 4th, 2009, 11:35 PM
  5. State machine transitioning into illegal state
    By wcalkins in forum Quartus II and EDA Tools Discussion
    Replies: 14
    Last Post: November 26th, 2008, 03:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •