Number | 53
|
Category | errata
|
Synopsis | net_lvalue BNF allows {x[i]}
|
State | lrmdraft
|
Class | errata-discuss
|
Arrival-Date | Oct 16 2001
|
Originator | Shalom.Bresticker@motorola.com
|
Release | 2001b, Syntaxes 9-1, 9-2, 9-3, A.8.1, A.8.5
|
Environment |
http://boydtechinc.com/btf/archive/btf_2000/0990.html http://boydtechinc.com/btf/archive/btf_2001/1593.html http://boydtechinc.com/btf/archive/btf_2001/1604.html |
Description |
Re: net_lvalue BNF rule Date: Tue, 16 Oct 2001 16:38:52 +0200 From: Shalom Bresticker <Shalom_Bresticker-R50386@email.mot.com> Organization: Motorola Semiconductor Israel, Ltd. (MSIL) To: Dennis Marsa <drm@xilinx.com> CC: btf@boyd.com References: 1 Dennis, You are correct. I brought this up in July 2000 on Draft 5, but it was not corrected in Draft 6. See http://boyd.com/1364_btf/btf_2000/0149.html , attached. Thanks, Shalom Dennis Marsa wrote: The BNF rules for net_lvalue and net_concatenation_value seem to be inconsistent with respect to index expressions. The net_lvalue rule requires the use of constant expressions in any indexing operations. It also allows concatenations, via the net_concatenation, and ultimately the net_concatenation_value rule. In the net_concatenation_value rule, non-constant expressions are allowed in indexing operations. Thus, the following inconsistency: module example; integer i; wire [31:0] a; assign a[i] = 1'b0; // illegal syntax assign {a[i]} = 1'b0; // legal syntax endmodule The first assign is illegal since only the rule for net_lvalue comes into play, and it requires constant index expressions. The second assign is legal since net_concatenation_value comes into play, which allows non-constant index expressions. Which rule (net_lvalue or net_concatenation_value) is incorrect wrt to constness of index expressions? Or is this the intended behavior? Dennis Marsa Xilinx, Inc. -- ************************************************************************** Shalom Bresticker Shalom.Bresticker@motorola.com Motorola Semiconductor Israel, Ltd. Tel #: +972 9 9522268 P.O.B. 2208, Herzlia 46120, ISRAEL Fax #: +972 9 9522890 ************************************************************************** Re: IEEE 1364-2000 Draft 5 From: Shalom Bresticker (shalom@msil.sps.mot.com) Date: Wed Jul 12 2000 - 03:47:34 PDT Next message: Thomas Fitzpatrick: "BNF parser, anyone?" Previous message: Shalom Bresticker (r50386): "Errata in IEEE 1364-2000 Draft 5" Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Patrick and IEEE 1364: Patrick Doane wrote: > So far, I've noticed one additional major problem: > > wire [0:3] x; > integer i; > > assign x[i] = 1'b0; // <-- this is illegal > assign {x[i]} = 1'b0; // <-- this is legal! > > Note that this is just from a syntactic level, and I have not had a chance > to review the language document to see if it makes any additional semantic > requirements that would disallow it. > > It is however a little disconerning to see that using a concatenation in > an net_lvalue changes whether or not a range_expression is legal for use > on a hierarchical_net_identifier. Hi, Patrick. It took me a while to figure out what is going on. Your second example is not legal - see Table 6-1 on p. 73. It is true that the grammar appears to allow it, but that was unintended. ( net_lvalue may be net_concatenation and net_concatenation allows non-constant range expressions.) Apparently the following happened: net_concatenation and variable_concatenation were defined for general use. In the end, they found use only in net_lvalue and variable_lvalue. However, we forgot that net_concatenation allows non-constant ranges whereas net_lvalue is restricted to constant ranges. This problem does not arise in variable_lvalue. So: the definition of net_lvalue must be fixed, and net_concatenation and net_concatenation_value are without use. > As a more minor comment, the rule for variable_concatenation_value could > be: > > variable_concatenation_value ::= variable_lvalue > > since they share the same productions. Correct, but it should be reversed: variable_lvalue ::= variable_concatenation_value . In related issues, the production of net_lvalue should be copied or moved from Syntax 9-3 to Syntax 6-1. Also, variable_concatenation is referenced in Syntax 9-1, 9-2, 9-3, but not defined there, only in App. A. Thanks again, Patrick ! Shalom -- ************************************************************************ Shalom Bresticker email: shalom@msil.sps.mot.com Motorola Semiconductor Israel, Ltd. Tel #: +972 9 9522268 P.O.B. 2208, Herzlia 46120, ISRAEL Fax #: +972 9 9522890 http://www.motorola-semi.co.il/ ************************************************************************ |
Fix |
* New productions for net_lvalue and variable_lvalue (This incorporates changes from #181) net_lvalue ::= hierarchical_net_identifier {'['constant_expression']'} ['['constant_range_expression']'] | '{' net_lvalue { ',' net_lvalue } '}' variable_lvalue ::= hierarchical_variable_identifier {'['expression']'} ['['range_expression']'] | '{' variable_lvalue { ',' variable_lvalue } '}' * Eliminate productions: net_concatenation net_concatenation_value variable_concatenation variable_concatenation_value |
Audit-Trail |
From: Dennis Marsa <drm@xilinx.com> To: Shalom.Bresticker@motorola.com Cc: btf-bugs@boyd.com Subject: Re: errata/53: net_lvalue BNF allows {x[i]} Date: Tue, 16 Oct 2001 09:48:34 -0600 Shalom.Bresticker@motorola.com wrote: > > Precedence: bulk > > >Number: 53 > >Category: errata > >Originator: Shalom.Bresticker@motorola.com > >Description: > > Re: net_lvalue BNF rule > Date: > Tue, 16 Oct 2001 16:38:52 +0200 > From: > Shalom Bresticker <Shalom_Bresticker-R50386@email.mot.com> > Organization: > Motorola Semiconductor Israel, Ltd. (MSIL) > To: > Dennis Marsa <drm@xilinx.com> > CC: > btf@boyd.com > References: > 1 > > Re: IEEE 1364-2000 Draft 5 > > From: Shalom Bresticker (shalom@msil.sps.mot.com) > Date: Wed Jul 12 2000 - 03:47:34 PDT > > Next message: Thomas Fitzpatrick: "BNF parser, anyone?" > Previous message: Shalom Bresticker (r50386): "Errata in IEEE 1364-2000 Draft 5" > Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Patrick and IEEE 1364: > > Patrick Doane wrote: > > > So far, I've noticed one additional major problem: > > > > wire [0:3] x; > > integer i; > > > > assign x[i] = 1'b0; // <-- this is illegal > > assign {x[i]} = 1'b0; // <-- this is legal! > > > > Note that this is just from a syntactic level, and I have not had a chance > > to review the language document to see if it makes any additional semantic > > requirements that would disallow it. > > > > > It is however a little disconerning to see that using a concatenation in > > an net_lvalue changes whether or not a range_expression is legal for use > > on a hierarchical_net_identifier. > > Hi, Patrick. > > It took me a while to figure out what is going on. > > Your second example is not legal - see Table 6-1 on p. 73. > > It is true that the grammar appears to allow it, but that was unintended. > > ( net_lvalue may be net_concatenation and net_concatenation allows non-constant range expressions.) > > Apparently the following happened: net_concatenation and variable_concatenation > were defined for general use. In the end, they found use only in net_lvalue and variable_lvalue. > However, we forgot that net_concatenation allows non-constant ranges whereas net_lvalue > is restricted to constant ranges. This problem does not arise in variable_lvalue. > > So: the definition of net_lvalue must be fixed, and net_concatenation and net_concatenation_value are without > use. > > > As a more minor comment, the rule for variable_concatenation_value could > > be: > > > > variable_concatenation_value ::= variable_lvalue > > > > since they share the same productions. > > Correct, but it should be reversed: variable_lvalue ::= variable_concatenation_value . > > In related issues, the production of net_lvalue should be copied or moved from Syntax 9-3 to Syntax 6-1. > Also, variable_concatenation is referenced in Syntax 9-1, 9-2, 9-3, but not defined there, only in App. A. > > Thanks again, Patrick ! > > Shalom > > -- > ************************************************************************ > Shalom Bresticker email: shalom@msil.sps.mot.com > Motorola Semiconductor Israel, Ltd. Tel #: +972 9 9522268 > P.O.B. 2208, Herzlia 46120, ISRAEL Fax #: +972 9 9522890 > http://www.motorola-semi.co.il/ > ************************************************************************ The above seems vague to me on what exactly the proposed fix to the BNF should be: Here's my interpretation, please correct if I am wrong: * New productions for net_lvalue and variable_lvalue (only last alternative in each is different) net_lvalue ::= hierarchical_net_identifier | hierarchical_net_identifier '[' constant_expression ']' { '[' constant_expression ']' } | hierarchical_net_identifier '[' constant_expression ']' { '[' constant_expression ']' } '[' constant_range_expression ']' | hierarchical_net_identifier '[' constant_range_expression ']' | '{' net_lvalue { ',' net_lvalue } '}' variable_lvalue ::= hierarchical_net_identifier | hierarchical_net_identifier '[' expression ']' { '[' expression ']' } | hierarchical_net_identifier '[' expression ']' { '[' expression ']' } '[' range_expression ']' | hierarchical_net_identifier '[' range_expression ']' | '{' variable_lvalue { ',' variable_lvalue } '}' * Eliminate productions: net_concatenation net_concatenation_value variable_concatenation variable_concatenation_value Dennis Marsa Xilinx, Inc. From: Dennis Marsa <drm@xilinx.com> To: Shalom.Bresticker@motorola.com, btf-bugs@boyd.com Cc: Subject: Re: errata/53: net_lvalue BNF allows {x[i]} Date: Tue, 16 Oct 2001 09:56:15 -0600 Sorry, my mailer did some unfortunate line wrapping in my previous reply. Here it is again without the wrapping.... Dennis Marsa Xilinx, Inc. Dennis Marsa wrote: > The above seems vague to me on what exactly the proposed fix to the BNF > should be: > > Here's my interpretation, please correct if I am wrong: > > * New productions for net_lvalue and variable_lvalue (only last alternative > in each is different) > > net_lvalue ::= hierarchical_net_identifier > | hierarchical_net_identifier '[' constant_expression ']' { '[' constant_expression ']' } > | hierarchical_net_identifier '[' constant_expression ']' { '[' constant_expression ']' } '[' constant_range_expression ']' > | hierarchical_net_identifier '[' constant_range_expression ']' > | '{' net_lvalue { ',' net_lvalue } '}' > > variable_lvalue ::= hierarchical_net_identifier > | hierarchical_net_identifier '[' expression ']' { '[' expression ']' } > | hierarchical_net_identifier '[' expression ']' { '[' expression ']' } '[' range_expression ']' > | hierarchical_net_identifier '[' range_expression ']' > | '{' variable_lvalue { ',' variable_lvalue } '}' > > * Eliminate productions: > > net_concatenation > net_concatenation_value > variable_concatenation > variable_concatenation_value > > Dennis Marsa > Xilinx, Inc. From: Shalom Bresticker <Shalom.Bresticker@motorola.com> To: Dennis Marsa <drm@xilinx.com> Cc: btf-bugs@boyd.com Subject: Re: errata/53: net_lvalue BNF allows {x[i]} Date: Thu, 18 Oct 2001 15:14:39 +0200 --------------CCBF3B3171D307A8B8E54E9C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Yes, that looks excellent. By the way, this discussion found for me two mssing hypertext links in my hypertexted BNF, so I will send a corrected version in a moment. My BNF still contains the existing definitions of net_lvalue and variable_lvalue. Shalom Dennis Marsa wrote: > > The above seems vague to me on what exactly the proposed fix to the BNF > > should be: > > > > Here's my interpretation, please correct if I am wrong: > > > > * New productions for net_lvalue and variable_lvalue (only last alternative > > in each is different) > > > > net_lvalue ::= hierarchical_net_identifier > > | hierarchical_net_identifier '[' constant_expression ']' { '[' constant_expression ']' } > > | hierarchical_net_identifier '[' constant_expression ']' { '[' constant_expression ']' } '[' constant_range_expression ']' > > | hierarchical_net_identifier '[' constant_range_expression ']' > > | '{' net_lvalue { ',' net_lvalue } '}' > > > > variable_lvalue ::= hierarchical_net_identifier > > | hierarchical_net_identifier '[' expression ']' { '[' expression ']' } > > | hierarchical_net_identifier '[' expression ']' { '[' expression ']' } '[' range_expression ']' > > | hierarchical_net_identifier '[' range_expression ']' > > | '{' variable_lvalue { ',' variable_lvalue } '}' > > > > * Eliminate productions: > > > > net_concatenation > > net_concatenation_value > > variable_concatenation > > variable_concatenation_value -- ************************************************************************** Shalom Bresticker Shalom.Bresticker@motorola.com Motorola Semiconductor Israel, Ltd. Tel #: +972 9 9522268 P.O.B. 2208, Herzlia 46120, ISRAEL Fax #: +972 9 9522890 ************************************************************************** --------------CCBF3B3171D307A8B8E54E9C Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> Yes, that looks excellent. By the way, this discussion found for me two mssing hypertext links
My BNF still contains the existing definitions of net_lvalue and
Shalom
Dennis Marsa wrote:
-- ************************************************************************** Shalom Bresticker Shalom.Bresticker@motorola.com Motorola Semiconductor Israel, Ltd. Tel #: +972 9 9522268 P.O.B. 2208, Herzlia 46120, ISRAEL Fax #: +972 9 9522890 ************************************************************************** --------------CCBF3B3171D307A8B8E54E9C-- From: Dennis Marsa <drm@xilinx.com> To: Shalom Bresticker <Shalom.Bresticker@motorola.com> Cc: btf-bugs@boyd.com Subject: Re: errata/53: net_lvalue BNF allows {x[i]} Date: Thu, 18 Oct 2001 08:51:42 -0600 > From: Shalom Bresticker <Shalom.Bresticker@motorola.com> > To: Dennis Marsa <drm@xilinx.com> > Cc: btf-bugs@boyd.com > Subject: Re: errata/53: net_lvalue BNF allows {x[i]} > Date: Thu, 18 Oct 2001 15:14:39 +0200 > > --------------CCBF3B3171D307A8B8E54E9C > Content-Type: text/plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > > Yes, that looks excellent. > > By the way, this discussion found for me two mssing hypertext links in my hypertexted BNF, > so I will send a corrected version in a moment. > > My BNF still contains the existing definitions of net_lvalue and variable_lvalue. > > Shalom Great. Here is one minor correction to the "variable_lvalue" production. It should reference "hierarchical_variable_identifier" instead of "hierarchical_net_identifier". variable_lvalue ::= hierarchical_variable_identifier | hierarchical_variable_identifier '[' expression ']' { '[' expression ']' } | hierarchical_variable_identifier '[' expression ']' { '[' expression ']' } '[' range_expression ']' | hierarchical_variable_identifier '[' range_expression ']' | '{' variable_lvalue { ',' variable_lvalue } '}' Dennis Marsa Xilinx, Inc. > Dennis Marsa wrote: > > > > The above seems vague to me on what exactly the proposed fix to the BNF > > > should be: > > > > > > Here's my interpretation, please correct if I am wrong: > > > > > > * New productions for net_lvalue and variable_lvalue (only last alternative > > > in each is different) > > > > > > net_lvalue ::= hierarchical_net_identifier > > > | hierarchical_net_identifier '[' constant_expression ']' { '[' constant_expression ']' } > > > | hierarchical_net_identifier '[' constant_expression ']' { '[' constant_expression ']' } '[' constant_range_expression ']' > > > | hierarchical_net_identifier '[' constant_range_expression ']' > > > | '{' net_lvalue { ',' net_lvalue } '}' > > > =====> See corrected version of "variable_lvalue" above... > > > variable_lvalue ::= hierarchical_net_identifier > > > | hierarchical_net_identifier '[' expression ']' { '[' expression ']' } > > > | hierarchical_net_identifier '[' expression ']' { '[' expression ']' } '[' range_expression ']' > > > | hierarchical_net_identifier '[' range_expression ']' > > > | '{' variable_lvalue { ',' variable_lvalue } '}' > > > > > > * Eliminate productions: > > > > > > net_concatenation > > > net_concatenation_value > > > variable_concatenation > > > variable_concatenation_value |
Unformatted |
|
Hosted by Boyd Technology