hwtLib.amba.axis_comp package

Submodules

hwtLib.amba.axis_comp.base module

class hwtLib.amba.axis_comp.base.AxiSCompBase(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.handshaked.compBase.HandshakedCompBase

Abstract base for axis components

__init__(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]
Parameters

hsIntfCls – class of interface which should be used as interface of this unit

getDataWidthDependent(intf)[source]
classmethod get_ready_signal(intf)[source]
classmethod get_valid_signal(intf)[source]

hwtLib.amba.axis_comp.builder module

class hwtLib.amba.axis_comp.builder.AxiSBuilder(parent, srcInterface, name=None, master_to_slave=True)[source]

Bases: hwtLib.abstract.streamBuilder.AbstractStreamBuilder

Helper class which simplifies building of large stream paths

FifoAsyncCls

alias of hwtLib.amba.axis_comp.fifo_async.AxiSFifoAsync

FifoCls

alias of hwtLib.amba.axis_comp.fifo.AxiSFifo

FifoDropCls

alias of hwtLib.amba.axis_comp.fifoDrop.AxiSFifoDrop

RegCdcCls

alias of hwtLib.amba.axis_comp.cdc.AxiSCdc

RegCls

alias of hwtLib.amba.axis_comp.reg.AxiSReg

ResizerCls

alias of hwtLib.amba.axis_comp.resizer.AxiS_resizer

SplitCopyCls

alias of hwtLib.amba.axis_comp.splitCopy.AxiSSplitCopy

SplitSelectCls

alias of hwtLib.amba.axis_comp.splitSelect.AxiSSpliSelect

buff_drop(items, export_size=False, export_space=False)[source]

Instantiate a FIFO buffer with externally controlled frame drop functionality (use “dataIn_discard” signal)

classmethod deparse(parent, typeToForge: hwt.hdl.types.hdlType.HdlType, intfCls: hwtLib.amba.axis.AxiStream, setupFn=None, name: str = None)[source]

generate frame assembler for specified type :note: you can set endianity and others in setupFn

Parameters
  • parent – unit where generated units should be instantiated

  • typeToForge – instance of HType used as template for frame to assembly

  • intfCls – class for output interface

  • setupFn – setup function for output interface

  • name – name prefix for generated units

Returns

tuple (builder, interface with deparsed frame)

parse(typeToParse)[source]
Parameters

typeToParse – structuralized type to parse

Returns

interface with parsed data (StructIntf for HStruct f.e.)

resize(newDataWidth)[source]

Change data width of axi stream

startOfFrame()[source]

generate start of frame signal, high when we expect new frame to start

hwtLib.amba.axis_comp.cdc module

class hwtLib.amba.axis_comp.cdc.AxiSCdc(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.handshaked.cdc.HandshakedCdc

CDC (Clock domain crossing) for axi-stream like interfaces

See

hwtLib.handshaked.cdc.HandshakedCdc

schematic
static _serializeDecision(parentUnit, priv)

Decide to serialize only objs with uniq parameters and class

Parameters

priv – private data for this function ({frozen_params: obj})

Returns

tuple (do serialize this object, next priv, replacement unit)

hwtLib.amba.axis_comp.cdc.example_AxiSCdc()[source]

hwtLib.amba.axis_comp.en module

class hwtLib.amba.axis_comp.en.AxiS_en(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase

This component is like on-off switch for axi stream interface which does care about frames. If en signal is 0 current frame is finished and next frame is started only when en is 1

schematic
_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)

  • _declr method is called after _config

  • if this object is Unit all interfaces are threated as externally accessible interfaces if this object is Interface instance all subinterfaces are loaded as well

_impl()[source]

implementations

  • implement functionality of componnent there

  • called after _declr

hwtLib.amba.axis_comp.fifo module

class hwtLib.amba.axis_comp.fifo.AxiSFifo(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.handshaked.fifo.HandshakedFifo

Synchronous fifo for axi-stream interface.

See

hwtLib.handshaked.fifo.HandshakedFifo

schematic
static _serializeDecision(parentUnit, priv)

Decide to serialize only objs with uniq parameters and class

Parameters

priv – private data for this function ({frozen_params: obj})

Returns

tuple (do serialize this object, next priv, replacement unit)

hwtLib.amba.axis_comp.fifo._example_AxiSFifo()[source]

hwtLib.amba.axis_comp.fifoCopy module

class hwtLib.amba.axis_comp.fifoCopy.AxiSFifoCopy(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.handshaked.fifo.HandshakedFifo

Synchronous fifo for axi-stream interface with frame drop functionality and speculative buffering. Also known as a speculative fifo.

Note

DEPTH > axis.MAX_FRAME_LEN

See

hwtLib.handshaked.fifo_drop.HandshakedFifoDrop

schematic
FIFO_CLS

alias of hwtLib.mem.fifoCopy.FifoCopy

_connect_fifo_in()[source]
_connect_fifo_out(out_clk, out_rst)[source]
_declr() → None[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)

  • _declr method is called after _config

  • if this object is Unit all interfaces are threated as externally accessible interfaces if this object is Interface instance all subinterfaces are loaded as well

_declr_io()[source]
_impl(clk_rst: Optional[Tuple[Tuple[hwt.interfaces.std.Clk, Union[hwt.interfaces.std.Rst, hwt.interfaces.std.Rst_n]], Tuple[hwt.interfaces.std.Clk, Union[hwt.interfaces.std.Rst, hwt.interfaces.std.Rst_n]]]] = None)[source]

implementations

  • implement functionality of componnent there

  • called after _declr

static _serializeDecision(parentUnit, priv)

Decide to serialize only objs with uniq parameters and class

Parameters

priv – private data for this function ({frozen_params: obj})

Returns

tuple (do serialize this object, next priv, replacement unit)

class hwtLib.amba.axis_comp.fifoCopy.AxiSRegCopy(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.handshaked.fifo.HandshakedFifo

Same thing as a AxiSFifoCopy just uses registers without fifo pointers

_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)

  • _declr method is called after _config

  • if this object is Unit all interfaces are threated as externally accessible interfaces if this object is Interface instance all subinterfaces are loaded as well

_impl()[source]

implementations

  • implement functionality of componnent there

  • called after _declr

static _serializeDecision(parentUnit, priv)

Decide to serialize only objs with uniq parameters and class

Parameters

priv – private data for this function ({frozen_params: obj})

Returns

tuple (do serialize this object, next priv, replacement unit)

hwtLib.amba.axis_comp.fifoCopy._example_AxiSFifoCopy()[source]

hwtLib.amba.axis_comp.fifoDrop module

class hwtLib.amba.axis_comp.fifoDrop.AxiSFifoDrop(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.handshaked.fifoDrop.HandshakedFifoDrop

Synchronous fifo for axi-stream interface with frame drop functionality and speculative buffering. Also known as a speculative fifo.

Note

DEPTH > axis.MAX_FRAME_LEN

See

hwtLib.handshaked.fifo_drop.HandshakedFifoDrop

schematic
_connect_fifo_in()[source]
_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)

  • _declr method is called after _config

  • if this object is Unit all interfaces are threated as externally accessible interfaces if this object is Interface instance all subinterfaces are loaded as well

_impl(clk_rst: Optional[Tuple[Tuple[hwt.interfaces.std.Clk, Union[hwt.interfaces.std.Rst, hwt.interfaces.std.Rst_n]], Tuple[hwt.interfaces.std.Clk, Union[hwt.interfaces.std.Rst, hwt.interfaces.std.Rst_n]]]] = None)[source]

implementations

  • implement functionality of componnent there

  • called after _declr

static _serializeDecision(parentUnit, priv)

Decide to serialize only objs with uniq parameters and class

Parameters

priv – private data for this function ({frozen_params: obj})

Returns

tuple (do serialize this object, next priv, replacement unit)

hwtLib.amba.axis_comp.fifoDrop._example_AxiSFifoDrop()[source]

hwtLib.amba.axis_comp.fifoMeasuring module

class hwtLib.amba.axis_comp.fifoMeasuring.AxiS_fifoMeasuring[source]

Bases: hwt.synthesizer.unit.Unit

Fifo which are counting sizes of frames and sends it over dedicated handshaked interface “sizes”

schematic
_config()[source]

Configure object parameters

  • setup all parameters on this object, use Param class instances to allow use of parameter inheritance

  • called in __init__ of class

_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)

  • _declr method is called after _config

  • if this object is Unit all interfaces are threated as externally accessible interfaces if this object is Interface instance all subinterfaces are loaded as well

_impl()[source]

implementations

  • implement functionality of componnent there

  • called after _declr

getAlignBitsCnt()[source]
hwtLib.amba.axis_comp.fifoMeasuring._example_AxiS_fifoMeasuring()[source]

hwtLib.amba.axis_comp.fifo_async module

class hwtLib.amba.axis_comp.fifo_async.AxiSFifoAsync(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.handshaked.fifoAsync.HsFifoAsync

Asnchronous fifo for axi-stream interface.

See

hwtLib.handshaked.fifo.HsFifoAsync

schematic
static _serializeDecision(parentUnit, priv)

Decide to serialize only objs with uniq parameters and class

Parameters

priv – private data for this function ({frozen_params: obj})

Returns

tuple (do serialize this object, next priv, replacement unit)

hwtLib.amba.axis_comp.fifo_async._example_AxiSFifoAsync()[source]

hwtLib.amba.axis_comp.frameGen module

class hwtLib.amba.axis_comp.frameGen.AxisFrameGen[source]

Bases: hwt.synthesizer.unit.Unit

Generator of axi stream frames for testing purposes

schematic
_config()[source]

Configure object parameters

  • setup all parameters on this object, use Param class instances to allow use of parameter inheritance

  • called in __init__ of class

_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)

  • _declr method is called after _config

  • if this object is Unit all interfaces are threated as externally accessible interfaces if this object is Interface instance all subinterfaces are loaded as well

_impl()[source]

implementations

  • implement functionality of componnent there

  • called after _declr

hwtLib.amba.axis_comp.reg module

class hwtLib.amba.axis_comp.reg.AxiSReg(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.handshaked.reg.HandshakedReg

Register for AxiStream interfaces

See

hwtLib.handshaked.reg.HandshakedReg

Note

interface is configurable and schematic is example with AxiStream

schematic
hwtLib.amba.axis_comp.reg._example_AxiSReg()[source]

hwtLib.amba.axis_comp.resizer module

class hwtLib.amba.axis_comp.resizer.AxiS_resizer(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase

Change data with of AxiStream interface

Attention

start of frame is expected to be aligned on first word

Attention

strb can be not fully set only in last word

Attention

in upscale mode id and other signals which are not dependent on data width are propagated only from last word

_images/aafig-fe1ac27ab9f3a9623f36d13fc0c5b9c1ab104b72.gif
Note

interface is configurable and schematic is example with AxiStream

Note

first schematic is for upsize mode, second one is for downsize mode

schematicschematic
_config()[source]

Configure object parameters

  • setup all parameters on this object, use Param class instances to allow use of parameter inheritance

  • called in __init__ of class

_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)

  • _declr method is called after _config

  • if this object is Unit all interfaces are threated as externally accessible interfaces if this object is Interface instance all subinterfaces are loaded as well

_impl()[source]

implementations

  • implement functionality of componnent there

  • called after _declr

downscale(IN_DW, OUT_DW)[source]
nextAreNotValidLogic(inStrb, actualItemIndx, ITEMS, ITEM_DW)[source]
upscale(IN_DW, OUT_DW)[source]
hwtLib.amba.axis_comp.resizer._example_AxiS_resizer_downscale()[source]
hwtLib.amba.axis_comp.resizer._example_AxiS_resizer_upscale()[source]

hwtLib.amba.axis_comp.splitCopy module

class hwtLib.amba.axis_comp.splitCopy.AxiSSplitCopy(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.handshaked.splitCopy.HsSplitCopy

Stream duplicator for AxiStream interfaces

See

hwtLib.handshaked.splitCopy.HsSplitCopy

schematic

hwtLib.amba.axis_comp.splitSelect module

class hwtLib.amba.axis_comp.splitSelect.AxiSSpliSelect(intfCls=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.handshaked.splitSelect.HsSplitSelect

Send input frame to one of N output streams as specified by selectOneHot interface

See

hwtLib.handshaked.splitSelect.HsSplitSelect

schematic
_select_consume_en()[source]

hwtLib.amba.axis_comp.storedBurst module

class hwtLib.amba.axis_comp.storedBurst.AxiSStoredBurst[source]

Bases: hwt.synthesizer.unit.Unit

This units send data stored in property DATA over axi-stream interface

schematic
_config()[source]

Configure object parameters

  • setup all parameters on this object, use Param class instances to allow use of parameter inheritance

  • called in __init__ of class

_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)

  • _declr method is called after _config

  • if this object is Unit all interfaces are threated as externally accessible interfaces if this object is Interface instance all subinterfaces are loaded as well

_impl()[source]

implementations

  • implement functionality of componnent there

  • called after _declr

dataRd()[source]
nextWordIndexLogic(wordIndex)[source]