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

From: Greg Jaxon <Greg.Jaxon@synopsys.com>
Date: Mon Oct 18 2010 - 12:38:23 PDT
I can see Shalom's legalistic point that array elements are only signed if they have a separately named type.
In that case I can only agree with Paul that the LRM has the wrong BNF to express this.
At the very least, Paul and I are being baited into seeing a legal signed struct and then switched into unsigning it
in favor of its packed_dimension addendum.

In addition I know that the LRM is taking the wrong linguistic approach in associating signedness with naming of data_types.
There is no inherent connection between naming and signedness.

There is a deep connection between aggregation and signedness.  In fact, it goes deep enough that I'd argue
using the signed or unsigned keywords should imply that the struct_or_union is packed.  That, in fact, we could
have dropped that keyword by adopting this convention.

http://www.eda.org/svdb/view.php?id=1291 presents the next coherent step in this direction.
This lets users introduce typenames only where it suits their needs, not ours.

Greg Jaxon


On 10/18/2010 8:09 AM, Bresticker, Shalom wrote:
Yes, I saw that 7.2.1 says, "The structures are declared using the packed keyword, which can be followed by the signed or unsigned keyword, according to the desired arithmetic behavior."

I read 7.4.1, "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," as taking priority over or declaring an exception to or supplementing 7.2.1.

Regards,
Shalom


-----Original Message-----
From: Paul Graham [mailto:pgraham@oasys-ds.com]
Sent: Monday, October 18, 2010 3:02 PM
To: Bresticker, Shalom
Cc: sv-bc
Subject: Re: [sv-bc] Sign of a signed packed array of struct

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
---------------------------------------------------------------------
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 12:38:40 2010

This archive was generated by hypermail 2.1.8 : Mon Oct 18 2010 - 12:41:29 PDT