Skip to content

Commit d396fc4

Browse files
committed
prioritize AUTOINTERFACE over AUTONC
1 parent 09b456d commit d396fc4

File tree

5 files changed

+13
-18
lines changed

5 files changed

+13
-18
lines changed

verilogpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1606,11 +1606,11 @@ sub expand_all_macros {
16061606
$self->expand_macro('FORINST', \&expand_forinst);
16071607
$self->expand_macro('AUTOTOSTRING', \&expand_autotostring);
16081608
$self->expand_macro('AUTOINC', \&expand_includes);
1609-
$self->expand_macro('AUTONC', \&expand_autonc);
16101609
# note: AUTOINTERFACE must expand before AUTONET, as it will change
16111610
# AUTONET's behavior.
16121611
$self->expand_macro('AUTOINTERFACE', \&expand_autointerface);
16131612
$self->expand_macro('AUTONET', \&expand_autonet);
1613+
$self->expand_macro('AUTONC', \&expand_autonc);
16141614
$self->expand_macro('TIEOUTPUTSTOZERO', \&expand_tieoutputs);
16151615
}
16161616
}

verilogpp_tests/autonc.vpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ module inst_of_unpacked (
66
output [7:0] fee [0:10-1],
77
/**AUTOINTERFACE**/
88
/*PPSTART*/
9-
input wire fee_en[0:5],
10-
input wire [7:0] fie[0:5],
11-
input wire fie_en[0:5]
9+
output wire [7:0] another_output,
10+
output wire [7:0] bar,
11+
input wire fee_en[0:5],
12+
input wire [7:0] fie[0:5],
13+
input wire fie_en[0:5],
14+
input wire [7:0] foo[0:5],
15+
input wire foo_en[0:5]
1216
/*PPSTOP*/
1317
);
1418

1519
/**AUTONET --init **/
1620
/*PPSTART*/
17-
wire [7:0] another_output;
18-
wire [7:0] bar;
19-
wire [7:0] foo[0:5];
20-
wire foo_en[0:5];
21+
2122
/*PPSTOP*/
2223

2324
/**AUTONC
@@ -28,13 +29,7 @@ wire foo_en[0:5];
2829
/^foo/
2930
**/
3031
/*PPSTART*/
31-
assign foo = '0;
32-
assign foo_en = '0;
3332

34-
logic lint_unused_signals;
35-
assign lint_unused_signals =
36-
(another_output == '0) ||
37-
(bar == '0);
3833
/*PPSTOP*/
3934

4035

verilogpp_tests/autonc2.vpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ module inst_of_unpacked (
1313
/*PPSTART*/
1414
wire [7:0] another_output;
1515
wire [7:0] bar;
16-
wire [7:0] foo[0:5];
17-
wire foo_en[0:5];
16+
reg [7:0] foo[0:5] = '{default: '0};
17+
reg foo_en[0:5] = '{default: '0};
1818
/*PPSTOP*/
1919

2020
/**AUTONC

verilogpp_tests/autonc3.vpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module inst_of_unpacked (
1313
/*PPSTART*/
1414
wire [7:0] another_output;
1515
wire [7:0] bar;
16-
wire [7:0] foo[0:5];
16+
reg [7:0] foo[0:5] = '{default: '0};
1717
wire foo_en[0:5];
1818
/*PPSTOP*/
1919

verilogpp_tests/autonc4.vpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module inst_of_unpacked (
1414
wire [7:0] another_output;
1515
wire [7:0] bar;
1616
wire derived;
17-
wire [7:0] foo[0:5];
17+
reg [7:0] foo[0:5] = '{default: '0};
1818
wire foo_en[0:5];
1919
/*PPSTOP*/
2020

0 commit comments

Comments
 (0)