b_asic.port
¶

B-ASIC Port Module.
Contains classes for managing the ports of operations.
- class b_asic.port.AbstractPort(operation: Operation, index: int, latency_offset: int | None = None)¶
Bases:
Port
Generic abstract port base class.
Concrete ports should normally derive from this to get the default behavior.
- property name¶
Return a name of the port.
This name consists of graph_id of the related operation and the port number.
- class b_asic.port.InputPort(operation: Operation, index: int)¶
Bases:
AbstractPort
Input port.
May have one or zero signals connected to it.
- add_signal(signal: Signal) None ¶
Connect this port to the entered signal.
If the entered signal is not connected to this port then connect the entered signal to the port as well.
- Parameters:
- signalSignal
Signal to add.
- connect(src: SignalSourceProvider, name: str = '') Signal ¶
Connect the provided signal source to this input port by creating a new signal.
Returns the new signal.
- property connected_source: OutputPort | None¶
Get the output port that is currently connected to this input port.
Return None if it is unconnected.
- delay(number: int) InputPort ¶
Insert number amount of delay elements before the input port.
Returns the input port of the first delay element in the chain.
- class b_asic.port.OutputPort(operation: Operation, index: int)¶
Bases:
AbstractPort
,SignalSourceProvider
Output port.
May have zero or more signals connected to it.
- add_signal(signal: Signal) None ¶
Connect this port to the entered signal.
If the entered signal is not connected to this port then connect the entered signal to the port as well.
- Parameters:
- signalSignal
Signal to add.
- remove_signal(signal: Signal) None ¶
Remove the signal that was entered from the Ports signals.
If the entered signal still is connected to this port then disconnect the entered signal from the port as well.
- Parameters:
- signalSignal
Signal to remove.
- property source: OutputPort¶
Get the main source port provided by this object.
- class b_asic.port.Port¶
Bases:
ABC
Port interface.
Ports serve as connection points for connecting signals between operations. They also store information about the latency of the corresponding calculations of the operation.
Aside from connected signals, each port also provides a reference to the parent operation that “owns” it as well as the operation’s port index at which the port resides.
- abstract add_signal(signal: Signal) None ¶
Connect this port to the entered signal.
If the entered signal is not connected to this port then connect the entered signal to the port as well.
- Parameters:
- signalSignal
Signal to add.
- abstract property name: str¶
Return a name of the port.
This name consists of graph_id of the related operation and the port number.
- class b_asic.port.SignalSourceProvider¶
Bases:
ABC
Signal source provider interface.
Signal source providers give access to a single output port that can be used to connect signals from.
- abstract property source: OutputPort¶
Get the main source port provided by this object.