Re: [sv-bc] RE: [sv-ec] Dynamic type parameter array

From: Steven Sharp <sharp_at_.....>
Date: Tue Aug 05 2008 - 14:55:38 PDT
>From: Greg Jaxon <Greg.Jaxon@synopsys.com>

>I generally agree that we missed a lot of sensible syntax in this region.
>I believe some semantic rules are also required to understand the meaning
>of T'{default:...} for an associative array type T.
>
>Is this meant to define an element for every possible index value?
>
>Or are you only thinking of an assignment situation AA = '{default:1};
>where you want to reset a sparse set of elements to 1 without
>adding any new elements to the collection.  I don't think that meaning
>emerges naturally from the assignment pattern concept.  I'd oppose
>that reading.

Greg,

I think the semantics are already specified in the LRM.  In 5.13 of the
2005 LRM, it says

  "If a default value is specified, then reading a nonexistent element
   shall yield the specified default value.  Otherwise, the default
   initial value as described in Table 5-1 shall be returned."
   
So the default has the effect of setting the apparent value for every
possible index value not explicitly set to something different by the
assignment pattern.  But it does not do it by defining an element for
those index values.  It does it by changing the default value read for
a nonexistent element.  The array is still sparse, with only the
non-defaulted index values explicitly represented.

Your AA = '{default:1}; does not reset the sparse set of existing
elements to 1, nor does it add any new elements to the collection.
It results in an array containing no elements at all, but for which
reading from any index results in 1.

Steven Sharp
sharp@cadence.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Aug 5 14:57:30 2008

This archive was generated by hypermail 2.1.8 : Tue Aug 05 2008 - 14:57:57 PDT