hwtLib.amba.axi_comp package¶
Generic Axi3/4 components
- note:
majority of components can be also configured to use Axi3/4Lite HwIO instead
Subpackages¶
- hwtLib.amba.axi_comp.cache package
- Submodules
- hwtLib.amba.axi_comp.cache.addrTypeConfig module
- hwtLib.amba.axi_comp.cache.cacheWriteAllocWawOnlyWritePropagating module
AxiCacheWriteAllocWawOnlyWritePropagatingAxiCacheWriteAllocWawOnlyWritePropagating.__annotations__AxiCacheWriteAllocWawOnlyWritePropagating.axiAddrDefaults()AxiCacheWriteAllocWawOnlyWritePropagating.connect_tag_lookup()AxiCacheWriteAllocWawOnlyWritePropagating.flush_handler()AxiCacheWriteAllocWawOnlyWritePropagating.hwImpl()AxiCacheWriteAllocWawOnlyWritePropagating.incr_lru_on_hit()AxiCacheWriteAllocWawOnlyWritePropagating.read_handler()AxiCacheWriteAllocWawOnlyWritePropagating.resolve_victim()AxiCacheWriteAllocWawOnlyWritePropagating.write_handler()
_example_AxiCacheWriteAllocWawOnlyWritePropagating()
- hwtLib.amba.axi_comp.cache.lru_array module
- hwtLib.amba.axi_comp.cache.pseudo_lru module
- hwtLib.amba.axi_comp.cache.tag_array module
- hwtLib.amba.axi_comp.cache.utils module
- hwtLib.amba.axi_comp.interconnect package
- Submodules
- hwtLib.amba.axi_comp.interconnect.base module
- hwtLib.amba.axi_comp.interconnect.common module
- hwtLib.amba.axi_comp.interconnect.matrix module
- hwtLib.amba.axi_comp.interconnect.matrixAddrCrossbar module
AxiInterconnectMatrixAddrCrossbarAxiInterconnectMatrixAddrCrossbar.__annotations__AxiInterconnectMatrixAddrCrossbar.__init__()AxiInterconnectMatrixAddrCrossbar.addr_handler_N_to_M()AxiInterconnectMatrixAddrCrossbar.addr_handler_build_addr_mux()AxiInterconnectMatrixAddrCrossbar.priorityAck()AxiInterconnectMatrixAddrCrossbar.propagate_addr()
example_AxiInterconnectMatrixAddrCrossbar()
- hwtLib.amba.axi_comp.interconnect.matrixCrossbar module
AxiInterconnectMatrixCrossbarAxiInterconnectMatrixCrossbar.__annotations__AxiInterconnectMatrixCrossbar.__init__()AxiInterconnectMatrixCrossbar._masters_for_slave()AxiInterconnectMatrixCrossbar.connection_handler_N_to_M()AxiInterconnectMatrixCrossbar.get_last()AxiInterconnectMatrixCrossbar.handler_data_mux()AxiInterconnectMatrixCrossbar.handler_din_rd()AxiInterconnectMatrixCrossbar.handler_dout_vld()
example_AxiInterconnectMatrixCrossbar()
- hwtLib.amba.axi_comp.interconnect.matrixR module
- hwtLib.amba.axi_comp.interconnect.matrixW module
- hwtLib.amba.axi_comp.lsu package
- Submodules
- hwtLib.amba.axi_comp.lsu.fifo_oooread module
- hwtLib.amba.axi_comp.lsu.hIOs module
- hwtLib.amba.axi_comp.lsu.read_aggregator module
- hwtLib.amba.axi_comp.lsu.store_queue_write_propagating module
- hwtLib.amba.axi_comp.lsu.write_aggregator module
- hwtLib.amba.axi_comp.lsu.write_aggregator_write_dispatcher module
AxiWriteAggregatorWriteDispatcherAxiWriteAggregatorWriteDispatcher.__annotations__AxiWriteAggregatorWriteDispatcher.data_ram_read_to_bus_w()AxiWriteAggregatorWriteDispatcher.dispatch_addr()AxiWriteAggregatorWriteDispatcher.dispatch_data()AxiWriteAggregatorWriteDispatcher.precompute_constants()AxiWriteAggregatorWriteDispatcher.receive_write_confirm()
- hwtLib.amba.axi_comp.oooOp package
- Submodules
- hwtLib.amba.axi_comp.oooOp.outOfOrderCummulativeOp module
OutOfOrderCummulativeOpOutOfOrderCummulativeOp.__annotations__OutOfOrderCummulativeOp._axi_addr_defaults()OutOfOrderCummulativeOp._declr_io()OutOfOrderCummulativeOp._init_constants()OutOfOrderCummulativeOp.apply_data_write_forwarding()OutOfOrderCummulativeOp.ar_dispatch()OutOfOrderCummulativeOp.can_write_forward()OutOfOrderCummulativeOp.collision_detector()OutOfOrderCummulativeOp.data_load()OutOfOrderCummulativeOp.data_store()OutOfOrderCummulativeOp.main_op()OutOfOrderCummulativeOp.main_pipeline()OutOfOrderCummulativeOp.propagate_trans_st()OutOfOrderCummulativeOp.write_cancel()OutOfOrderCummulativeOp.write_forwarding_en()
- hwtLib.amba.axi_comp.oooOp.reorder_buffer module
- hwtLib.amba.axi_comp.oooOp.utils module
HwIOOutOfOrderCummulativeOpHwIOOutOfOrderCummulativeOpAgentOOOOpPipelineStageOutOfOrderCummulativeOpPipelineConfigOutOfOrderCummulativeOpPipelineConfig.READ_DATA_RECEIVEOutOfOrderCummulativeOpPipelineConfig.STATE_LOADOutOfOrderCummulativeOpPipelineConfig.WAIT_FOR_WRITE_ACKOutOfOrderCummulativeOpPipelineConfig.WRITE_BACKOutOfOrderCummulativeOpPipelineConfig.WRITE_HISTORY_SIZEOutOfOrderCummulativeOpPipelineConfig.__annotations__OutOfOrderCummulativeOpPipelineConfig.__getnewargs__()OutOfOrderCummulativeOpPipelineConfig.__match_args__OutOfOrderCummulativeOpPipelineConfig.__new__()OutOfOrderCummulativeOpPipelineConfig.__orig_bases__OutOfOrderCummulativeOpPipelineConfig.__repr__()OutOfOrderCummulativeOpPipelineConfig.__slots__OutOfOrderCummulativeOpPipelineConfig._asdict()OutOfOrderCummulativeOpPipelineConfig._field_defaultsOutOfOrderCummulativeOpPipelineConfig._fieldsOutOfOrderCummulativeOpPipelineConfig._make()OutOfOrderCummulativeOpPipelineConfig._replace()OutOfOrderCummulativeOpPipelineConfig.new_config()
- hwtLib.amba.axi_comp.sim package
Submodules¶
hwtLib.amba.axi_comp.buff module¶
- class hwtLib.amba.axi_comp.buff.AxiBuff(hwIOCls, hdlName: str | None = None)[source]¶
Bases:
BusBridgeTransaction buffer for AXI3/4/Lite and others
- HDL params:
HWIO_CLS - default value <class ‘hwtLib.amba.axi4.Axi4’> of type type
ADDR_WIDTH - default value 32 of type int
DATA_WIDTH - default value 64 of type int
ID_WIDTH - default value 6 of type int
ADDR_USER_WIDTH - default value 0 of type int
ADDR_BUFF_DEPTH - default value 4 of type int
DATA_BUFF_DEPTH - default value 4 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
s - of type hwtLib.amba.axi4.Axi4 - SLAVE
m - of type hwtLib.amba.axi4.Axi4 - MASTER
- HDL components:
ar_fifo_0 - of type hwtLib.amba.axis_comp.fifo.Axi4SFifo
aw_fifo_0 - of type hwtLib.amba.axis_comp.fifo.Axi4SFifo
w_fifo_0 - of type hwtLib.amba.axis_comp.fifo.Axi4SFifo
r_fifo_0 - of type hwtLib.amba.axis_comp.fifo.Axi4SFifo
b_fifo_0 - of type hwtLib.amba.axis_comp.fifo.Axi4SFifo
- __annotations__ = {}¶
hwtLib.amba.axi_comp.buff_cdc module¶
- class hwtLib.amba.axi_comp.buff_cdc.AxiBuffCdc(hwIOCls, hdlName: str | None = None)[source]¶
Bases:
AxiBuffClock domain crossing with buffers for AXI3/4/Lite and others
- HDL params:
HWIO_CLS - default value <class ‘hwtLib.amba.axi4.Axi4’> of type type
ADDR_WIDTH - default value 32 of type int
DATA_WIDTH - default value 64 of type int
ID_WIDTH - default value 6 of type int
ADDR_USER_WIDTH - default value 0 of type int
ADDR_BUFF_DEPTH - default value 5 of type int
DATA_BUFF_DEPTH - default value 5 of type int
M_FREQ - default value 102000000 of type int
S_FREQ - default value 102000000 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
s - of type hwtLib.amba.axi4.Axi4 - SLAVE
m - of type hwtLib.amba.axi4.Axi4 - MASTER
m_clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE
m_rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE
- HDL components:
ar_cdcAFifo_0 - of type hwtLib.amba.axis_comp.fifo_async.Axi4SFifoAsync
aw_cdcAFifo_0 - of type hwtLib.amba.axis_comp.fifo_async.Axi4SFifoAsync
w_cdcAFifo_0 - of type hwtLib.amba.axis_comp.fifo_async.Axi4SFifoAsync
r_cdcAFifo_0 - of type hwtLib.amba.axis_comp.fifo_async.Axi4SFifoAsync
b_cdcAFifo_0 - of type hwtLib.amba.axis_comp.fifo_async.Axi4SFifoAsync
- __annotations__ = {}¶
hwtLib.amba.axi_comp.builder module¶
- class hwtLib.amba.axi_comp.builder.AxiBuilder(parent: HwModule, srcInterface: HwIO | HObjList, name: str | None = None, master_to_slave: bool = True)[source]¶
Bases:
AbstractComponentBuilderHelper class wich simplifies instantiation and configuration of common components for Axi interfaces
- BuffCdcCls¶
alias of
AxiBuffCdc
- __annotations__ = {}¶
- _genericInstance(hwModuleCls, name: str, set_params_fn: Callable[[HwModule], None] = None, update_params=True, propagate_clk_rst=True)[source]¶
Instantiate generic component and connect basics
- Parameters:
hwModuleCls – class of unit which is being created
name – name for hwModuleCls instance
set_params_fn – function which updates parameters as is required (parameters are already shared with self.end interface)
- buff(addr_items=1, data_items=1)[source]¶
Use registers and FIFOs to create buffer of specified paramters
- Parameters:
items – number of items in buffer
hwtLib.amba.axi_comp.resize module¶
- class hwtLib.amba.axi_comp.resize.AxiResize(hwIOCls, hdlName: str | None = None)[source]¶
Bases:
BusBridgeChange DATA_WIDTH of axi interface
- HDL params:
HWIO_CLS - default value <class ‘hwtLib.amba.axi4Lite.Axi4Lite’> of type type
ADDR_WIDTH - default value 32 of type int
DATA_WIDTH - default value 32 of type int
OUT_DATA_WIDTH - default value 512 of type int
OUT_ADDR_WIDTH - default value 32 of type int
MAX_TRANS_OVERLAP - default value 4 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
s - of type hwtLib.amba.axi4Lite.Axi4Lite - SLAVE
m - of type hwtLib.amba.axi4Lite.Axi4Lite - MASTER
- HDL components:
gen_aw_reg_0 - of type hwtLib.amba.axis_comp.reg.Axi4SReg
aw_align_fifo - of type hwtLib.handshaked.fifo.HandshakedFifo
gen_ar_reg_0 - of type hwtLib.amba.axis_comp.reg.Axi4SReg
ar_align_fifo - of type hwtLib.handshaked.fifo.HandshakedFifo
- __annotations__ = {}¶
hwtLib.amba.axi_comp.slave_timeout module¶
- class hwtLib.amba.axi_comp.slave_timeout.Axi4SlaveTimeout(hwIOCls, hdlName: str | None = None)[source]¶
Bases:
BusBridgeComponent witch has internal timeout for r/b channel and responds with the error code if the slave does not respond in specified time
- HDL params:
TIMEOUT - default value 4096 of type int
ADDR_WIDTH - default value 32 of type int
DATA_WIDTH - default value 64 of type int
ID_WIDTH - default value 6 of type int
ADDR_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
s - of type hwtLib.amba.axi4.Axi4 - SLAVE
m - of type hwtLib.amba.axi4.Axi4 - MASTER
- __annotations__ = {}¶
hwtLib.amba.axi_comp.static_remap module¶
- class hwtLib.amba.axi_comp.static_remap.Axi4StaticRemap(hwIOCls=<class 'hwtLib.amba.axi4.Axi4'>, hdlName: str | None = None)[source]¶
Bases:
BusStaticRemapBusStaticRemapimplementation for AXI3/4 full/lite interfaces :note: this component only remaps some memory regions, but it does not perform the address checking- HDL params:
HWIO_CLS - default value <class ‘hwtLib.amba.axi4.Axi4’> of type type
MEM_MAP - default value [(0, 4096, 4096), (4096, 4096, 0)] of type list
ADDR_WIDTH - default value 32 of type int
DATA_WIDTH - default value 64 of type int
ID_WIDTH - default value 6 of type int
ADDR_USER_WIDTH - default value 0 of type int
- HDL IO:
m - of type hwtLib.amba.axi4.Axi4 - MASTER
s - of type hwtLib.amba.axi4.Axi4 - SLAVE
- __annotations__ = {}¶
hwtLib.amba.axi_comp.stream_to_mem module¶
- class hwtLib.amba.axi_comp.stream_to_mem.Axi4streamToMem(hdlName: str | None = None)[source]¶
Bases:
HwModuleMost simple DMA for AXI4 interface.
- 0x0 control reg.
bit 0, rw - on/off (1 means on)
bit 1, r - idle (1 if no transaction in progress)
0x4 baseAddr
Length of written data is specified by DATA_LEN. Input data is splited on smaller frames to fit MAX_BUTST_LEN.
If there is transaction pending idle flag is 0, if on/off is set to 0 in this state unit continues until all data are send and then stays off. This could be use as synchronization with the software.
driver enables this unit, then tests while not idle.
then waits while idle.
then reads the data and back to 1
or unit is enabled and driver disables it only for the time of reading.
- HDL params:
ADDR_WIDTH - default value 32 of type int
DATA_WIDTH - default value 32 of type int
CNTRL_AW - default value 5 of type int
DATA_LEN - default value 33 of type int
MAX_BUTST_LEN - default value 16 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
axi - of type hwtLib.amba.axi4.Axi4 - MASTER
dataIn - of type hwt.hwIOs.std.HwIODataRdVld - SLAVE
cntrlBus - of type hwtLib.amba.axi4Lite.Axi4Lite - SLAVE
- HDL components:
regsConventor - of type hwtLib.amba.axiLite_comp.endpoint.AxiLiteEndpoint
- __annotations__ = {}¶
hwtLib.amba.axi_comp.tester module¶
- class hwtLib.amba.axi_comp.tester.AxiTester(axiCls=<class 'hwtLib.amba.axi4.Axi4'>, cntrlCls=<class 'hwtLib.amba.axi4Lite.Axi4Lite'>, hdlName: str | None = None)[source]¶
Bases:
HwModuleTester for AXI3/4 interfaces
Can precisely control order and timing of read address/write address/read/write/write response transactions Allows to read and specify values of controls signals like cache/lock/burst etc…
- HDL params:
ADDR_WIDTH - default value 32 of type int
DATA_WIDTH - default value 64 of type int
ID_WIDTH - default value 6 of type int
ADDR_USER_WIDTH - default value 0 of type int
CNTRL_DATA_WIDTH - default value 32 of type int
CNTRL_ADDR_WIDTH - default value 32 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
m_axi - of type hwtLib.amba.axi4.Axi4 - MASTER
cntrl - of type hwtLib.amba.axi4Lite.Axi4Lite - SLAVE
- HDL components:
axi_ep - of type hwtLib.amba.axiLite_comp.endpoint.AxiLiteEndpoint
- __annotations__ = {}¶
hwtLib.amba.axi_comp.to_axiLite module¶
- class hwtLib.amba.axi_comp.to_axiLite.Axi_to_AxiLite(hwIOCls=<class 'hwtLib.amba.axi4.Axi4'>, hdlName: str | None = None)[source]¶
Bases:
BusBridgeAXI3/4 -> Axi4Lite bridge
- Variables:
~.MAX_TRANS_OVERLAP – depth of internal FIFO which is used to allow the transactions to overlap each other in order to pipeline the execution of transactions
- HDL params:
ADDR_WIDTH - default value 32 of type int
DATA_WIDTH - default value 64 of type int
ID_WIDTH - default value 6 of type int
ADDR_USER_WIDTH - default value 0 of type int
MAX_TRANS_OVERLAP - default value 4 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
s - of type hwtLib.amba.axi4.Axi4 - SLAVE
m - of type hwtLib.amba.axi4Lite.Axi4Lite - MASTER
- HDL components:
r_req_fifo - of type hwtLib.handshaked.fifo.HandshakedFifo
w_req_fifo - of type hwtLib.handshaked.fifo.HandshakedFifo
out_reg - of type hwtLib.amba.axi_comp.buff.AxiBuff
in_reg - of type hwtLib.amba.axi_comp.buff.AxiBuff
- __annotations__ = {}¶
- gen_addr_logic(addr_ch_in: Axi4_addr, addr_ch_out: Axi4Lite_addr, req_fifo_inp: HandshakedIdAndLen)[source]¶
Instanciate logic which splits the transactions to a beats on AxiLite interface and propagate informations about the transacttions to req_fifo_inp for later use
- class hwtLib.amba.axi_comp.to_axiLite.HandshakedIdAndLen(masterDir=DIRECTION.OUT, hdlName: str | dict[str, str] | None = None, loadConfig=True)[source]¶
Bases:
HwIORdVldSync- HDL params:
ID_WIDTH - default value 4 of type int
LEN_WIDTH - default value 8 of type int
- HDL IO:
id - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 4bits> - UNKNOWN
len - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 8bits> - UNKNOWN
vld - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - UNKNOWN
rd - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - UNKNOWN (Master=IN)
- __annotations__ = {}¶
hwtLib.amba.axi_comp.virtualDma module¶
- class hwtLib.amba.axi_comp.virtualDma.AxiVirtualDma(axi: Axi3 | Axi3Lite | Axi4 | Axi4Lite, alignas: int = 8, max_trans_overlap=16)[source]¶
Bases:
AbstractComponentBuilderAn object which can be used to generate read/write logic for AMBA AXI interfaces. It does these things:
Based on alignment of the data and data type it optimizes shift logic for alignment
If transaction can spawn over multiple AXI transactions it also generates the logic for dispatching and merging of such a transactions.
It propagates read/write/aligmnent and input errors as a hwt InHwExceptions
- Variables:
alignas – specifies alignment requirement for a data type t (in bits), same functionality as C++11 alignas specifier, used to discard alignment logic
- __annotations__ = {}¶
- __init__(axi: Axi3 | Axi3Lite | Axi4 | Axi4Lite, alignas: int = 8, max_trans_overlap=16)[source]¶
- Parameters:
axi – AMBA AXI bus used to read the data
- build()[source]¶
Build an DMA logic from previously stacked reads/writes
- Note:
placeholder for future use
- read(t: HdlType, tmpl: TransTmpl | None = None, frames: List[FrameTmpl] | None = None, transaction_id=0) HwIOUnionSource | HwIOStruct | HwIODataRdVld[source]¶
- Parameters:
~.t – instance of HStruct which specifies data format to download
~.tmpl – instance of TransTmpl for this t
~.frames – list of FrameTmpl instances for this tmpl
~.transaction_id – id value for axi
- Note:
if tmpl and frames are None they are resolved from structT parseTemplate
- Note:
A single transaction can be split to multiple frames, if they are specified by “frames”.