Re: [sv-bc] $bits question

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Tue Jan 17 2006 - 10:46:18 PST
Why disallow an anonymous data type?  Why require an intermediate
typedef? 

 

For example, if

 

   logic [N-1: 0] x;

 

then why can I ask for $bits(x), but not for $bits(type(x))?

 

It seems like an arbitrary new restriction to me, not a bug fix.

 

-- Brad

 

________________________________

From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
francoise martinolle
Sent: Tuesday, January 17, 2006 10:11 AM
To: 'Rich, Dave'; 'francoise martinolle'; sv-bc@eda.org
Subject: RE: [sv-bc] $bits question

 

 

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:46:29 2006

This archive was generated by hypermail 2.1.8 : Tue Jan 17 2006 - 10:46:44 PST