replicateTo method
- BridgeModule newModule,
- PortDirection direction, {
- String? newPortName,
override
Creates a new port in the specified module with the given direction.
This creates a port in newModule
with the specified direction
and
optionally renames it to newPortName
. The new port will have the same
width and array dimensions as this port reference.
If this is a sliced reference, only the subset dimensions are replicated.
Implementation
@override
PortReference replicateTo(BridgeModule newModule, PortDirection direction,
{String? newPortName}) {
newPortName ??= portName;
if (subsetDimensions == null) {
newModule.createPort(newPortName, direction, width: subsetElementWidth);
} else {
newModule.createArrayPort(newPortName, direction,
dimensions: subsetDimensions!, elementWidth: subsetElementWidth);
}
return PortReference.fromString(newModule, newPortName);
}