- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dave_59,
That is exactly the feature I was looking for! Thanks for pointing it out. -Martin
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page