hwtLib.structManipulators package

Submodules

hwtLib.structManipulators.arrayBuff_writer module

class hwtLib.structManipulators.arrayBuff_writer.ArrayBuff_writer(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

Write data in to a circula buffer allocated as an array. Collect items and send them over wDatapump when buffer is full or on timeout Maximum overlap of transactions is 1

items -> buff -> internal logic -> axi datapump

HDL params
  • ID_WIDTH - default value 4 of type int

  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

  • MAX_LEN - default value 15 of type int

  • USE_STRB - default value True of type bool

  • ID - default value 3 of type int

  • ITEM_WIDTH - default value 16 of type int

  • BUFF_DEPTH - default value 16 of type int

  • TIMEOUT - default value 1024 of type int

  • ITEMS - default value 512 of type int

HDL IO
HDL components
schematic
uploadedCntrHandler(st, reqAckHasCome, sizeOfitems)[source]

hwtLib.structManipulators.arrayItemGetter module

class hwtLib.structManipulators.arrayItemGetter.ArrayItemGetter(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

Get specific item from array by index

HDL params
  • ITEMS - default value 32 of type int

  • ITEM_WIDTH - default value 32 of type int

  • ID - default value 0 of type int

  • ID_WIDTH - default value 4 of type int

  • DATA_WIDTH - default value 64 of type int

  • ADDR_WIDTH - default value 32 of type int

  • MAX_TRANS_OVERLAP - default value 16 of type int

HDL IO
HDL components
schematic

hwtLib.structManipulators.cLinkedListReader module

class hwtLib.structManipulators.cLinkedListReader.CLinkedListReader(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

This unit reads items from (circular) linked list like structure

struct node {
    item_t items[ITEMS_IN_BLOCK],
    struct node * next;
};

synchronization is obtained by rdPtr/wrPtr (tail/head) pointer baseAddr is address of actual node

HDL params
  • ID_WIDTH - default value 4 of type int

  • ID - default value 3 of type int

  • ID_LAST - default value 4 of type int

  • BUFFER_CAPACITY - default value 32 of type int

  • ITEMS_IN_BLOCK - default value 511 of type int

  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

  • PTR_WIDTH - default value 16 of type int

HDL IO
HDL components
schematic
addrAlignBits()[source]

hwtLib.structManipulators.cLinkedListWriter module

class hwtLib.structManipulators.cLinkedListWriter.CLinkedListWriter(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

This unit writes items to (circular) linked list like structure (List does not necessary need to be circular but space is specified by two pointers like in circular queue)

struct node {
    item_t items[ITEMS_IN_BLOCK],
    struct node * next;
};

synchronization is obtained by rdPtr/wrPtr (tail/head) pointer baseAddr is address of actual node

HDL params
  • ID_WIDTH - default value 4 of type int

  • ID - default value 3 of type int

  • BUFFER_CAPACITY - default value 32 of type int

  • ITEMS_IN_BLOCK - default value 511 of type int

  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

  • PTR_WIDTH - default value 16 of type int

  • TIMEOUT - default value 4096 of type int

HDL IO
HDL components
schematic
addrToIndex(addr)[source]
baseAddrLogic(nextBlockTransition_in)[source]

Logic for downloading address of next block

Parameters

nextBlockTransition_in – signal which means that baseIndex should be changed to nextBaseIndex if nextBaseAddrReady is not high this signal has no effect (= regular handshake)

Returns

(baseIndex, nextBaseIndex, nextBaseReady is ready and nextBlockTransition_in can be used)

indexToAddr(indx)[source]
itemUploadLogic(baseIndex, nextBaseIndex, nextBaseReady, nextBlockTransition_out)[source]
mvDataToW(prepareEn, dataMoveEn, reqLen, inBlockRemain, nextBlockTransition_out, dataCntr_out)[source]
queuePtrLogic(wrPtrIncrVal, wrPtrIncrEn)[source]
rReqHandler(baseIndex, doReq)[source]
timeoutHandler(rst, incr)[source]
wReqDriver(en, baseIndex, lenByPtrs, inBlockRemain)[source]

hwtLib.structManipulators.mmu_2pageLvl module

class hwtLib.structManipulators.mmu_2pageLvl.MMU_2pageLvl(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

MMU where parent page table is stored in ram this unit and only items from leaf page tables are download on each request over rDatapump interface

HDL params
  • ID_WIDTH - default value 1 of type int

  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

  • VIRT_ADDR_WIDTH - default value 32 of type int

  • LVL1_PAGE_TABLE_ITEMS - default value 512 of type int

  • PAGE_SIZE - default value 4096 of type int

  • MAX_OVERLAP - default value 16 of type int

HDL IO
HDL components
schematic
connectL1Load(lvl1readAddr)[source]
connectL2Load(lvl2base, segfaultFlag)[source]
connectLvl1PageTable()[source]
connectPhyout(segfaultFlag)[source]
segfaultChecker()[source]

hwtLib.structManipulators.structReader module

class hwtLib.structManipulators.structReader.StructReader(structT, tmpl=None, frames=None)[source]

Bases: AxiS_frameParser

This unit downloads required structure fields over rDatapump interface from address specified by get interface

Variables
  • ~.ID – Param, id for transactions on bus

  • ~.READ_ACK – Param, if true ready on “get” will be set only when component is in idle (if false “get” is regular handshaked interface)

  • ~.SHARED_READY – Param, if this is true field interfaces will be of type VldSynced and single ready signal will be used for all else every interface will be instance of Handshaked and it will have it’s own ready(rd) signal

_images/StructReader.png
HDL params
  • ID - default value 0 of type int

  • ID_WIDTH - default value 0 of type int

  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

  • MAX_BYTES - default value 4096 of type int

  • USE_STRB - default value False of type bool

  • READ_ACK - default value False of type bool

  • SHARED_READY - default value False of type bool

HDL IO
  • clk - of type hwt.interfaces.std.Clk with dtype=<Bits, 1bit> - SLAVE

  • rst_n - of type hwt.interfaces.std.Rst_n with dtype=<Bits, 1bit> - SLAVE

  • dataOut - of type hwt.interfaces.structIntf.StructIntf with dtype=struct { <Bits, 64bits, unsigned> item0 //<Bits, 64bits, unsigned> empty space <Bits, 64bits, unsigned> item1 //<Bits, 64bits, unsigned> empty space <Bits, 16bits, unsigned> item2 <Bits, 16bits, unsigned> item3 <Bits, 32bits, unsigned> item4 //<Bits, 32bits, unsigned> empty space <Bits, 64bits, unsigned> item5 //<Bits, 32bits, unsigned> empty space //<Bits, 64bits, unsigned> empty space //<Bits, 64bits, unsigned> empty space //<Bits, 64bits, unsigned> empty space <Bits, 64bits, unsigned> item6 <Bits, 64bits, unsigned> item7 } - MASTER

  • get - of type hwt.interfaces.std.Handshaked - SLAVE

  • rDatapump - of type hwtLib.amba.datapump.intf.AxiRDatapumpIntf - MASTER

HDL components
schematic
__init__(structT, tmpl=None, frames=None)[source]
Parameters
  • 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

interfaces for each field in struct will be dynamically created

Attention

structT can not contain fields with variable size like HStream

driveReqRem(req: AddrSizeHs, MAX_BITS: int)[source]
maxBytesInTransaction()[source]
maxWordIndex()[source]
parseTemplate()[source]

Load the configuration from the parameters

hwtLib.structManipulators.structReader._example_StructReader()[source]

hwtLib.structManipulators.structWriter module

class hwtLib.structManipulators.structWriter.StructWriter(structT, tmpl=None, frames=None)[source]

Bases: StructReader

Write struct specified in constructor over wDatapump interface on address specified over set interface

Variables
  • ~.MAX_OVERLAP – parameter which specifies the maximum number of concurrent transaction

  • ~.WRITE_ACK – Param, if true ready on “set” will be set only when component is in idle (if false “set” is regular handshaked interface)

_images/StructWriter.png
HDL params
  • ID - default value 0 of type int

  • ID_WIDTH - default value 0 of type int

  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

  • MAX_BYTES - default value 4096 of type int

  • USE_STRB - default value False of type bool

  • READ_ACK - default value False of type bool

  • SHARED_READY - default value False of type bool

  • MAX_OVERLAP - default value 2 of type int

  • WRITE_ACK - default value False of type bool

HDL IO
  • clk - of type hwt.interfaces.std.Clk with dtype=<Bits, 1bit> - SLAVE

  • rst_n - of type hwt.interfaces.std.Rst_n with dtype=<Bits, 1bit> - SLAVE

  • dataIn - of type hwt.interfaces.structIntf.StructIntf with dtype=struct { <Bits, 64bits, unsigned> item0 //<Bits, 64bits, unsigned> empty space <Bits, 64bits, unsigned> item1 //<Bits, 64bits, unsigned> empty space <Bits, 16bits, unsigned> item2 <Bits, 16bits, unsigned> item3 <Bits, 32bits, unsigned> item4 //<Bits, 32bits, unsigned> empty space <Bits, 64bits, unsigned> item5 //<Bits, 32bits, unsigned> empty space //<Bits, 64bits, unsigned> empty space //<Bits, 64bits, unsigned> empty space //<Bits, 64bits, unsigned> empty space <Bits, 64bits, unsigned> item6 <Bits, 64bits, unsigned> item7 } - SLAVE

  • set - of type hwt.interfaces.std.Handshaked - SLAVE

  • writeAck - of type hwt.interfaces.std.HandshakeSync - MASTER

  • wDatapump - of type hwtLib.amba.datapump.intf.AxiWDatapumpIntf - MASTER

HDL components
schematic
_createInterfaceForField(parent, structField)[source]
hwtLib.structManipulators.structWriter._example_StructWriter()[source]