RE: [sv-ec] new-ing of class embedded covergroup

From: Vreugdenhil, Gordon <gordon_vreugdenhil_at_.....>
Date: Fri Jul 31 2009 - 20:24:20 PDT
Certainly the intent was to disallow (1); I think that
the intent was to disallow (2) as well.  

My expectation is that the sentence:
   An embedded coverage group can be explicitly 
   instantiated in the new method.
should be read as:
   An embedded coverage group can be explicitly 
   instantiated in the new method of the class
   directly containing the embedded covergroup.

Gord.

-----Original Message-----
From: owner-sv-ec@server.eda.org on behalf of Neil Korpusik
Sent: Fri 7/31/2009 6:24 PM
To: SV_EC List
Cc: devrajg@cadence.com
Subject: [sv-ec] new-ing of class embedded covergroup
 
Forwarding email from a non-member (Devraj Goyal)

-------- Original Message --------
Date: Fri, 31 Jul 2009 16:39:37 +0530
From: Devraj Goyal <devrajg@cadence.com>
To: <sv-ec@server.eda.org>
Subject: new-ing of class embedded covergroup

Hi,

We have a query regarding new-ing of class embedded covergroup.

Ae per LRM (section 19.4):
"An embedded covergroup variable may only be assigned in the new method.
An embedded coverage group can be explicitly instantiated in the new
method. If it is not, then the coverage group is not created and no data
will be sampled."

This doesn't explicitly prohibit new-ing of one embedded covergroup in
another new method (example1 and example2, below), but it appears that
covergroup declared inside one class should be new-ed in the constructor
of the same class.

Please let us know your view on this.

Thanks,
Devraj

=========
Example1
=========
module top;
  class c1 ;
   reg m;
       covergroup cg;
                 coverpoint m;
       endgroup
   endclass

    class c2;
      c1 c1_obj;
      function new;
         c1_obj = new;
         c1_obj.cg = new;                    //Should this be allowed ?
      endfunction
    endclass

c2 c2_obj = new;
endmodule

=============
Example 2
=============
module top;
         reg clk;
         class c2;
               reg [4:0]p1;
         covergroup cg @clk;
            coverpoint p1;
         endgroup

         endclass
         class c1 extends c2;
               reg [4:0]p2;
               covergroup cg @clk;
                  coverpoint p1;
               endgroup
               function new(); p1 = 3;
                  super.cg = new ;               // Should this be allowed ?
              endfunction
         endclass
     c1 pc1;

endmodule



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Jul 31 20:28:27 2009

This archive was generated by hypermail 2.1.8 : Fri Jul 31 2009 - 20:29:11 PDT