I am using the parameter keyword to define a state, i.e., RESET = 5’b00000. If I want to use $display to print out the state name instead of the binary representation, or display the state name in my simulation wave viewer, how can I do this? It doesn’t work to try to print it out as a string (as you would expect), so I’m wondering if this can be done.
I am using the parameter keyword to define a state, i.e., RESET = 5’b00000.
Share
I do not know of a way to automatically
$displaythe name of aparameter. However, if you don’t mind duplicating your code, you could create atask(orfunction) to accomplish your goal:I know of at least one (expensive) Verilog debugger which has the capability to recognize parameters and automatically display their names in its waveform viewer: the Verdi (formerly Debussy) nWave tool can do this.