Skip to content

Commit

Permalink
Merge pull request #2680 from hirooih/sv-token-handling
Browse files Browse the repository at this point in the history
SystemVerilog: handle an identifier include '$'
  • Loading branch information
hirooih authored Oct 29, 2020
2 parents ed02c0b + 4219047 commit 6222334
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 102 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0 input.sv /^function 0:/;" f
function input.sv /^function 0:/;" f
7 changes: 5 additions & 2 deletions Units/parser-verilog.r/systemverilog-net-var.d/expected.tags
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,8 @@ e input.sv /^module delay_control #(d, e);$/;" c module:delay_control
rega input.sv /^ int rega, regb, regr;$/;" r module:delay_control
regb input.sv /^ int rega, regb, regr;$/;" r module:delay_control
regr input.sv /^ int rega, regb, regr;$/;" r module:delay_control
rega input.sv /^ #d rega = regb; \/\/ d is defined as a parameter FIXME$/;" r module:delay_control
regr input.sv /^ #regr regr = regr + 1; \/\/ delay is the value in regr FIXME$/;" r module:delay_control
delay_control_wire input.sv /^module delay_control_wire #(d, e);$/;" m
d input.sv /^module delay_control_wire #(d, e);$/;" c module:delay_control_wire
e input.sv /^module delay_control_wire #(d, e);$/;" c module:delay_control_wire
w$ire input.sv /^ wire w$ire, wire$; \/\/ '$' included$/;" n module:delay_control_wire
wire$ input.sv /^ wire w$ire, wire$; \/\/ '$' included$/;" n module:delay_control_wire
13 changes: 11 additions & 2 deletions Units/parser-verilog.r/systemverilog-net-var.d/input.sv
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,17 @@ module delay_control #(d, e);
int rega, regb, regr;
initial begin
#10 rega = regb;
#d rega = regb; // d is defined as a parameter FIXME
#d rega = regb; // d is defined as a parameter
#((d+e)/2) rega = regb; // delay is average of d and e
#regr regr = regr + 1; // delay is the value in regr FIXME
#regr regr = regr + 1; // delay is the value in regr
end
endmodule

// 10.3 Continuous assignments
module delay_control_wire #(d, e);
wire wirea #10 = wireb;
wire wireb #d = wireb;
wire wirec #((d+e)/2) = wireb;
wire wired #wirer = wirer + 1;
wire w$ire, wire$; // '$' included
endmodule
2 changes: 1 addition & 1 deletion Units/parser-verilog.r/verilog-github624.d/expected.tags
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0 input.v /^function�::0$/;" f
function input.v /^function�::0$/;" f
Loading

0 comments on commit 6222334

Please sign in to comment.