3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-24 21:27:00 +00:00

Merge pull request #1759 from zeldin/constant_with_comment_redux

refixed parsing of constant with comment between size and value
This commit is contained in:
Miodrag Milanović 2020-03-14 13:34:59 +02:00 committed by GitHub
commit 569e834df2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 19 deletions

8
tests/various/bug1745.ys Normal file
View file

@ -0,0 +1,8 @@
logger -expect error "syntax error, unexpected TOK_CONSTVAL" 1
read_verilog <<EOT
module inverter(input a, output y);
assign y = (a == 1'b0? 1'b1 : 1'b0);
endmodule // inverter
EOT

View file

@ -0,0 +1,16 @@
read_verilog <<EOT
module top1;
localparam a = 8 /*foo*/ 'h ab;
localparam b = 8 'h /*foo*/ cd;
generate
if (a != 8'b10101011) $error("a incorrect!");
if (b != 8'b11001101) $error("b incorrect!");
endgenerate
endmodule
EOT
logger -expect error "syntax error, unexpected TOK_BASE" 1
read_verilog <<EOT
module top2;
localparam a = 12'h4 /*foo*/'b0;
endmodule
EOT