errata/53: net_lvalue BNF allows {x[i]}

From: Shalom.Bresticker@motorola.com
Date: Tue Oct 16 2001 - 08:21:17 PDT


Precedence: bulk

<p>>Number: 53
>Category: errata
>Originator: Shalom.Bresticker@motorola.com
>Description:

<p> 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

<p><p><p>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
**************************************************************************

<p><p>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 ]

<p><p>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/ ************************************************************************



This archive was generated by hypermail 2.1.4 : Mon Jul 08 2002 - 12:54:47 PDT and
sponsored by Boyd Technology, Inc.