• 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. How to print value of a systemverilog class instance when...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 65
  • Views 16410
  • 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

How to print value of a systemverilog class instance when a breakpoint is hit?

Avidan
Avidan over 6 years ago

I would like to print "obj" or "obj.m_name" every time the following UVM code line is hit. What should I pass to the -exec switch to make this happen?

stop -create -line 308 -file $UVM_HOME/src/base/uvm_heartbeat.svh -all -exec {value obj}

The obvious attempt: "value obj",  produces an error:

ncsim: *E,PNOOBJ: Path element could not be found: obj.

  • Cancel
Parents
  • StephenH
    StephenH over 6 years ago

    From the trials I made, it appears that the Tcl commands in the -exec string are being executed in the top-level module scope, not the context of where the breakpoint is hit (though I would defer to an expert to confirm/deny that). I was able to hack together a command that does what you want:

    stop -create -line 308 -file  -all -$UVM_HOME/src/base/uvm_heartbeat.svh exec {regexp -line {, scope \((.*)\)} [where] m curscope; value $curscope.obj}

    However I am wondering if you might be missing out on some of the objection tracing capability in the SimVision GUI. Can you describe the bigger picture of what you're trying to solve with this breakpoint? Maybe we can guide you to an easier solution...

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Avidan
    Avidan over 6 years ago in reply to StephenH

    StephanHyou're right in your observation that -exec is executed at the top module scope. To execute commands at the class scope, Cadence support proposed to inspect the variables after the break.

    stop -create -line 308 -file $UVM_HOME/uvm-1.2/src/base/uvm_heartbeat.svh -all
    while (1) {
        run;
        puts "obj is [value obj.m_name]"
        puts "target is [value target.m_name]"
    }

    see a working example here

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StephenH
    StephenH over 6 years ago in reply to Avidan

    That's OK, provided you don't want to set any other breakpoints, or do any interactive debug at the same time; the solution I proposed is more scalable and would not prevent you setting other breakpoints, single-stepping etc.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Avidan
    Avidan over 6 years ago in reply to StephenH

    I agree

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Avidan
    Avidan over 6 years ago in reply to StephenH

    I agree

    • 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