In reading the Verilog specification, I noticed a peculiar syntactical construct involving specifying path pulses. Specifically, statements in the form
PATHPULSE$in_port$out_port = ...;
According to the spec, in_port
and out_port
can either be identifiers (which includes \
-escaped identifiers) or identifiers with a []
-bracketed range.
Ignoring issues with tokenizing the PATHPULSE
construct with brackets, there still seems to be a potential ambiguity issue since $
can be part of normal identifiers. For example, if a module is declared like:
module my_mod(
input foo,
output bar$baz,
input foo$bar,
output baz
);
...
Then given a path pulse statement:
PATHPULSE$foo$bar$baz = ...;
There's no way to determine which $
separates the input and output ports.
My question is this: is there a better way to tokenize PATHPULSE
constructs to avoid this ambiguity? Or is this a shortfall of Verilog?