3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 00:55:32 +00:00

preprocessor: do not destroy double slash escaped identifiers

The preprocessor currently destroys double slash containing escaped
identifiers (for example \a//b ). This is due to next_token trying to
convert single line comments (//) into /* */ comments. This then leads
to an unintuitive error message like this:
ERROR: syntax error, unexpected '*'

This patch fixes the error by recognizing escaped identifiers and
returning them as single token. It also adds a testcase.
This commit is contained in:
Thomas Sailer 2021-08-25 21:34:26 +02:00 committed by Zachary Snow
parent 477eeefd9b
commit 4cd2f03e36
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,19 @@
read_verilog -sv <<EOT
module doubleslash
(input logic a,
input logic b,
output logic z);
logic \a//b ;
assign \a//b = a & b;
assign z = ~\a//b ;
endmodule : doubleslash
EOT
hierarchy
proc
opt -full
write_verilog doubleslash.v