Skip to content

Commit

Permalink
fix apostrophe parser in auto wire (#1854)
Browse files Browse the repository at this point in the history
  • Loading branch information
dong committed Jan 9, 2024
1 parent 21a1000 commit 4e06566
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/autowire_apostrophe.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module test_port0
(/*AUTOARG*/);
output [31:0] d[2];
endmodule // test_port

module test_port1
(/*AUTOARG*/);
input [31:0] dd[2];
endmodule // test_port1

module top()
/*AUTOWIRE*/

/*
test_port0 AUTO_TEMPLATE
(
.d\(.*\) ('{d_1\1[],d_2\1[]}),
);
*/
test_port0
u0(/*AUTOINST*/);

/*
test_port1 AUTO_TEMPLATE
(
.d\(.*\) ('{d_1\1[],d_2\1[]}),
);
*/

test_port1
u1(/*AUTOINST*/);
endmodule // top


48 changes: 48 additions & 0 deletions tests_ok/autowire_apostrophe.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
module test_port0
(/*AUTOARG*/
// Outputs
d
);
output [31:0] d[2];
endmodule // test_port

module test_port1
(/*AUTOARG*/
// Inputs
dd
);
input [31:0] dd[2];
endmodule // test_port1

module top()
/*AUTOWIRE*/
// Beginning of automatic wires (for undeclared instantiated-module outputs)
wire [31:0] d_1; // From u0 of test_port0.v
wire [31:0] d_2; // From u0 of test_port0.v
// End of automatics

/*
test_port0 AUTO_TEMPLATE
(
.d\(.*\) ('{d_1\1[],d_2\1[]}),
);
*/
test_port0
u0(/*AUTOINST*/
// Outputs
.d ('{d_1[31:0],d_2[31:0]})); // Templated

/*
test_port1 AUTO_TEMPLATE
(
.d\(.*\) ('{d_1\1[],d_2\1[]}),
);
*/

test_port1
u1(/*AUTOINST*/
// Inputs
.dd ('{d_1d[31:0],d_2d[31:0]})); // Templated
endmodule // top


0 comments on commit 4e06566

Please sign in to comment.