• 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. Hardware/Software Co-Development, Verification…
  3. About the object value of system verilog in ncsim

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 49
  • Views 13683
  • 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

About the object value of system verilog in ncsim

Rex Chen
Rex Chen over 16 years ago

Hi,

I have a system verilog program as follows:

program p;
   class Foo1;
     int limit;
     function new(int i);
       this.limit = i;
     endfunction
     task print(int limit);
          $display("Limit %0d",limit);
     endtask
   endclass

   class Foo2;
     int limit, array[];
     Foo1 f1;
     function new(int i);
       f1 = new(i);
       this.limit = i;
     endfunction
     task print(int limit);
       for (int i=0;i<limit;i++)
            $display("%m: array[%0d]=%0d : %0d",i,array[i],limit);
       f1.print(limit);
     endtask
   endclass

   int limit = 2;
   initial begin
     Foo1 bar1;
     Foo2 bar;

     bar = new(5);
     bar1 = new(6);
     #5;
     bar.array = new[limit];
     bar.print(limit);
     bar.print(1);
     bar.print(2);
     bar1.print(3);
     bar1.print(4);
     end
endprogram

When I use "ncsim -tcl" to debug, I found that I can't get the object value. For example,

./class_in_class.sv:31      bar = new(5);
ncsim>  run -step
./class_in_class.sv:32      bar1 = new(6);
ncsim> value bar
ncsim: *E,PNOOBJ: Path element could not be found: bar.
ncsim>

I have no idea why the value of object can't be dumped. Should I specify the full scope name of "bar"?

I have tried "p.bar" but it doesn't work. Please someone tell me if it is a limitation or what should I type to get the object value. Thanks a lot! My ncsim version is 08.10-s008.

 

Best regards

rex

  • Cancel
  • Rex Chen
    Rex Chen over 16 years ago

    Hi,

    I found that I can get the object address with correct scope:

    Current scope is (p)
    Highest level modules:
    p
    ncsim> value p.unmblk1.bar
    @1_1
    ncsim>

    However, is there any way to get the value of object "bar"?

    Thanks a lot!

    • 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