RE: [sv-ec] Semantics of anonymous_program

From: Rich, Dave <Dave_Rich_at_.....>
Date: Thu Feb 17 2005 - 23:48:12 PST
Kausik,

 

The intent was that an anonymous program was used in a package to
declare classes with program semantics. But it's not clear to me that
this construct is actually needed. My interpretation is that is only
matters where the class handle is instantiated. Given that we have
parameterized classes, you can't generate the code for a class until the
parameters have been elaborated; therefore that's where you decide if
event controls get scheduled in the reactive region or active region.
Given the example below, there are two counters, M.C1.counter, and
P.C2.counter, being scheduled to increment in the active and reactive
regions respectively.

 

Dave

 

 

package P;

  class C;

  int counter;

  task start_counter(const ref bit clock);

    forever @(posedge clock) counter = counter + 1;

  endtask

  endclass

endpackage

module M;

  import P::C;

  bit clk;

  always #10 clk++;

  C C1 = new;

  initial C1.start_counter(clk);

  //C1.counter increments scheduled in the active region

endmodule

 

program P;

  import P::C;

  C C2;

  initial C2.start_counter(M.clk);

  //C2.counter increments scheduled in the reactive region

endprogram

 

 

 

________________________________

From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Kausik Datta
Sent: Thursday, February 17, 2005 10:15 PM
To: Sv-Ec
Subject: [sv-ec] Semantics of anonymous_program

 

 

Hi, 
In SV3.1a LRM at BNF section A.1.10 there is a reference of
anonymous_program 

A.1.10 Package items 
package_item ::= 
package_or_generate_item_declaration 
| specparam_declaration 
| anonymous_program 
| timeunits_declaration 

But in the LRM there is not a single sentence for the purpose and the
usage of this construct. 
Can anyone help me in understanding the usage and semantics of this. 

Thanks 
Kausik Datta 

 

<<...>> 
Received on Thu Feb 17 23:48:21 2005

This archive was generated by hypermail 2.1.8 : Thu Feb 17 2005 - 23:48:36 PST