• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. string macros in verilog AMS

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 66
  • Views 14535
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

string macros in verilog AMS

freitas
freitas over 12 years ago
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. 
  • Cancel
  • Pedro P
    Pedro P over 3 years ago

    Dear all,

    I have the same problem.

    this solution does not work

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

    neither this solution

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

    or this

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

     

    In systemverilog this is easily done, but what about in verilogAMS ?

    is there a way to use the input argument of a verilogAMS macro as a string with "" ?

     

    Thank you

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information