RE: [sv-ec] BNF: constant_primary missing class scoped parameters

From: Francoise Martinolle <fm_at_.....>
Date: Mon Nov 13 2006 - 10:23:04 PST
 Brad,

I think that it would work.
Also it looks like we have a similar issue with 
ps_type_identifier.

ps_type_identifier is used in the simple_type rule to refer to a type in
a package.
I think it should also refer to a type declared inside a class.



simple_type ::= integer_type | non_integer_type | ps_type_identifier |
ps_parameter_identifier
also used in assignment_pattern_expression_type
Francoise
    '


-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Brad
Pierce
Sent: Monday, November 13, 2006 1:46 AM
To: sv-ec@eda.org
Subject: Re: [sv-ec] BNF: constant_primary missing class scoped
parameters

Francoise Martinolle writes:
>The solution seems to be to add :
>
>[package_scope] {[class_scope]} parameter_identifier constant_select in
the
>constant_primary derivation rule.

How about instead changing the first production in
ps_parameter_identifier (A.9.3) from

   [ package_scope ] parameter_identifier

to

   [ class_scope | package_scope ] parameter_identifier

? -- Brad

[In reply to http://www.eda-stds.org/sv-ec/hm/3791.html .]

________________________________

From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Francoise Martinolle
Sent: Friday, November 10, 2006 10:58 AM
To: sv-ec@eda.org
Subject: [sv-ec] BNF: constant_primary missing class scoped parameters


I think that there is an oversight in the BNF for constant expressions.
It does not allow a class scoped parameter expression as a constant
expression.
 
For example we should be able to write:
 
class c #(p = 0);
endclass
 
class b #(q = c#()::q ); // in a parameter declaration
 
   bit [ c#()::q :7] m1; // in a constant range
 
endclass
 
Right now the BNF is:
 
parameter_declaration ::=

parameter data_type_or_implicit list_of_param_assignments

| parameter type list_of_type_assignments

 

list_of_param_assignments ::= param_assignment { , param_assignment }

param_assignment ::= parameter_identifier { unpacked_dimension } =
constant_param_expression

 

constant_param_expression ::=

constant_mintypmax_expression | data_type | $

 

constant_mintypmax_expression ::=

constant_expression

| constant_expression : constant_expression : constant_expression

constant_expression ::=

constant_primary

| unary_operator { attribute_instance } constant_primary

| constant_expression binary_operator { attribute_instance }
constant_expression

| constant_expression ? { attribute_instance } constant_expression :
constant_expression

 

constant_primary ::=

primary_literal

| ps_parameter_identifier constant_select

| specparam_identifier [ constant_range_expression ]

| genvar_identifier32

| [ package_scope | class_scope ] enum_identifier

| constant_concatenation

| constant_multiple_concatenation

| constant_function_call

| ( constant_mintypmax_expression )

| constant_cast

| constant_assignment_pattern_expression

| type_reference29

ps_parameter_identifier ::=

[ package_scope ] parameter_identifier

| { generate_block_identifier [ [ constant_expression ] ] . }
parameter_identifier

 

package_scope ::=

package_identifier ::

| $unit ::

 

The solution seems to be to add :

[package_scope] {[class_scope]} parameter_identifier constant_select in
the constant_primary derivation rule.

 

Francoise

    
Received on Mon Nov 13 10:23:12 2006

This archive was generated by hypermail 2.1.8 : Mon Nov 13 2006 - 10:24:41 PST