net_lvalue BNF rule

From: Dennis Marsa (drm@xilinx.com)
Date: Mon Oct 15 2001 - 09:37:17 PDT


Precedence: bulk

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.



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