Regards Surya
Yes, see section 6.20. There is no requirement to have an user specified initialization. The name global constant is a misnomer. It behaves like any other const, which means it can take on different values each time the variable comes into existence because the initialization expression may evaluate differently. The only thing special about a class instance constant is that it is allowing a "write" to the const variable in the constructor instead of the declaration initialization.-----Original Message----- From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf OfSuryaPratik Saha Sent: Wednesday, March 31, 2010 7:19 AM To: sv-ec@eda.org; sv-bc@eda.org Cc: Bijoy Gopal Nandy Subject: [sv-ec] Is instance constant allowed outside class? Hi, "8.18 Constant class properties" of SV 2009 LRM defines two types of constants - global constant (initialization is must) and instance constant (initialization is missing). Is it allowed to use thatinstanceconstant syntax in non-class scope? For e.g.: module top; const int x; // Is it allowed? endmodule OR module top; class C; function f; const int x; // Is it allowed endfunction endclass endmodule Some standard tools pass both the cases. Also OVM 2.1.1 has 2nd typeofsyntax usage in its source. Please let me know. -- Regards Surya -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
This archive was generated by hypermail 2.1.8 : Wed Mar 31 2010 - 21:12:27 PDT