Featured post

Top 5 books to refer for a VHDL beginner

VHDL (VHSIC-HDL, Very High-Speed Integrated Circuit Hardware Description Language) is a hardware description language used in electronic des...

Sunday 9 September 2012

Identifiers

Formal Definition

The identifier is a unique name, which identifies an object.

Simplified Syntax

identifier

\escaped_identifier

Description

An identifier is used as an object reference. An identifier can contain a sequence of letters, digits, underscores (_) and dollar signs ($). The first character of an identifier can only be a letter or an underscore (Example 1). Identifiers are case sensitive.

Escaped identifiers (Example 2) start with backslash character (\) and end with white space (i.e. space, tab, new line). Escaped identifiers can contain any printable characters. Leading backslash character and white space at the end are not considered as part of an identifier, thus identifiers \enable and enable are identical.

Examples

Example 1

reg enable;
wire _ready;
integer group_a;
reg and5;
tri clk$1;

Legal identifiers.

Example 2

wire \+^_^+*+*<-> ;
reg \!clk ;

White spaces between an escaped identifier and the semicolon that follows it are required, because otherwise, the semicolon will be taken as a part of an identifier.
reg \clk ;

defines \clk identifier, but
reg \clk;

defines \clk; identifier (and there will be also an error message because a variable declaration should be ended by semicolon).

Important Notes

  • Identifiers are case sensitive

  • \clk and clk are the same identifiers

  • Escaped identifiers should be followed by at least a white space character

No comments:

Post a Comment

Please provide valuable comments and suggestions for our motivation. Feel free to write down any query if you have regarding this post.