• 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. Simple question about $display

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 64
  • Views 13147
  • 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

Simple question about $display

archive
archive over 17 years ago

Hello experts, Here's something I just can't figure out, but might be trivial for someone out there ... If I define a global as a hierarchical path like so : `define HIER_PATH Itop.I1.I2.I3 How can I use $display (or any alternative) to print the value of `HIER_PATH in a message. I'm aware of %m and %M, but they don't apply here. Thanks!


Originally posted in cdnusers.org by nnxx
  • Cancel
  • archive
    archive over 17 years ago

    As you stated, the %m is the only way I can think of. You would need to put a function in the module represented by I3 and have it display the value of %m.

    You might also want to post this question to the Simulation Forum and perhaps someone over there might have something more elegant, perhaps using VPI.

    Tim


    Originally posted in cdnusers.org by tpylant
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    If you are using SystemVerilog, there is a new macro directive `" that allows you to build a string inside a macro. The following worked in my little testcase.

    `define HIER_PATH Itop.I1.I2.I3
    `define disp(hp) `"hp`"
    initial $display(`disp(`HIER_PATH));

    I had to use the `" in a macro, I couldn't use it directly in the $display statement. It seems as if it is only legal in a macro, not in the actual Verilog text.


    Originally posted in cdnusers.org by TAM
    • 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