Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to display ASCII state when simulating one-hot encoding FSM ?

Status
Not open for further replies.

lx1019

Newbie level 4
Joined
Nov 15, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,323
I implemented a one-hot FSM using the systemverilog "enum" type as suggested in this page : https://www.verilogpro.com/systemverilog-one-hot-state-machine/
And I used "reverse case statement" as declared in that page.

But in Simvision the state can't be displayed as ASCII. In the waveform, state[:] is shown as binary code.
Do you know how to resolved that?
 

State is declared as logic [3:0], not ASCII. You happened to use parameters with human readable names to define it but that doesn't make it ASCII.

You'd need to explicitly code your own mux or if/then/else statement to assign a string the name of your state based on the value state if you want to see strings in simulation.

Particularly with 1-hot why bother?
 

I implemented a one-hot FSM using the systemverilog "enum" type as suggested in this page : https://www.verilogpro.com/systemverilog-one-hot-state-machine/
And I used "reverse case statement" as declared in that page.

But in Simvision the state can't be displayed as ASCII. In the waveform, state[:] is shown as binary code.
Do you know how to resolved that?

you can create mnemonics in the simulation environment, regardless of how you coded the states. it's handy.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top