Re: variable initialization at declaration

From: Dennis Marsa (drm@xilinx.com)
Date: Fri Aug 17 2001 - 13:22:00 PDT


Stuart Sutherland wrote:
>
> Precedence: bulk
>
> Adam,
>
> You are correct--I think. I chased the wrong tree through the BNF. In
> Annex A, I spotted "real_declaration", "reg_declaration", etc. in A.2.1.3,
> and couldn't find any reference on that branch that allowed
> initializations. Now that I look again, I see that those "declarations"
> are for the combined port/type declarations. Section A.2.2.1 defines the
> declarations for within a module, and shows:
>
> real_type ::=
> real_identifier [ = constant_expression ]
> | real_identifier dimension { dimension }
> variable_type ::=
> variable_identifier [ = constant_expression ]
> | variable_identifier dimension { dimension }
>
> Now I still can't find anywhere that ties "variable_type" to reg | integer
> | time, and "real_type" to real | realtime.
>
> It's got to be there, I just get tired of flipping back and forth in the BNF.

In Section A.2.1.3
  * reg_declaration, integer_declaration and time_declaration all go to
    list_of_variable_identifiers.
  * real_declaration goes to list_of_real_identifiers

In Section A.2.3
  * list_of_variable_identifiers goes to variable_type
  * list_of_real_identifiers goes to real_type

<p>On a related topic, I've been wondering about the following:

In section A.2.8 on Block Item Declarations, the rule for
"block_item_declaration" specifically prohibits reg's declared
within named blocks from being initialized, though integer/real/time
variables can be initialized.

Is this correct?

Dennis Marsa
Xilinx Inc.



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