[sv-bc] RE: Enum assignment via packed struct

From: Bresticker, Shalom <shalom.bresticker@intel.com>
Date: Wed Jun 20 2012 - 06:01:44 PDT

Hi,

This was previously noted in http://www.eda-stds.org/sv-bc/hm/5169.html.

However, it is not clear to me that according to a strict reading of the LRM, an enum may be a member of a packed struct.

Regards,
Shalom

From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Surya Pratik Saha
Sent: Wednesday, June 20, 2012 15:50
To: sv-bc@eda.org
Subject: [sv-bc] Enum assignment via packed struct

Hi,
As per LRM, an enum variable can only be assigned to another enum variable of same type or enum member. But if it is part of a packed struct, then the restriction can be overridden. Please see the following e.g.:

module top;
    typedef enum bit [1:0] {X, Y, Z} et;
    typedef struct packed {
        et e;
    } st;
    et e;
    st s;
    initial begin
        s = 4; // Passing
        e = 4; // Failing
    end
endmodule

Does LRM say anything about that? Should it not be disallowed by some way?

Regards
Surya

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
---------------------------------------------------------------------
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.
Received on Wed Jun 20 06:01:51 2012

This archive was generated by hypermail 2.1.8 : Wed Jun 20 2012 - 06:01:56 PDT