Dave, Thanks for your reply. So it seems anonymous program block is actually not required in a design. But even if someone writes this and declare a class (C) within it, then what will be way of access? Is it P::C where P is the name of the package. If that is true then can we assume we can't do declarations with same name in two different anonymous program blocks within a package. Thanks Kausik _____ From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Rich, Dave Sent: Friday, February 18, 2005 1:18 PM To: kausikd@cal.interrasystems.com; Sv-Ec Subject: RE: [sv-ec] Semantics of anonymous_program 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 Fri Feb 18 01:44:33 2005
This archive was generated by hypermail 2.1.8 : Fri Feb 18 2005 - 01:45:11 PST