addInput method
Registers a signal as an input to this Module and returns an input port that can be consumed.
The return value is the same as what is returned by input().
Implementation
@protected
Logic addInput(String name, Logic x, {int width = 1}) {
_checkForSafePortName(name);
if (x.width != width) {
throw PortWidthMismatchException(x, width);
}
if (x is LogicStructure) {
// ignore: parameter_assignments
x = x.packed;
}
final inPort = Port(name, width)
..gets(x)
// ignore: invalid_use_of_protected_member
..parentModule = this;
_inputs[name] = inPort;
return inPort;
}