Home > Community > Forums > Hardware/Software Co-Development, Verification and Integration > About the object value of system verilog in ncsim

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 About the object value of system verilog in ncsim 

Last post Sun, Dec 28 2008 6:50 PM by Rex Chen. 1 replies.
Started by Rex Chen 25 Dec 2008 06:06 PM. Topic has 1 replies and 2279 views
Page 1 of 1 (2 items)
Sort Posts:
  • Thu, Dec 25 2008 6:06 PM

    • Rex Chen
    • Not Ranked
    • Joined on Thu, Dec 25 2008
    • Posts 2
    • Points 10
    About the object value of system verilog in ncsim Reply

    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

    • Post Points: 5
  • Sun, Dec 28 2008 6:50 PM

    • Rex Chen
    • Not Ranked
    • Joined on Thu, Dec 25 2008
    • Posts 2
    • Points 10
    Re: About the object value of system verilog in ncsim Reply

    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!

    • Post Points: 5
Page 1 of 1 (2 items)
Sort Posts:
Started by Rex Chen at 25 Dec 2008 06:06 PM. Topic has 1 replies.