hwtLib.structManipulators package

Submodules

hwtLib.structManipulators.arrayBuff_writer module

class hwtLib.structManipulators.arrayBuff_writer.ArrayBuff_writer[source]

Bases: hwt.synthesizer.unit.Unit

Collect items and send them over wDatapump when buffer is full or on timeout Cyclically writes items into array over wDatapump Maximum overlap of transactions is 1

[TODO] better fit of items on bus [TODO] fully pipeline

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

_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
static _serializeDecision(parentUnit, obj, isDeclaration, 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)
getControlInterfaces()[source]
uploadedCntrHandler(st, reqAckHasCome, sizeOfitems)[source]

hwtLib.structManipulators.arrayItemGetter module

class hwtLib.structManipulators.arrayItemGetter.ArrayItemGetter[source]

Bases: hwt.synthesizer.unit.Unit

Get specific item from array by index

_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.structManipulators.cLinkedListReader module

class hwtLib.structManipulators.cLinkedListReader.CLinkedListReader[source]

Bases: hwt.synthesizer.unit.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

Attention:device reads only chunks of size <= BUFFER_CAPACITY/2,
_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
addrAlignBits()[source]
getControlInterfaces()[source]

hwtLib.structManipulators.cLinkedListWriter module

class hwtLib.structManipulators.cLinkedListWriter.CLinkedListWriter[source]

Bases: hwt.synthesizer.unit.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

Attention:device writes chunks of max size <= BUFFER_CAPACITY/2
Attention:next addr is downloaded on background when items are uploaded (= has to be set when this unit enters this block)
Note:wrPtr == rdPtr => queue is empty and there is (2^PTR_WIDTH) - 1 of empty space wrPtr == rdPtr+1 => queue is full wrPtr+1 == rdPtr => there is (2^PTR_WIDTH) - 2 of empty space spaceToWrite = rdPtr - wrPtr - 1 (with uint16_t)
_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
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[source]

Bases: hwt.synthesizer.unit.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

Attention:if item in pagetable is BAD_PHYS_ADDR output signal segfault becomes 1 and unit will stop working
Attention:rootPageTable has to be initialized before first request over virtIn interface
Attention:rootPageTable has write only access
Attention:use value -1 to mark that page is not mapped, it will result in segfault signal asserted high when this address is accessed
_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
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: hwtLib.amba.axis_comp.frameParser.AxiS_frameParser

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

Variables:
  • MAX_DUMMY_WORDS – Param, specifies maximum dummy bus words between fields if there is more of ignored space transaction will be split to
  • 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
Attention:

interfaces of field will not send data in same time

_images/aafig-cff02fc2e65638ccf41af718870c17bf4c20b9be.gif
Note:names in the picture are just illustrative
__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

_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
maxWordIndex()[source]
parseTemplate()[source]

hwtLib.structManipulators.structWriter module

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

Bases: hwtLib.structManipulators.structReader.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/aafig-17f3844bd71ce20dbf133aed1cb6ea36c4f26304.gif
Note:names in the picture are just illustrative
_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
_createInterfaceForField(parent, structField)[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 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

Module contents