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

From: Greg Jaxon <Greg.Jaxon_at_.....>
Date: Mon Aug 04 2008 - 09:39:15 PDT
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.

I can see the '{1,2,3} assignment patterns and even examples like
'{"string1":42, "Hello World":-1} being handy as associative array
initializers, but the forms '{type_id:...} and '{default:...}
involve matches against some existing structure (or content), and
this simply hasn't been specified.

Once assignment patterns for dynamic arrays are well-defined, and
work as initializers for ordinary dynamic arrays, there is a natural
question of what it means to add the "parameter" keyword.  Since this
precludes later reassignments, much of the "dynamic" character vanishes.
What would be "queue-like" about an elaboration time constant queue?
The "sparseness" property of associative arrays seems to be the only
useful semantics here.

This seems more like enhancement than correcting an oversight, but
perhaps simulators already provide assignment patterns for dynamic
objects and can back the slight syntax extension with sensible semantics.
I'd like to know more about those semantics to understand the proposal.

Greg

Rich, Dave wrote:
> I think this was an oversight in the BNF. It should be legal.
> 
>  
> 
> ------------------------------------------------------------------------
> 
> *From:* owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] 
> *On Behalf Of *Surya Pratik Saha
> *Sent:* Friday, August 01, 2008 1:58 AM
> *To:* sv-ec@server.eda.org; sv-bc@server.eda.org
> *Subject:* [sv-ec] Dynamic type parameter array
> 
>  
> 
> Hi,
> As per 1800 2005 SV LRM BNF, parameter array rule is defined as:
> 
> *param_assignment ::= parameter_identifier { unpacked_dimension } = 
> constant_param_expression
> unpacked_dimension ::= [ constant_range ]
> | [ constant_expression ]*
> 
> So, by BNF parameter can't be declared with dynamic type (associative or 
> queue or dynamic). But can we declare dynamic type parameter array by 
> using typedef. Is the e.g. legal:
> 
> *module top;
>     typedef int myassoc[*];
>     **parameter int myparam1[*] = '{default:1}; // illegal
>     **parameter myassoc myparam2 = '{default:1}; // Is it legal
> endmodule*
> 
> If 2nd declaration is legal then why BNF restricts the 1st declaration.
> 
> -- 
> 
> Regards
> 
> Surya
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Aug 4 09:40:24 2008

This archive was generated by hypermail 2.1.8 : Mon Aug 04 2008 - 09:41:14 PDT