Subject: [sv-ec] Type parameterisation of derived classes
From: Jonathan Bromley (jonathan.bromley@doulos.com)
Date: Mon Aug 18 2003 - 03:45:45 PDT
hi,
I have a query; I'd be grateful for clarification.
SV3.1 classes can be parameterized for type:
class C #(parameter type T = bit);
protected T v; // or whatever
...
endclass
OK, now let's derive something from C...
class D #(parameter type P = bit) extends C;
...
But I would like to be able to choose the value of C's
type parameter T, when I instantiate an object of class D.
I think I would like to be able to say
class D #(parameter type P = bit) extends C #(.T(P));
so that the derived class's type parameter is passed
on to the base class. But the syntax doesn't seem to
allow for this, and it is not mentioned in the LRM.
I believe that this facility is important to allow the
creation of various kinds of container class. It is
available in C++ using templates. Is this a deliberate
omission from SV3.1, an oversight in the BNF, or have I
missed something?
Thanks in advance
-- Jonathan Bromley ConsultantDOULOS - 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
This e-mail and any attachments are confidential and Doulos Ltd. reserves all rights of privilege in respect thereof. It is intended for the use of the addressee only. If you are not the intended recipient please delete it from your system, any use, disclosure, or copying of this document is unauthorised. The contents of this message may contain personal views which are not the views of Doulos Ltd., unless specifically stated.
This archive was generated by hypermail 2b28 : Mon Aug 18 2003 - 03:50:06 PDT