Re: [sv-bc] Is the declaration assignment optional for constant declaration

From: Surya Pratik Saha <spsaha_at_.....>
Date: Mon May 14 2007 - 02:33:31 PDT
Hi Shalom,
Please check the definition of list_of_variable_decl_assignments ;
list_of_variable_decl_assignments ::= variable_decl_assignment { , variable_decl_assignment }
variable_decl_assignment ::= variable_identifier { variable_dimension } [ = expression ]
| dynamic_array_variable_identifier [ ] [ = dynamic_array_new ]
| class_variable_identifier [ = class_new ] | [ covergroup_variable_identifier ] = new [ ( list_of_arguments ) ] 15

So by BNF assignment may or may not be present at the time of declaration even 'const' is used.

Regards
Surya


Bresticker, Shalom wrote:

Hi Surya,

 

The full BNF says,

 

data_declaration14 ::=

[ const ] [ var ] [ lifetime ] data_type_or_implicit list_of_variable_decl_assignments ;

| type_declaration

| package_import_declaration

| virtual_interface_declaration

So you see that following const, you have to have a variable_decl_assignment.

 

Shalom

 


From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On Behalf Of Surya Pratik Saha
Sent: Monday, May 14, 2007 12:12 PM
To: sv-bc@eda-stds.org
Subject: [sv-bc] Is the declaration assignment optional for constant declaration

 

Hi,
In SV 3.1 final LRM, the constant declaration syntax was:
constant_declaration ::=
const data_type const_assignment ;

So the assignment was must in constant declaration.
But as per 1800 LRM, now the keyword 'const' has become part of data declaration, which may or may not contain assignment in declaration time. So is the declaration assignment is optional?
Is the following case valid:

module top;
    const int x; // the assignment is missing
endmodule

-- 
Regards
Surya

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean. Received on Mon May 14 02:34:20 2007

This archive was generated by hypermail 2.1.8 : Mon May 14 2007 - 02:34:29 PDT