[sv-bc] Re: Proposal for SV-BC-105 aggregate expressions vs concatenation


Subject: [sv-bc] Re: Proposal for SV-BC-105 aggregate expressions vs concatenation
From: Paul Graham (pgraham@cadence.com)
Date: Mon Jan 19 2004 - 14:41:52 PST


Dave,

If the only reason to have type:value is to provide a shortcut for
initialization of an unpacked struct containing an enum member, then I think
that's not much of a reason! It introduces a lot of complex, special
language in the LRM just to make initializing some structs a little easier.

If a packed struct contains an enum you can initialize it with zeros:

    typedef enum {yes,no,maybe} choice_t;
    struct packed {
        logic foo;
        ...
        choice_t q1;
        choice_t q2;
        ....
    } S;

    S = 0;

I guess packed structs violate the intent of strong typing!

Paul



This archive was generated by hypermail 2b28 : Mon Jan 19 2004 - 14:48:09 PST