PairInterface class

A simplified version of Interface which is intended for a common situation where two components are communicating with each other and may share some common inputs.

It can be either directly used for simple scenarios, or extended for more complex situations.

Inheritance
Available extensions

Constructors

PairInterface({List<Logic>? portsFromConsumer, List<Logic>? portsFromProvider, List<Logic>? sharedInputPorts, List<Logic>? commonInOutPorts, @Deprecated('Use `uniquify` when connecting or adding sub interfaces instead.') String modify(String original)?})
Constructs an instance of a PairInterface with the specified ports.
PairInterface.clone(PairInterface otherInterface)
Creates a new instance of a PairInterface with the same ports.

Properties

hashCode → int
The hash code for this object.
no setterinherited
modify ↔ String Function(String original)?
A function that modifies all port names during connection.
getter/setter pair
ports → Map<String, Logic>
Maps from the Interface's defined port name to an instance of a Logic.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subInterfaces → Map<String, PairInterface>
A mapping from sub-interface names to instances of sub-interfaces.
no setter

Methods

addSubInterface<PairInterfaceType extends PairInterface>(String name, PairInterfaceType subInterface, {bool reverse = false, String uniquify(String original)?}) → PairInterfaceType
Registers a new subInterface on this PairInterface, enabling a simple way to build hierarchical interface definitions.
clone() → PairInterface
Creates a new Interface with the same ports as this.
override
conditionalDriveOther(Interface<PairDirection> other, Iterable<PairDirection> tags) → Conditional
Makes this conditionally drive interface signals tagged with tags on other.
override
conditionalReceiveOther(Interface<PairDirection> other, Iterable<PairDirection> tags) → Conditional
Makes this signals tagged with tags be driven conditionally by other.
override
connectIO(Module module, Interface srcInterface, {Iterable<PairDirection>? inputTags, Iterable<PairDirection>? outputTags, Iterable<PairDirection>? inOutTags, String uniquify(String original)?}) → void
Calls Interface.connectIO for ports of this interface as well as hierarchically for all subInterfaces.
override
driveOther(Interface<PairDirection> other, Iterable<PairDirection> tags) → void
Makes this drive interface signals tagged with tags on other.
override
getPorts([Iterable<PairDirection>? tags]) → Map<String, Logic>
Returns all interface ports associated with the provided tags as a Map from the port name to the Logic port.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pairConnectIO(Module module, Interface<PairDirection> srcInterface, PairRole role, {String uniquify(String original)?}) → void
Connects this pair interface using the directions implied by role.
port(String name) → Logic
Accesses a port named name.
inherited
receiveOther(Interface<PairDirection> other, Iterable<PairDirection> tags) → void
Makes this signals tagged with tags be driven by other.
override
setPorts(List<Logic> ports, [Iterable<PairDirection>? tags]) → void
Adds a collection of ports to this Interface, each associated with all of tags.
inherited
split() → (PairProvider<InterfaceType>, PairConsumer<InterfaceType>)

Available on InterfaceType, provided by the PairInterfaceSplit extension

Returns typed provider and consumer endpoints for this interface.
toString() → String
A string representation of this object.
inherited
tryPort(String name) → Logic?
Provides the port named name if it exists, otherwise null.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

tagsForRole(PairRole role) → ({List<PairDirection> inOutTags, List<PairDirection> inputTags, List<PairDirection> outputTags})
Returns the input, output, and inOut tags implied by role.