@@ -114,6 +114,35 @@ class LeafNodeExternal extends ModWithParamPassthrough {
114
114
String ? definitionVerilog (String definitionType) => '' ;
115
115
}
116
116
117
+ class TopForEmptyParams extends ModWithParamPassthrough {
118
+ Logic get b => output ('b' );
119
+ TopForEmptyParams (Logic a,
120
+ {super .definitionName = 'top_for_empty' ,
121
+ super .instantiationParameters = const {},
122
+ super .name = 'top' })
123
+ : super ([]) {
124
+ a = addInput ('a' , a, width: 8 );
125
+ addOutput ('b' , width: 8 );
126
+ b <= LeafNodeExternalEmptyParams (a).b;
127
+ }
128
+ }
129
+
130
+ class LeafNodeExternalEmptyParams extends ModWithParamPassthrough {
131
+ Logic get b => output ('b' );
132
+ LeafNodeExternalEmptyParams (Logic a,
133
+ {super .definitionName = 'leaf_node' ,
134
+ super .instantiationParameters = const {},
135
+ super .name = 'leaf' })
136
+ : super ([]) {
137
+ a = addInput ('a' , a, width: 8 );
138
+ addOutput ('b' , width: 8 );
139
+ }
140
+
141
+ // leaf node should not generate any SV, like external
142
+ @override
143
+ String ? definitionVerilog (String definitionType) => '' ;
144
+ }
145
+
117
146
void main () {
118
147
test ('passthrough params custom system verilog' , () async {
119
148
final mod = Top (Logic (width: 8 ));
@@ -128,4 +157,12 @@ void main() {
128
157
'test/sv_param_passthrough.sv' , // include external SV
129
158
]);
130
159
});
160
+
161
+ test ('empty params does include param # in generated system verilog' ,
162
+ () async {
163
+ final mod = TopForEmptyParams (Logic (width: 8 ));
164
+ await mod.build ();
165
+ final sv = mod.generateSynth ();
166
+ expect (sv.contains ('#' ), isFalse);
167
+ });
131
168
}
0 commit comments