Interface<TagType> class

Represents a logical interface to a Module.

Interfaces make it easier to define port connections of a Module in a reusable way. The TagType allows grouping of port signals of the module when connecting at a Module level.

When connecting an Interface to a Module, you should always create a new instance of the Interface so you don't modify the one being passed in through the constructor. Modifying the same Interface as was passed would have negative consequences if multiple Modules were consuming the same Interface, and also breaks the rules for Module input and output connectivity.

Implementers

Constructors

Interface()

Properties

hashCode int
The hash code for this object.
no setterinherited
ports Map<String, Logic>
Maps from the Interface's defined port name to an instance of a Port.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

conditionalDriveOther(Interface<TagType> other, Iterable<TagType> tags) Conditional
Makes this conditionally drive interface signals tagged with tags on other.
conditionalReceiveOther(Interface<TagType> other, Iterable<TagType> tags) Conditional
Makes this signals tagged with tags be driven conditionally by other.
connectIO(Module module, Interface srcInterface, {Iterable<TagType>? inputTags, Iterable<TagType>? outputTags, String uniquify(String original)?}) → void
Connects module's inputs and outputs up to srcInterface and this Interface.
driveOther(Interface<TagType> other, Iterable<TagType> tags) → void
Makes this drive interface signals tagged with tags on other.
getPorts([Iterable<TagType>? tags]) Map<String, Logic>
Returns all interface ports associated with the provided tags as a Map from the port name to the Logic port.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
port(String name) Logic
Accesses a port named name.
receiveOther(Interface<TagType> other, Iterable<TagType> tags) → void
Makes this signals tagged with tags be driven by other.
setPorts(List<Logic> ports, [Iterable<TagType>? tags]) → void
Adds a collection of ports to this Interface, each associated with all of tags.
toString() String
A string representation of this object.
inherited
tryPort(String name) Logic?
Provides the port named name if it exists, otherwise null.

Operators

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