Display signal name/literal in test bench

前端 未结 1 742
你的背包
你的背包 2021-01-29 04:30

Is it possible to reference/display the name/literal of a signal in Verilog?

This would be a useful feature for creating a general signal checking function in a Verilog

相关标签:
1条回答
  • 2021-01-29 05:05

    In Verilog, the only way is by writing C code with the PLI/VPI.

    In SystemVerilog, you can use a quoting macro

    `define QUOTE(q) `"q`"
    `define DISPLAY(me) $display("Signal %s is %h",`QUOTE(me), me)
    
    `DISPLAY(my_signal);
    
    0 讨论(0)
提交回复
热议问题