hwtLib.amba.axis_comp package

Submodules

hwtLib.amba.axis_comp.base module

class hwtLib.amba.axis_comp.base.AxiSCompBase(hsIntfCls)[source]

Bases: hwtLib.handshaked.compBase.HandshakedCompBase

Abstract base for axis components

__init__(hsIntfCls)[source]
Parameters:hsIntfCls – class of interface which should be used as interface of this unit
getDataWidthDependent(intf)[source]
getRd(intf)[source]
getVld(intf)[source]

hwtLib.amba.axis_comp.builder module

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

Bases: hwtLib.abstract.streamBuilder.AbstractStreamBuilder

Helper class which simplifies building of large stream paths

Variables:end – actual endpoint where building process will continue
FifoCls

alias of hwtLib.amba.axis_comp.fifo.AxiSFifo

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

classmethod forge(parent, typeToForge, intfCls, setupFn=None, name=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 forged frame)

parse(typeToParse)[source]
Parameters:typeToParse – structuralized type to parse
Returns:interface with parsed data (StructIntf for HStruct f.e.)
resize(newDataWidth)[source]

Change datawidth of axi stream

startOfFrame()[source]

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

hwtLib.amba.axis_comp.en module

class hwtLib.amba.axis_comp.en.AxiS_en(hsIntfCls)[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

_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 threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr

hwtLib.amba.axis_comp.fifo module

class hwtLib.amba.axis_comp.fifo.AxiSFifo(hsIntfCls)[source]

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

Synchronous fifo for axi-stream interface.

_images/aafig-1c5a4b3f091df1346f1dcc573c6a20a3287a83d3.gif
_regCls

alias of hwtLib.amba.axis_comp.reg.AxiSReg

hwtLib.amba.axis_comp.frameForge module

class hwtLib.amba.axis_comp.frameForge.AxiS_frameForge(axiSIntfCls, structT: hwt.hdl.types.hdlType.HdlType, tmpl: Union[hwt.hdl.transTmpl.TransTmpl, NoneType] = None, frames: Union[List[hwt.hdl.frameTmpl.FrameTmpl], NoneType] = None)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.amba.axis_comp.templateBasedUnit.TemplateBasedUnit

Assemble fields into frame on axi stream interface

Note:names in the picture are just illustrative
_images/aafig-8c8070b4a15c55a99838e97566f754692f2d72a5.gif
__init__(axiSIntfCls, structT: hwt.hdl.types.hdlType.HdlType, tmpl: Union[hwt.hdl.transTmpl.TransTmpl, NoneType] = None, frames: Union[List[hwt.hdl.frameTmpl.FrameTmpl], NoneType] = None)[source]
Parameters:
  • hsIntfCls – class of interface which should be used as interface of this unit
  • structT – instance of HStruct used as template for this frame if name is None no input port is generated and space is filled with invalid values litle-endian encoding, supported types of interfaces are: Handshaked, Signal can be also instance of FrameTmpl
  • tmpl – instance of TransTmpl for this structT
  • frames – list of FrameTmpl instances for this tmpl
Note:

if tmpl and frames are None they are resolved from structT parseTemplate

Note:

this unit can parse sequence of frames, if they are specified by “frames”

Note:

structT can contain fields with variable size like HStream

_declr()[source]

” Parse template and decorate with interfaces

_impl()[source]

Iterate over words in template and create stream output mux and fsm.

static _mkFieldIntf(parent: hwt.interfaces.structIntf.StructIntf, structField: hwt.hdl.types.struct.HStructField)[source]

Instantiate interface for all members of input type

connectPartsOfWord(wordData_out: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, tPart: Union[hwt.hdl.transPart.TransPart, hwt.hdl.frameTmplUtils.ChoicesOfFrameParts], inPorts_out: List[Union[hwt.interfaces.std.Handshaked, hwtLib.handshaked.streamNode.StreamNode]], lastInPorts_out: List[Union[hwt.interfaces.std.Handshaked, hwtLib.handshaked.streamNode.StreamNode]])[source]

Connect transactions parts to signal for word of output stream

Parameters:
  • wordData_out – signal for word of output stream
  • tPart – instance of TransPart or ChoicesOfFrameParts to connect
  • inPorts_out – input interfaces to this transaction part
  • lastInPorts_out – input interfaces for last parts of transactions
handshakeLogicForWord(inPorts: List[Union[hwt.interfaces.std.Handshaked, hwtLib.handshaked.streamNode.StreamNode]], lastInPorts: List[Union[hwt.interfaces.std.Handshaked, hwtLib.handshaked.streamNode.StreamNode]], en: Union[bool, hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal])[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

_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 threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr

hwtLib.amba.axis_comp.frameLinkConv module

Bases: hwt.synthesizer.unit.Unit

Axi 4 stream to FrameLink

format of user signal: user[0]: start of packet user[1]: end of packet

_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 threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr
class hwtLib.amba.axis_comp.frameLinkConv.FrameLinkToAxiS[source]

Bases: hwt.synthesizer.unit.Unit

Framelink to axi-stream

format of user signal: user[0]: start of packet user[1]: end of packet

_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 threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr
hwtLib.amba.axis_comp.frameLinkConv.strbToRem(strbBits, remBits)[source]

hwtLib.amba.axis_comp.frameParser module

class hwtLib.amba.axis_comp.frameParser.AxiS_frameParser(axiSCls, structT: hwt.hdl.types.hdlType.HdlType, tmpl: Union[hwt.hdl.transTmpl.TransTmpl, NoneType] = None, frames: Union[List[hwt.hdl.frameTmpl.FrameTmpl], NoneType] = None)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase, hwtLib.amba.axis_comp.templateBasedUnit.TemplateBasedUnit

Parse frame specified by HStruct into fields

_images/aafig-e49a4e36e1f861154ee5aa14e31600d9d1372e1d.gif
Note:names in the picture are just illustrative
__init__(axiSCls, structT: hwt.hdl.types.hdlType.HdlType, tmpl: Union[hwt.hdl.transTmpl.TransTmpl, NoneType] = None, frames: Union[List[hwt.hdl.frameTmpl.FrameTmpl], NoneType] = None)[source]
Parameters:
  • axiSCls – class of input axi stream interface
  • structT – instance of HStruct which specifies data format to download
  • tmpl – instance of TransTmpl for this structT
  • frames – list of FrameTmpl instances for this tmpl
Note:

if tmpl and frames are None they are resolved from structT parseTemplate

Note:

this unit can parse sequence of frames, if they are specified by “frames”

Attention:

structT can not contain fields with variable size like HStream

_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 threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr
_mkFieldIntf(parent: hwt.interfaces.structIntf.StructIntf, structField: hwt.hdl.types.struct.HStructField)[source]
choiceIsSelected(interfaceOfChoice: hwt.interfaces.unionIntf.UnionSink)[source]

Check if union member is selected by _select interface in union interface

connectPart(hsNondes: list, part: Union[hwt.hdl.transPart.TransPart, hwt.hdl.frameTmplUtils.ChoicesOfFrameParts], en: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, bool], exclusiveEn: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, NoneType] = <BitsVal 1, mask 1>)[source]

Create datamux for one word in main fsm and colect metainformations for handshake logic

Parameters:hsNondes – list of nodes of handshaked logic
connectParts(allOutNodes: hwtLib.amba.axis_comp.frameParser_utils.ListOfOutNodeInfos, words, wordIndexReg: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, NoneType])[source]

Create main datamux from dataIn to dataOut

getInDataSignal(transPart: hwt.hdl.transPart.TransPart)[source]

hwtLib.amba.axis_comp.frameParser_utils module

class hwtLib.amba.axis_comp.frameParser_utils.ExclusieveListOfHsNodes(selectorIntf)[source]

Bases: list

@ivar selectorIntf: selector for this node

__init__(selectorIntf)[source]

Initialize self. See help(type(self)) for accurate signature.

ack() → hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal[source]
append(object) → None -- append object to end[source]
sync(allNodes: List[hwtLib.amba.axis_comp.frameParser_utils.OutNodeInfo], en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal) → None[source]
class hwtLib.amba.axis_comp.frameParser_utils.InNodeInfo(inInterface: hwt.interfaces.std.Handshaked, en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal)[source]

Bases: object

Interface has to be ready and handshaked logic should be constructed

__init__(inInterface: hwt.interfaces.std.Handshaked, en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal)[source]

Initialize self. See help(type(self)) for accurate signature.

ack() → hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal[source]
sync(others: List[OutNodeInfo], en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal)[source]
class hwtLib.amba.axis_comp.frameParser_utils.InNodeReadOnlyInfo(inInterface: hwt.interfaces.std.Handshaked, en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal)[source]

Bases: hwtLib.amba.axis_comp.frameParser_utils.InNodeInfo

Interface has to be ready but handshake logic is not constructed

sync(others: List[OutNodeInfo], en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal)[source]
class hwtLib.amba.axis_comp.frameParser_utils.ListOfOutNodeInfos[source]

Bases: list

ack() → hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal[source]
sync(allNodes: List[hwtLib.amba.axis_comp.frameParser_utils.OutNodeInfo], en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal) → None[source]
class hwtLib.amba.axis_comp.frameParser_utils.OutNodeInfo(parent: hwt.synthesizer.unit.Unit, outInterface: hwt.interfaces.std.VldSynced, en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, exclusiveEn: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, NoneType] = None)[source]

Bases: object

Container for informations about output for handshake logic

Variables:
  • outInterface – output parsed interface
  • en – enable signal of word
  • exvlusiveEn – enable signal of union member
  • pendingReg – register with flag if this item was consumed
__init__(parent: hwt.synthesizer.unit.Unit, outInterface: hwt.interfaces.std.VldSynced, en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, exclusiveEn: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, NoneType] = None)[source]

Initialize self. See help(type(self)) for accurate signature.

ack() → hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal[source]
sync(others: List[OutNodeInfo], en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal)[source]
class hwtLib.amba.axis_comp.frameParser_utils.WordFactory(wordIndexReg: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, NoneType])[source]

Bases: object

__init__(wordIndexReg: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, NoneType])[source]

Initialize self. See help(type(self)) for accurate signature.

ack() → hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal[source]
addWord(index, hsNodes)[source]
sync(en: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal) → None[source]
hwtLib.amba.axis_comp.frameParser_utils.getAckOfOthers(self: hwtLib.amba.axis_comp.frameParser_utils.OutNodeInfo, others: List[hwtLib.amba.axis_comp.frameParser_utils.OutNodeInfo])[source]

hwtLib.amba.axis_comp.measuringFifo module

class hwtLib.amba.axis_comp.measuringFifo.AxiS_measuringFifo(stream_t=<class 'hwtLib.amba.axis.AxiStream'>)[source]

Bases: hwt.synthesizer.unit.Unit

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

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

Initialize self. See help(type(self)) for accurate signature.

_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 threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr
getAlignBitsCnt()[source]

hwtLib.amba.axis_comp.reg module

class hwtLib.amba.axis_comp.reg.AxiSReg(hsIntfCls)[source]

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

Register for axi stream interface

hwtLib.amba.axis_comp.resizer module

class hwtLib.amba.axis_comp.resizer.AxiS_resizer(hsIntfCls)[source]

Bases: hwtLib.amba.axis_comp.base.AxiSCompBase

Change data with of 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-bce2d1f8107cae35665138a1b5da1ec8806ee3e8.gif
_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 threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design 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.splitCopy module

class hwtLib.amba.axis_comp.splitCopy.AxiSSplitCopy(hsIntfCls)[source]

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

hwtLib.amba.axis_comp.splitSelect module

class hwtLib.amba.axis_comp.splitSelect.AxiSSpliSelect(hsIntfCls)[source]

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

hwtLib.amba.axis_comp.storedBurst module

class hwtLib.amba.axis_comp.storedBurst.AxiSStoredBurst(data=[72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])[source]

Bases: hwt.synthesizer.unit.Unit

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

__init__(data=[72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])[source]

Initialize self. See help(type(self)) for accurate signature.

_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 threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr
dataRd()[source]
nextWordIndexLogic(wordIndex)[source]

hwtLib.amba.axis_comp.templateBasedUnit module

class hwtLib.amba.axis_comp.templateBasedUnit.TemplateBasedUnit[source]

Bases: hwt.synthesizer.unit.Unit

Class with functions for extracting metadata in frame template

chainFrameWords()[source]
parseTemplate()[source]

Module contents