Skip to content

Commit

Permalink
Merge pull request #772 from diffblue/indexed-part-select-is-verilog
Browse files Browse the repository at this point in the history
Verilog: indexed part select is Verilog 2005
  • Loading branch information
tautschnig authored Oct 17, 2024
2 parents 5b3e023 + c193387 commit c12e5ff
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion regression/verilog/part-select/indexed-part-select2.desc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CORE
indexed-part-select2.sv
indexed-part-select2.v

^file .* line 4: expected constant expression, but got `main\.width'$
^EXIT=2$
Expand Down
4 changes: 2 additions & 2 deletions regression/verilog/part-select/indexed-part-select4.sv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module main(input my_input);

bit [7:0] some_wire;
reg [7:0] some_wire;

always @my_input begin
always @my_input begin : my_block
integer i;
for(i=0; i<4; i++)
// part select with index known at synthesis time
Expand Down
2 changes: 1 addition & 1 deletion regression/verilog/part-select/indexed-part-select5.sv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module main(input my_input);

bit [7:0] some_wire;
reg [7:0] some_wire;

always @my_input begin
some_wire[0 +: 2] = 'b01;
Expand Down
4 changes: 2 additions & 2 deletions src/verilog/scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ void verilog_scanner_init()
">>>" { return TOK_GREATERGREATERGREATER; }
"<<" { return TOK_LESSLESS; }
"<<<" { return TOK_LESSLESSLESS; }
"+:" { return TOK_PLUSCOLON; } // V2005
"-:" { return TOK_MINUSCOLON; } // V2005

/* Trinary operators */

Expand All @@ -244,8 +246,6 @@ void verilog_scanner_init()
"++" { SYSTEM_VERILOG_OPERATOR(TOK_PLUSPLUS, "++"); }
"--" { SYSTEM_VERILOG_OPERATOR(TOK_MINUSMINUS, "--"); }
"+=" { SYSTEM_VERILOG_OPERATOR(TOK_PLUSEQUAL, "+="); }
"+:" { SYSTEM_VERILOG_OPERATOR(TOK_PLUSCOLON, "+:"); }
"-:" { SYSTEM_VERILOG_OPERATOR(TOK_MINUSCOLON, "-:"); }
"-=" { SYSTEM_VERILOG_OPERATOR(TOK_MINUSEQUAL, "-="); }
"*=" { SYSTEM_VERILOG_OPERATOR(TOK_ASTERICEQUAL, "*="); }
"/=" { SYSTEM_VERILOG_OPERATOR(TOK_SLASHEQUAL, "+="); }
Expand Down

0 comments on commit c12e5ff

Please sign in to comment.