RE: [sv-bc] $bits question

From: francoise martinolle <fm_at_.....>
Date: Tue Jan 17 2006 - 10:10:37 PST
 
I would like to propose that we do not allow $bits to take an argument which
is an anonymous data type and I would
like to add the restriction that the data type must be a bit-stream type.
 
If you want, I can file an errata.
 
Francoise
       '


  _____  

From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Rich,
Dave
Sent: Friday, January 13, 2006 1:54 PM
To: francoise martinolle; sv-bc@eda.org
Subject: RE: [sv-bc] $bits question



I think we need to add a restriction that limits $bits to the bit-stream
types; i.e. only those types that allow us to access individual bits of
their data.

 

I seem to recall a big debate about whether to allow anonymous types in
places other than in the declaration of a variable, but I don't remember the
reason why we agreed to allow it and not require an intermediate typedef. I
think it is one of those things that would take more effort to define than
its worth, but I would support a proposal.

 

If we do agree the argument to $bits is legal, however odd, then the enum
label is created as a symbol in the current scope. So the reference to x is
legal, and the duplicate symbol is illegal.

 

Dave

 

 


  _____  


From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
francoise martinolle
Sent: Friday, January 13, 2006 9:52 AM
To: sv-bc@eda.org
Subject: [sv-bc] $bits question

 

Is there any semantic restriction on the data type which can be passed as an
argument to $bits?

It looks to me like this argument can be syntactically a data_type, so is
this legal"

typedef bit [ $bits(enum { x }) : 0] mytype;

Where is the enumeration constant declared? In the scope containing the
declaration of "mytype"?

So is it legal to reference x outside the typedef?

mytype v;

initial

   v = mytype'(x);

 

and is the following illegal?

typedef bit [ $bits(enum { x }) : 0] mytype1;

typedef bit [ $bits(enum { x }) : 0] mytype2;  // duplicate symbol x
Received on Tue Jan 17 10:10:48 2006

This archive was generated by hypermail 2.1.8 : Tue Jan 17 2006 - 10:11:34 PST