7

Can I make ModelSim simulation to display text (rather than a numeric value) on a signal? I have a couple of state-machine states say,

localparam S_IDLE  = 2'b00; 
localparam S_START = 2'b01; 
localparam S_STOP  = 2'b10;

Is there a way to display S_IDLE for example, on a signal rather than 00? Thanks.

toolic
  • 46,418
  • 10
  • 64
  • 104
SleepingSpider
  • 1,056
  • 4
  • 17
  • 35

2 Answers2

8

One thing you can do that is should work across all simulators is to create a signal that holds an ascii string, and then change the radix of that signal to ascii in the simulation window:

reg [8*8-1:0] mytextsignal;
always@(state) begin 
    case(state) 
        S_IDLE : mytextsignal = "  S_IDLE";
        S_START: mytextsignal = " S_START";
        S_STOP:  mytextsignal = "  S_STOP";
        default: mytextsignal = " UNKNOWN";
     endcase
 end

It should show up as readable text in the waveform viewer.

Tim
  • 33,823
  • 10
  • 86
  • 115
  • 1
    Verilog mode has this feature. http://www.veripool.org/wiki/verilog-mode/verilog-mode_veritedium#SEC23 – Moberg Nov 01 '13 at 11:21
2

In Modelsim you can add FSM using following steps:

  1. use FSM recognition and FSM coverage options (+acc, +cover) during compile,
  2. use the -fsmdebug and -coverage options on the vsim command line.

Check ModelSim User's Manual for more details. Notice that using View > FSM list you can check all FSMs detected by ModelSim and add it to a wave.

Qiu
  • 5,222
  • 10
  • 45
  • 53