Pad constructor
Creates padding hardware for inp.
Implementation
Pad(
Logic inp, {
required int atLeast,
bool lsbs = true,
bool fill = false,
super.name = 'pad',
super.reserveName,
super.reserveDefinitionName,
String? definitionName,
}) : super(
definitionName: definitionName ??
'Pad_${lsbs ? 'Lsbs' : 'Msbs'}_F${fill ? 1 : 0}_'
'W${inp.width}_A$atLeast') {
inp = addInput('inp', inp, width: inp.width);
final padded = inp.pad(atLeast: atLeast, lsbs: lsbs, fill: fill);
addOutput('result', width: padded.width) <= padded;
}