Re: [sv-bc] Sign of a signed packed array of struct

From: Paul Graham <pgraham@oasys-ds.com>
Date: Mon Oct 18 2010 - 06:01:58 PDT

Shalom,

In this example:

    struct packed signed { ... } [3:0] S;

it's not clear to me what the lrm says about the sign of the array. This example declares both an anonymous struct type and an anonymous array type. Is the struct declared as signed, or is the array declared as signed, or both? Perhaps I'm reading too much into this, but note that the syntax above is explicitly given in section 7.2, on structures. If the location of this syntax definition is significant, this suggests that the struct type is signed and not the array type. But I'd prefer an explicit statement from the lrm.

Paul
----- Original Message -----
From: "Shalom Bresticker" <shalom.bresticker@intel.com>
To: "Paul Graham" <pgraham@oasys-ds.com>
Cc: "sv-bc" <sv-bc@eda.org>
Sent: Saturday, October 16, 2010 12:55:06 PM
Subject: RE: [sv-bc] Sign of a signed packed array of struct

But that is what the LRM says.

You can argue with whether it should be that way, but that is what is says now.

Shalom

> -----Original Message-----
> From: Paul Graham [mailto:pgraham@oasys-ds.com]
> Sent: Saturday, October 16, 2010 1:25 AM
> To: Bresticker, Shalom
> Cc: sv-bc
> Subject: Re: [sv-bc] Sign of a signed packed array of struct
>
> Shalom,
>
> I find it ambiguous whether this "packed array is declared as signed":
>
> struct packed signed { ... } [3:0] S;
>
> It *looks* like the packed struct is declared as signed, but then I see
> the little range tucked in at the end of the declaration. Does this
> mean that the array is declared as signed and the struct is *not*
> declared as signed? Just because the struct is unnamed does not mean
> that the signed keyword should not apply to it.
>
> Paul
> ----- Original Message -----
> From: "Shalom Bresticker" <shalom.bresticker@intel.com>
> To: "Paul Graham" <pgraham@oasys-ds.com>, "sv-bc" <sv-bc@eda.org>
> Sent: Friday, October 15, 2010 8:14:32 AM
> Subject: RE: [sv-bc] Sign of a signed packed array of struct
>
> 7.4.1 says,
>
> "If a packed array is declared as signed, then the array viewed as a
> single vector shall be signed. The individual elements of the array are
> unsigned unless they are of a named type declared as signed. A part-
> select of a packed array shall be unsigned."
>
> So I would assume S to be signed and S[0] as unsigned.
>
> Shalom
>
> > -----Original Message-----
> > From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
> > Paul Graham
> > Sent: Saturday, September 11, 2010 12:11 AM
> > To: sv-bc
> > Subject: [sv-bc] Sign of a signed packed array of struct
> >
> > Given this array-of-struct declaration:
> >
> > struct packed signed { ... } [3:0] S;
> >
> > I can't tell if the signed keyword applies to the struct or to the
> > array as a whole. Is S signed? Is S[0] signed?
> >
> > Paul
>
> ---------------------------------------------------------------------
> 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.
>

---------------------------------------------------------------------
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.
Received on Mon Oct 18 06:02:37 2010

This archive was generated by hypermail 2.1.8 : Mon Oct 18 2010 - 06:05:16 PDT