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 xReceived on Fri Jan 13 10:54:38 2006
This archive was generated by hypermail 2.1.8 : Fri Jan 13 2006 - 10:55:30 PST