addSubInterface<PairInterfaceType extends PairInterface> method
- String name,
- PairInterfaceType subInterface, {
- bool reverse = false,
- String uniquify(
- String original
inherited
Registers a new subInterface on this PairInterface, enabling a simple
way to build hierarchical interface definitions.
If reverse is set, then this subInterface will be connected in the
opposite way as it usually is with respect to the PairRole specified.
Sub-interfaces are connected via connectIO based on the name.
The uniquify function can be used to rename ports as they are created on
Module boundaries during connectIO.
Implementation
@protected
PairInterfaceType addSubInterface<PairInterfaceType extends PairInterface>(
String name,
PairInterfaceType subInterface, {
bool reverse = false,
String Function(String original)? uniquify,
}) {
if (_subInterfaces.containsKey(name)) {
throw InterfaceNameException(
name,
'Sub-interface name is not unique.'
' There is already a sub-interface with that name');
}
if (!Sanitizer.isSanitary(name)) {
throw InterfaceNameException(name, 'Sub-interface name is not sanitary.');
}
_subInterfaces[name] = _SubPairInterface(
subInterface,
reverse: reverse,
uniquify: uniquify,
);
return subInterface;
}