Quantcast
Channel: Cadence Functional Verification Forum
Viewing all articles
Browse latest Browse all 1074

string macros in verilog AMS

$
0
0

Hello, 

Does anyone know how to define string  macros in Verilogams?

 

Today I have to do the following:

`define display_value(str, sig) $display(“Value of signal %s is equal to %b”,  str, sig)

 If I place the following macro in my code

`display_value(“mysignal”,mysignal);

 The compiler translates to

$display(“Value of signal %s is equal to %b”,  “mysignal”, mysignal);

 Unfortunately, it forces me to duplicate information and maintain more code.

 Ideally I would like a macro that takes a single argument to create the signal name as well as its respective content.  Such as:

`define display_value(sig)    ????????????????

I wonder if there's a trick in verilogams to accomplish that. 

Any ideas?

Thanks,

Art. 


Viewing all articles
Browse latest Browse all 1074

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>