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

From: Neil Korpusik <Neil.Korpusik_at_.....>
Date: Wed Jan 03 2007 - 16:54:22 PST
<Forwarding bounced email from Jonathan Bromley>

-------- Original Message --------
Subject: RE: [sv-ec] calls to constructor after "begin"
Date: Wed, 27 Dec 2006 16:25:16 +0000
From: Jonathan Bromley <jonathan.bromley@doulos.com>
To: SV_EC List <sv-ec@eda-stds.org>

> 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.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Jan 3 16:55:55 2007

This archive was generated by hypermail 2.1.8 : Wed Jan 03 2007 - 16:56:08 PST