Subject: Re: [sv-ac] Parameter passing - EXT 7
From: Joseph Lu (Juin-Yeu.Lu@sun.com)
Date: Mon Nov 17 2003 - 14:02:36 PST
Hi Surrendra,
By looking at the following BNF,
I am concerned about the range expression in which
identifiers have to be the members of
list_of_param_assignments preceded by
the key word "parameter".
Are you saying we can treat min_lat and max_lat as parameter identifiers
if they are defined outside of the property definition of the
attached example (follow) ?
If so, what would be the scoping mechanism for parameter identifiers?
In addition, if we don't have this feature, it would be a little bit
inconsistent with what LRM Section 20 wants to offer for the module
definition.
parameter_declaration:: = (Page 273)
parameter data_type list_of_param_assignments
...
list_of_param_assignments::= param_assignment {,param_assignment} (Page 275)
param_assignment::=parameter_identifier
range::= [msb_constant_expression:lsb_constant_expression] (Page 295)
msb_constant_expression::= constant_expression (Page 295)
lsb_constant_expression::= constant_expression (Page 295)
constant_expression::= constant_primary ... (Page 294)
constant_primary::= parameter_identifier ... (Page 296)
Thanks,
--Joseph
--------------------------------------------------
Joseph Lu
Processor and Network Product Group
Sun Microsystems
M/S USUN 03-202, 430 N. Mary Ave.,
Sunnyvale, CA 94086
408-616-5887
joseph@eng.sun.com
--------------------------------------------------
Surrendra Dudani wrote:
>
> Hi Joseph,
> It seems to me that your example is legal, and should be parsed correctly, with the exception of the declaration of types. The formal arguments of property/sequence definitions do not allow type specification. An actual argument can be an identifier that is a parameter declared outside of the property/sequence.
>
> [Y] 7 parameter in properties
> Based on the formal syntax definition of the current version (SV3.1),
> any cycle_delay_const_range_expression and range expression has
> to be a constant expression or a parameter identifier.
> However, a parameter identifier has to be an identifier proceeded with
> the keyword "parameter" used by SV to define a compile time constant.
> Based on the BNF in Annex A, it seems that any identifier defined in the
> property_formal_list is an identifier that can not be associated with an identifier that is latter used to define a compile-time constant. For example, the following property definitions
> are illegal. The solution can be found in this proposal.
> property follow(en, clk, leader, follower, sample_clock_edge = posedge ck or negedge ck, sint min_lat = 0, int max_lat = 0);
> @(sample_clock_edge) en |->
> (`true [*0:$] ##1 leader ##[min_lat:max_lat] follower) [*1:$] ;
> endproperty
> property foo(en, clk, width = 5);
> int temp [width];
> ...
> endproperty
>
> Surrendra
>
> **********************************************
> Surrendra A. Dudani
> Synopsys, Inc.
> 377 Simarano Drive, Suite 300
> Marlboro, MA 01752
>
> Tel: 508-263-8072
> Fax: 508-263-8123
> email: Surrendra.Dudani@synopsys.com
> **********************************************
--
This archive was generated by hypermail 2b28 : Mon Nov 17 2003 - 15:30:36 PST