Re: [sv-bc] assignment pattern to scalar

From: Greg Jaxon <Greg.Jaxon@synopsys.com>
Date: Thu Oct 21 2010 - 17:02:46 PDT
I was thinking more directly of

enum [3:0] {e[10]} V, W, X;

V = '{1'b1, 1'b1, 1'b1, 1'b1};
W = '{e5};
X = '{default: e0};


I don't think any of these make appropriate use of the assignment pattern rules.
Although it can always be argued that some of them ought to work for various reasons,
I don't see very much benefit in it.

What Brad notes below is a common oversight in user code, but it is an error
for entirely different reasons.  The above examples are bad because an enum really
cannot be regarded as an aggregate of smaller parts, and that is what the '{...} notation
was designed to treat.

Greg

On 10/21/2010 10:43 AM, Brad Pierce wrote:
Shalom,

Consider a struct variable with field of enum type, and an attempted
assignment to it of '{default:0}. That wouldn't work, because you
can't assign 0 to a variable of enum type without an explicit cast.

-- Brad

On Thu, Oct 21, 2010 at 2:45 AM, Bresticker, Shalom
<shalom.bresticker@intel.com> wrote:

Greg,



I did not understand what you meant.

Could you clarify?



Thanks,

Shalom





On a related note: we don't allow an assignment pattern to construct an enum
type.
As pointless as it seems to still think enums are strongly typed, I'm still
for requiring that this be done with cast operations,
unless the committee drastically rewrites section 6.19.3.

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

    

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean. Received on Thu Oct 21 17:03:04 2010

This archive was generated by hypermail 2.1.8 : Thu Oct 21 2010 - 17:04:50 PDT