RE: [sv-ec] calls to constructor after "begin"

From: Jonathan Bromley <jonathan.bromley_at_.....>
Date: Wed Dec 27 2006 - 08:25:16 PST
> The constraint really should be (in imprecise language)
> that the first statement other than a scope entry "begin"
> must be the super.new call.

Just a small side-issue...  Suppose we have a super.new
that expects one int argument, how about these two cases?

case 1: conditional call
~~~~~~~~~~~~~~~~~~~~~~~~

function new(int A);
  if (A!=0)
    super.new(A);
  else
    super.new(-1);
...

case 2: call with function or expression in arguments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function new (int A);
  super.new(A-1); 
  // or even...
  // super.new(some_function(A));

At least one simulator let me get away with case 1 the
last time I tried it.  I haven't checked case 2. 
Clearly it involves something being executed before 
super.new, and yet it looks fairly sensible (especially 
if some_function is a static method of the class).
-- 
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223                   Email: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573                           Web: http://www.doulos.com

The contents of this message may contain personal views which 
are not the views of Doulos Ltd., unless specifically stated.
Received on Wed Dec 27 08:32:16 2006

This archive was generated by hypermail 2.1.8 : Wed Dec 27 2006 - 08:32:23 PST