inlineVerilog method Null safety
override
Generates custom SystemVerilog to be injected in place of the output port's corresponding signal name.
The inputs
are a mapping from the Module's port names to the names of
the signals that are passed into those ports in the generated
SystemVerilog.
The output will be appropriately wrapped with parentheses to guarantee proper order of operations.
Implementation
@override
String inlineVerilog(Map<String, String> inputs) {
if (inputs.length != _swizzleInputs.length) {
throw Exception('This swizzle has ${_swizzleInputs.length} inputs,'
' but saw $inputs with ${inputs.length} values.');
}
final inputStr = _swizzleInputs.reversed
.where((e) => e.width > 0)
.map((e) => inputs[e.name])
.join(',');
return '{$inputStr}';
}