hwtLib.amba.axis_comp package¶
This package is dedicated for a componets and utils which are related to AMBA AXI-stream (AXI4-Stream) interface
Subpackages¶
- hwtLib.amba.axis_comp.frame_deparser package
- hwtLib.amba.axis_comp.frame_join package
- hwtLib.amba.axis_comp.frame_parser package
- Submodules
- hwtLib.amba.axis_comp.frame_parser.field_connector module
Axi4S_frameParserFieldConnectorAxi4S_frameParserFieldConnector.__init__()Axi4S_frameParserFieldConnector.choiceIsSelected()Axi4S_frameParserFieldConnector.connectChoicesOfFrameParts()Axi4S_frameParserFieldConnector.connectPart()Axi4S_frameParserFieldConnector.connectParts()Axi4S_frameParserFieldConnector.connectStreamOfFrameParts()Axi4S_frameParserFieldConnector.getInDataSignal()
get_byte_order_modifier()
- hwtLib.amba.axis_comp.frame_parser.footer_split module
- hwtLib.amba.axis_comp.frame_parser.out_containers module
- hwtLib.amba.axis_comp.frame_parser.test_types module
- hwtLib.amba.axis_comp.frame_parser.word_factory module
Submodules¶
hwtLib.amba.axis_comp.base module¶
- class hwtLib.amba.axis_comp.base.Axi4SCompBase(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
HandshakedCompBaseAbstract base for axis components
- __annotations__ = {}¶
- __init__(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
- Parameters:
hshwIO – class of interface which should be used as interface of this unit
- getDataWidthDependent(hwIO: Axi4Stream)[source]¶
- classmethod get_ready_signal(hwIO: Axi4Stream)[source]¶
- classmethod get_valid_signal(hwIO: Axi4Stream)[source]¶
hwtLib.amba.axis_comp.builder module¶
- class hwtLib.amba.axis_comp.builder.Axi4SBuilder(parent: HwModule, srcInterface: HwIO | HObjList, name: str | None = None, master_to_slave: bool = True)[source]¶
Bases:
AbstractStreamBuilderHelper class which simplifies building of large stream paths
- FifoAsyncCls¶
alias of
Axi4SFifoAsync
- FifoDropCls¶
alias of
Axi4SFifoDrop
- JoinPrioritizedCls¶
alias of
Axi4SJoinPrioritized
- ResizerCls¶
alias of
Axi4S_resizer
- SplitCopyCls¶
alias of
Axi4SSplitCopy
- SplitSelectCls¶
alias of
Axi4SSpliSelect
- __annotations__ = {}¶
- buff_drop(items: int, export_size=False, export_space=False)[source]¶
Instantiate a FIFO buffer with externally controlled frame drop functionality (use “dataIn_discard” signal)
- classmethod constant_frame(parent: HwModule, value: bytes | Tuple[int | HBitsConst | None, ...], data_width: int, use_strb: bool = False, use_keep: bool = False, repeat=True, name=None) Axi4SBuilder[source]¶
Instantiate a constant buffer which wil produce the frame of specified data
- classmethod deparse(parent: HwModule, typeToForge: HdlType, hwIO: Axi4Stream, setupFn=None, name: str = None) Tuple[Axi4SBuilder, HwIOStruct][source]¶
generate frame assembler for specified type :note: you can set endianity and others in setupFn
- Parameters:
parent – HwModule where generated units should be instantiated
typeToForge – instance of HType used as template for frame to assembly
hwIO – 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) HwIOStruct[source]¶
- Parameters:
typeToParse – structuralized type to parse
- Returns:
interface with parsed data (e.g. HwIOStruct for HStruct)
- startOfFrame() RtlSignal[source]¶
generate start of frame signal, high when we expect new frame to start
- to_avalonSt() AvalonSTBuilder[source]¶
hwtLib.amba.axis_comp.cdc module¶
- class hwtLib.amba.axis_comp.cdc.Axi4SCdc(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBase,HandshakedCdcCDC (Clock domain crossing) for axi-stream like interfaces
- HDL params:
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
DATA_RESET_VAL - default value None of type None
IN_FREQ - default value 100000000 of type int
OUT_FREQ - default value 100000000 of type int
- HDL IO:
dataIn_clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
dataIn_rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataOut_clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
dataOut_rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
- HDL components:
in_ack_pulse_gen - of type hwtLib.clocking.cdc.CdcPulseGen
out_en_pulse_gen - of type hwtLib.clocking.cdc.CdcPulseGen
tx_fsm - of type hwtLib.handshaked.cdc.HandshakeFSM
rx_fsm - of type hwtLib.handshaked.cdc.HandshakeFSM
- __annotations__ = {}¶
hwtLib.amba.axis_comp.en module¶
- class hwtLib.amba.axis_comp.en.Axi4S_en(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBaseThis 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
- HDL params:
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
en - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
- __annotations__ = {}¶
hwtLib.amba.axis_comp.fifo module¶
- class hwtLib.amba.axis_comp.fifo.Axi4SFifo(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBase,HandshakedFifoSynchronous fifo for axi-stream interface.
- HDL params:
DEPTH - default value 4 of type int
EXPORT_SIZE - default value False of type bool
EXPORT_SPACE - default value False of type bool
INIT_DATA - default value () of type tuple
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
- HDL components:
fifo - of type hwtLib.mem.fifo.Fifo
- __annotations__ = {}¶
hwtLib.amba.axis_comp.fifoCopy module¶
- class hwtLib.amba.axis_comp.fifoCopy.Axi4SFifoCopy(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBase,HandshakedFifoSynchronous FIFO for axi-stream interface which can copy last frame or work as a regular FIFO.
- HDL params:
DEPTH - default value 4 of type int
EXPORT_SIZE - default value False of type bool
EXPORT_SPACE - default value False of type bool
INIT_DATA - default value () of type tuple
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 2 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
dataOut_copy_frame - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - SLAVE
dataOut_replacement_id - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 2bits> - SLAVE
- HDL components:
fifo - of type hwtLib.mem.fifoCopy.FifoCopy
- REG_CLS¶
alias of
NotImplementedError
- __annotations__ = {}¶
- class hwtLib.amba.axis_comp.fifoCopy.Axi4SRegCopy(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBase,HandshakedFifoSame thing as a
Axi4SFifoCopyjust uses registers without fifo pointers- HDL params:
DEPTH - default value 0 of type int
EXPORT_SIZE - default value False of type bool
EXPORT_SPACE - default value False of type bool
INIT_DATA - default value () of type tuple
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
dataOut_copy_frame - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - SLAVE
- HDL components:
reg - of type hwtLib.amba.axis_comp.reg.Axi4SReg
- REG_CLS¶
alias of
NotImplementedError
- __annotations__ = {}¶
hwtLib.amba.axis_comp.fifoDrop module¶
- class hwtLib.amba.axis_comp.fifoDrop.Axi4SFifoDrop(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBase,HandshakedFifoDropSynchronous FIFO for axi-stream interface with frame drop functionality and speculative buffering. Also known as a speculative FIFO.
- HDL params:
DEPTH - default value 4 of type int
EXPORT_SIZE - default value True of type bool
EXPORT_SPACE - default value True of type bool
INIT_DATA - default value () of type tuple
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
size - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 3bits, unsigned> - MASTER
space - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 3bits, unsigned> - MASTER
dataIn_discard - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - SLAVE
- HDL components:
fifo - of type hwtLib.mem.fifoDrop.FifoDrop
- REG_CLS¶
alias of
NotImplementedError
- __annotations__ = {}¶
hwtLib.amba.axis_comp.fifoFrameReversing module¶
- class hwtLib.amba.axis_comp.fifoFrameReversing.Axi4S_fifoFrameReversing(hdlName: str | None = None)[source]¶
Bases:
HwModuleFIFO which returns the word of the frame in reversal order
- HDL params:
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value True of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
MAX_PKT_WORDS - default value 255 of type intmax number of words per packet
MAX_PKT_CNT - default value 2 of type intmax number of packets in storable in this FIFO
DEPTH - default value 510 of type intmax number of packet words storable in this FIFO
INIT_DATA - default value () of type tuple
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
- HDL components:
ram - of type hwtLib.mem.ram.RamSingleClock
framePosFifo - of type hwtLib.handshaked.fifo.HandshakedFifo
- REG_CLS¶
alias of
NotImplementedError
- __annotations__ = {}¶
hwtLib.amba.axis_comp.fifoMeasuring module¶
- class hwtLib.amba.axis_comp.fifoMeasuring.Axi4S_fifoMeasuring(hdlName: str | None = None)[source]¶
Bases:
HwModuleFIFO which are counting sizes of frames and sends it over dedicated handshaked interface “sizes”
- HDL params:
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value True of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
SIZES_BUFF_DEPTH - default value 4 of type int
MAX_LEN - default value 15 of type int
EXPORT_ALIGNMENT_ERROR - default value False of type bool
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
sizes - of type hwt.hwIOs.std.HwIODataRdVld - MASTER
- HDL components:
dataBuff - of type hwtLib.amba.axis_comp.fifo.Axi4SFifo
sizesBuff - of type hwtLib.handshaked.fifo.HandshakedFifo
gen_dataIn_reg_0 - of type hwtLib.amba.axis_comp.reg.Axi4SReg
- REG_CLS¶
alias of
NotImplementedError
- __annotations__ = {}¶
hwtLib.amba.axis_comp.fifo_async module¶
- class hwtLib.amba.axis_comp.fifo_async.Axi4SFifoAsync(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBase,HsFifoAsyncAsnchronous fifo for axi-stream interface.
- HDL params:
DEPTH - default value 5 of type int
EXPORT_SIZE - default value False of type bool
EXPORT_SPACE - default value False of type bool
INIT_DATA - default value () of type tuple
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
IN_FREQ - default value 100000000 of type int
OUT_FREQ - default value 100000000 of type int
- HDL IO:
dataIn_clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
dataOut_clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
dataIn_rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut_rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
- HDL components:
fifo - of type hwtLib.mem.fifoAsync.FifoAsync
- __annotations__ = {}¶
hwtLib.amba.axis_comp.frameGen module¶
- class hwtLib.amba.axis_comp.frameGen.Axi4sFrameGen(hdlName: str | None = None)[source]¶
Bases:
HwModuleGenerator of AXI stream frames for testing purposes
- HDL params:
MAX_LEN - default value 511 of type int
CNTRL_ADDR_WIDTH - default value 4 of type int
CNTRL_DATA_WIDTH - default value 32 of type int
DATA_WIDTH - default value 64 of type int
USE_STRB - default value True of type bool
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
axis_out - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
cntrl - of type hwtLib.amba.axi4Lite.Axi4Lite - SLAVE
- HDL components:
conv - of type hwtLib.amba.axiLite_comp.endpoint.AxiLiteEndpoint
- __annotations__ = {}¶
hwtLib.amba.axis_comp.joinPrioritized module¶
- class hwtLib.amba.axis_comp.joinPrioritized.Axi4SJoinPrioritized(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBase,HsJoinPrioritizedJoin input stream to single output stream inputs with lower number has higher priority
- HDL params:
INPUTS - default value 2 of type int
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataIn - of type hwt.hwIOs.hwIOArray.HwIOArray - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
- HDL components:
join - of type hwtLib.handshaked.joinPrioritized.HsJoinPrioritized
- __annotations__ = {}¶
hwtLib.amba.axis_comp.reg module¶
- class hwtLib.amba.axis_comp.reg.Axi4SReg(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBase,HandshakedRegRegister for Axi4Stream interfaces
- HDL params:
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
LATENCY - default value 1 of type int
DELAY - default value 0 of type int
INIT_DATA - default value () of type tuple
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
- __annotations__ = {}¶
hwtLib.amba.axis_comp.resizer module¶
- class hwtLib.amba.axis_comp.resizer.Axi4S_resizer(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBaseChange data with of Axi4Stream 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
- Note:
interface is configurable and schematic is example with Axi4Stream
- Note:
first schematic is for upsize mode, second one is for downsize mode
- __annotations__ = {}¶
hwtLib.amba.axis_comp.splitCopy module¶
- class hwtLib.amba.axis_comp.splitCopy.Axi4SSplitCopy(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBase,HsSplitCopyStream duplicator for Axi4Stream interfaces
- HDL params:
OUTPUTS - default value 2 of type int
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
- HDL IO:
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwt.hwIOs.hwIOArray.HwIOArray - MASTER
- __annotations__ = {}¶
hwtLib.amba.axis_comp.splitSelect module¶
- class hwtLib.amba.axis_comp.splitSelect.Axi4SSpliSelect(hwIOCls=<class 'hwtLib.amba.axi4s.Axi4Stream'>, hdlName: str | None = None)[source]¶
Bases:
Axi4SCompBase,HsSplitSelectSend input frame to one of N output streams as specified by selectOneHot interface
- HDL params:
OUTPUTS - default value 3 of type int
HWIO_CLS - default value <class ‘hwtLib.amba.axi4s.Axi4Stream’> of type type
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
selectOneHot - of type hwt.hwIOs.std.HwIODataRdVld - SLAVE
dataIn - of type hwtLib.amba.axi4s.Axi4Stream - SLAVE
dataOut - of type hwt.hwIOs.hwIOArray.HwIOArray - MASTER
- HDL components:
selReg - of type hwtLib.handshaked.reg.HandshakedReg
- __annotations__ = {}¶
hwtLib.amba.axis_comp.storedBurst module¶
- class hwtLib.amba.axis_comp.storedBurst.Axi4SStoredBurst(hdlName: str | None = None)[source]¶
Bases:
HwModuleThis unit send data stored in property
DATAover axi-stream interface- Variables:
~.DATA – bytes or integer values for each word
~.REPEAT – if False this component works in one-shot mode
- HDL params:
IS_BIGENDIAN - default value False of type bool
USE_STRB - default value False of type bool
USE_KEEP - default value False of type bool
ID_WIDTH - default value 0 of type int
DEST_WIDTH - default value 0 of type int
DATA_WIDTH - default value 64 of type int
USER_WIDTH - default value 0 of type int
REPEAT - default value False of type bool
DATA - default value b’Hello world!!!!!’ of type bytes
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
dataOut - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
- __annotations__ = {}¶
hwtLib.amba.axis_comp.strformat module¶
- class hwtLib.amba.axis_comp.strformat.Axi4S_strFormat(hdlName: str | None = None)[source]¶
Bases:
HwModuleGenerate component which does same thing as printf just in hw. The output string is stream of encoded characters. The ending ‘0’ is not appended. And ‘last’ signal of Axi4Stream is used instead.
- HDL params:
DATA_WIDTH - default value 8 of type int
FORMAT - default value (‘Axi4S_strFormat: hex: 0x’, <Axi4S_strFormatItem (‘data’,), x, 8>, ‘, dec: ‘, <Axi4S_strFormatItem (‘data’,), d, 10>, ‘ is the value of data from example’) of type tuple
INPUT_T - default value struct { <HBits, 32bits, unsigned> data } of type hwt.hdl.types.struct.HStruct
ENCODING - default value utf-8 of type str
- HDL IO:
clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
data_in - of type hwt.hwIOs.hwIOStruct.HwIOStruct with dtype=struct { <HBits, 32bits, unsigned> data } - SLAVE
data_out - of type hwtLib.amba.axi4s.Axi4Stream - MASTER
- HDL components:
bin_to_bcd - of type hwtLib.logic.binToBcd.BinToBcd
- __annotations__ = {}¶
- build_string_rom()[source]¶
Collect all const strings and char translation tables and pack them in to a content of string rom
- connect_single_format_group(f_i: int, f: str | Axi4S_strFormatItem, strings_offset_and_size: Dict[int | str, Tuple[int, int]], string_rom: RtlSignal, char_i: RtlSignal, to_bcd_inputs: List[Tuple[RtlSignal, HdlStatement]], en: RtlSignal)[source]¶
Connect a single formating group or string chunk to output. Depending on item type this may involve:
iterate the string characters stored in string_rom
iterate and translate bin/oct/hex characters
register bcd input for later connection
connect an input string from an input Axi4Stream
- class hwtLib.amba.axis_comp.strformat.Axi4S_strFormatItem(member_path: TypePath, format_type: str, digits: int)[source]¶
Bases:
object- Variables:
member_path – path which specifies the location of interface with the value on input interface
digits – number of digitsof output formated number (not used for ‘s’ format)
format_type – is one of following characters. +——+——————————-+ | char | format meaning | +======+===============================+ | ‘d’ | decadic number | +——+——————————-+ | ‘b’ | binary number | +——+——————————-+ | ‘o’ | octal number | +——+——————————-+ | ‘x’ | hexadecimal number lowercase | +——+——————————-+ | ‘X’ | hexadecimal number uppercase | +——+——————————-+ | ‘s’ | string | +——+——————————-+
leading_char_fill (str) – character which should be used to fill leading digits if number of digits is used but the value have less digits
- BITS_PER_CHAR = {'X': 4, 'b': 1, 'd': 4, 'o': 3, 'x': 4}¶
hwtLib.amba.axis_comp.strformat_fn module¶
- hwtLib.amba.axis_comp.strformat_fn._parse_format_groups(f_str: str) Generator[str | Axi4S_strFormatItem, None, None][source]¶
- hwtLib.amba.axis_comp.strformat_fn.axiS_strFormat(parent: HwModule, name: str, data_width: int, format_str: str, *args, **kwargs)[source]¶
Instantiate an
hwtLib.amba.axis_comp.strformat.Axi4S_strFormatusing simplified str.format syntax The syntax is allows for an utf-8 string with a variable format groups and several escape sequences in addition to normal string escape sequences.The escape sequences are (same as
str.format())+=======+=================+ | char | escape sequence | +=======+=================+ | { | {{ | +-------+-----------------+ | } | }} | +-------+-----------------+The syntax for format group is as folowing:
{[index/name]:[nuber_of_digits][type]}The index or name specifies the name or the index of the input parameter.
The width specifies how mahy digits should the output have.
Format types can be found at
hwtLib.amba.axis_comp.strformat.Axi4S_strFormatItemIf nuber_of_digits starts with 0 the leading zeros will be used instead of default space char (’ ‘)
The sign char is included in nuber_of_digits (‘{0:04X}’.format(-1) == ‘-001’)
The type is described in
hwtLib.amba.axis_comp.strformat.Axi4S_strFormatItem