• 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. Using DPI to get the current value of a signal

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 65
  • Views 16020
  • 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

Using DPI to get the current value of a signal

sdav
sdav over 15 years ago
I'm using a C++ interface with SystemVerilog DPI to drive my Verilog simulation. From C++ I'd like to call a function which returns the current value of a Verilog signal. Ideally this function would take a string as an input parameter (e.g. "testbench.u1.u2.dout") and then return the reg value of the signal. I'm just not sure how to implement this in Verilog. $display, $monitor, $strobe all display to stdout (I know there are "file" versions of these system tasks, too). The TCL command "value" seems ideal, but how can I access the returned data in Verilog and then return it to C++? Anyway, I'm posting here because I've thought about this for a while and can't come up with an elegant way to do it. But, I'm convinced that there is a way and I'm not seeing it. Thanks, Shirley
  • Cancel
Parents
  • sdav
    sdav over 15 years ago

    Thank you for the quick response and the pointer to VPI -- I'll take a look at it.  I have used the tutorials and engineering notebooks for DPI, but not for VPI.  I am using vpi_printf already, so it doesn't seem too foreign a concept to use more VPI functions in my environment.

    Shirley
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • sdav
    sdav over 15 years ago

    Thank you for the quick response and the pointer to VPI -- I'll take a look at it.  I have used the tutorials and engineering notebooks for DPI, but not for VPI.  I am using vpi_printf already, so it doesn't seem too foreign a concept to use more VPI functions in my environment.

    Shirley
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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