Use of Escaped Identifiers in Verilog

Status
Not open for further replies.
I have never seen anyone use them.

Copied from IEEE Std 1364-2001:

2.7.1 Escaped identifiers

Escaped identifiers shall start with the backslash character (\) and end with white space (space, tab, newline). They provide a means of including any of the printable ASCII characters in an identifier (the decimal values 33 through 126, or 21 through 7E in hexadecimal).

Neither the leading backslash character nor the terminating white space is considered to be part of the identifier. Therefore, an escaped identifier \cpu3 is treated the same as a nonescaped identifier cpu3.

Example:

\busa+index
\-clock
\***error-condition***
\net1/\net2
\{a,b}
\a*(b+c)
 

kumar_eee said:
What is the use of Escaped Identifiers in verilog?...

Eg:
\s+t;

K.Kumar

They sound nice in theory...

"Hey, I can call my symbol \q' or \~q instead of something silly like qbar."

...but in practice, they're a complete nightmare.

Why? It's so easy to omit the trailing space that tells the compiler where the escaped identifier ends. If you're adding things to a comma'd list, you end up typing...

\~q, q

...instead of...

\~q , q


Save yourself compile errors and just ignore this feature.

- Nobody
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…