Re: [sv-bc] packed array question

From: Steven Sharp <sharp_at_.....>
Date: Fri Dec 16 2005 - 17:47:14 PST
>From: "Brad Pierce" <Brad.Pierce@synopsys.com>

>But, according to the current BNF you can't do --
>
>   bit [4:0] signed [31:0] i;
>
>The BNF would make more sense as --
>
>  packed_dimension ::=
>      [ signing ] '[' constant_range ']'
>   |  [ signing ] unsized_dimension
>
>Signedness should be an attribute of a dimension.

The Cadence datatype proposal to 1364 had this capability.  Most
people found it confusing when they first saw the description.
For most people, it is only after playing with packed arrays for
a while that they run into the need to control signedness of
slices at each level, and then suddenly the description makes
sense (and they realize that SV lacks a useful capability).

I don't believe you can add this to SV now, because it has
already defined that the 'signed' keyword on the far left applies
to the rightmost dimension.  This prevents you from having the
'signed' keyword apply to the dimension immediately after it.

I believe it is possible in SV to use typedefs to get one of the
lower dimensions to be signed, but there is no way to get multiple
dimensions to be signed, even building it with multiple levels of
typedefs.  This could probably be fixed though.

Steven Sharp
sharp@cadence.com
Received on Fri Dec 16 17:47:24 2005

This archive was generated by hypermail 2.1.8 : Fri Dec 16 2005 - 17:47:56 PST