AxiStreamBus¶
Holds the stream’s signal handles and checks their shapes on construction.
Use bind() to look up signals by name. See Signal binding
for the required signal widths and layouts.
- class coaxi.AxiStreamBus(
- data: SimHandleBase | None,
- valid: LogicObject | LogicArrayObject,
- ready: LogicObject | LogicArrayObject | None,
- last: LogicObject | LogicArrayObject | None = None,
- _entity: HierarchyObject | None = None,
- *,
- keep: LogicObject | LogicArrayObject | None = None,
- strb: LogicObject | LogicArrayObject | None = None,
- user: LogicObject | LogicArrayObject | None = None,
- id: LogicObject | LogicArrayObject | None = None,
- dest: LogicObject | LogicArrayObject | None = None,
- Parameters:
data: SimHandleBase | NonePayload handle, or
Nonefor data-less traffic.valid: LogicObject | LogicArrayObjectRequired one-bit
validhandle.ready: LogicObject | LogicArrayObject | NoneOne-bit
readyhandle. WithNone,validalone determines acceptance.last: LogicObject | LogicArrayObject | NoneOne-bit
lasthandle. DefaultNoneomits framing._entity: HierarchyObject | NoneInternal lookup context, normally supplied by
bind(). DefaultNone.keep: LogicObject | LogicArrayObject | NoneByte-presence qualifier handle. Default
Noneomits it.strb: LogicObject | LogicArrayObject | NoneData/position-byte qualifier handle. Default
Noneomits it.user: LogicObject | LogicArrayObject | NoneApplication metadata handle of positive logic width. Default
None.id: LogicObject | LogicArrayObject | NoneStream identifier handle of positive logic width. Default
None.dest: LogicObject | LogicArrayObject | NoneRouting destination handle of positive logic width. Default
None.
- Returns:
None.- Raises:
SignalBindingError – A role has an unsuitable shape, aliases another role, or violates byte-lane requirements.
Public attributes have the same names and types as the handle parameters.
bind¶
- classmethod AxiStreamBus.bind(
- entity: HierarchyObject | None = None,
- *,
- prefix: str = '',
- t_prefix: bool = True,
- data: bool | Signal | None = None,
- valid: Signal | None = None,
- ready: bool | Signal | None = None,
- last: bool | Signal = False,
- keep: bool | Signal = False,
- strb: bool | Signal = False,
- user: bool | Signal = False,
- id: bool | Signal = False,
- dest: bool | Signal = False,
- Parameters:
entity: HierarchyObject | NoneParent for child-name lookup. Default
None; may be omitted when every selected signal is a handle.prefix: strGenerated-name stem, followed by
_when non-empty. Default"".t_prefix: boolAdd
tbefore each generated role name. DefaultTrue.data: bool | Signal | NoneNoneorTrueselects the generated name;Falseomitsdata; a name or handle overrides it. DefaultNone.valid: Signal | NoneName or handle override for the required
validsignal. DefaultNoneselects the generated name.ready: bool | Signal | NoneNoneorTrueselects the generated name;Falseomitsready; a name or handle overrides it. DefaultNone.last: bool | SignalFalseomitslast;Trueselects the generated name; a name or handle binds it independently. DefaultFalse.keep: bool | SignalFalseomitskeep;Trueselects the generated name; a name or handle binds it independently. DefaultFalse.strb: bool | SignalFalseomitsstrb;Trueselects the generated name; a name or handle binds it independently. DefaultFalse.user: bool | SignalFalseomitsuser;Trueselects the generated name; a name or handle binds it independently. DefaultFalse.id: bool | SignalFalseomitsid;Trueselects the generated name; a name or handle binds it independently. DefaultFalse.dest: bool | SignalFalseomitsdest;Trueselects the generated name; a name or handle binds it independently. DefaultFalse.
- Returns:
A validated bus with the selected handles and lookup context.
- Raises:
SignalBindingError – Lookup, role shape, aliasing, or qualifier-layout validation fails.
Explicit names are used unchanged. Optional signals are enabled by their
selectors. Generated names combine the stem, optional t, and protocol role.
resolve_clock¶
- AxiStreamBus.resolve_clock(clock: Signal) LogicObject | LogicArrayObject¶
- Parameters:
clock: SignalChild name in the binding entity, or an already-bound one-bit logic handle.
- Returns:
A scalar or one-bit vector clock handle, separate from the bus roles.
- Raises:
SignalBindingError – Lookup, clock shape, or alias validation fails.
Clock lookup uses the bus’s binding entity independently of stream naming defaults.