Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

How to show enum names in gtkwave?

Added by Soya Ohnishi about 1 year ago

Hello.

I learned that verilator and gtkwave support enums from chisel3 mailinglist, so I tried to use this feature and put commands below(systemv.v and sim_main.cpp are attached).

$verilator --cc systemv.v --exe sim_main.cpp --trace-fst
$make -j -C obj_dir -f Vsystemv.mk
$cd obj_dir
$./Vsystemv

However, gtkwave shows still binary numbers even if `DataFormat` is switched to `Enum`.

How should I do to show enum names in gtkwave?

I use gtkwave ver3.3.99 and verilator ver4.010

sim_main.cpp View (660 Bytes)

systemv.v (513 Bytes)


Replies (4)

RE: How to show enum names in gtkwave? - Added by Wilson Snyder about 1 year ago

You have "metal" declared as a logic instead of newMetal type.

RE: How to show enum names in gtkwave? - Added by Soya Ohnishi about 1 year ago

Thanks for your reply.

You said

You have "metal" declared as a logic instead of newMetal type.

Do you mean I should rewrite code like below?

rewrite from
typedef enum logic [1:0] {none, bronze, silver, gold} newMedal;   
reg   [1:0] medal;
to
enum logic [1:0] {none, bronze, silver, gold} medal;

However, gtkwave still show binary numbers and doesn't show enum's element names like 'none', 'bronze', 'silver' or 'gold'.

Thanks again.

RE: How to show enum names in gtkwave? - Added by Wilson Snyder about 1 year ago

see t_trace_complex.v in the git repo, e.g.

typedef enum int { ZERO=0, ONE, TWO, THREE } enumed_t;
enumed_t v_enumed;

RE: How to show enum names in gtkwave? - Added by Soya Ohnishi about 1 year ago

Thanks! Results I hoped are showed!

    (1-4/4)