Welcome to hwtLib’s generated documentation!
This documentation is automatically generated from source code on every push into master which pass testing.
hwtLib is package of hardware components (like vhld/verilog library) for HWToolkit (hwt python3 module) it
also contains most used helpers and types like uint64_t, UDP header etc.
Library is structuralized mostly by main interface of component.
Interfaces of components are usually not shown in documentation directly
instead they are declared in _declr() method of unit and they can be seen in sourcecode same for parameters in _config().
You can also download this doc in PDF.
hwtLib package
Subpackages
hwtLib.abstract package
Submodules
hwtLib.abstract.busEndpoint module
-
class
hwtLib.abstract.busEndpoint.
BusEndpoint
(structTemplate, intfCls=None, shouldEnterFn=None)[source]
Bases: hwt.synthesizer.unit.Unit
Abstract unit
Delegate request from bus to fields of structure
(fields are represented by various interfaces)
write has higher priority
-
__init__
(structTemplate, intfCls=None, shouldEnterFn=None)[source]
Parameters: |
- structTemplate – instance of HStruct which describes
address space of this endpoint
- intfCls – class of bus interface which should be used
- shouldEnterFn – function(structField) return (shouldEnter, shouldUse)
where shouldEnter is flag that means iterator over this interface
should look inside of this actual object
and shouldUse flag means that this field should be used
(to create interface)
|
-
_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
-
static
_defaultShouldEnterFn
(field)[source]
-
_getAddrStep
()[source]
-
_getMaxAddr
()[source]
”
Get maximum address value for this endpoint
-
_getMinAddr
()[source]
”
Get minimum address value for this endpoint
-
_getWordAddrStep
()[source]
-
_mkFieldInterface
(structIntf, field)[source]
Instantiate field interface for fields in structure template of this endpoint
Returns: | interface for specified field |
-
_parseTemplate
()[source]
-
_shouldEnterForTransTmpl
(tmpl)[source]
-
static
_shouldEnterIntf
(intf)[source]
Returns: | tuple (shouldEnter, shouldYield) |
-
_suggestedAddrWidth
()[source]
Based on strut template resolve how many bits for
address is needed
-
connectByInterfaceMap
(interfaceMap)[source]
Connect “decoded” struct interface to interfaces specified
in iterface map
Parameters: | interfaceMap – list of interfaces
or tuple (type or interface, name) |
-
classmethod
fromInterfaceMap
(interfaceMap)[source]
Generate converter by specified struct
Parameters: | interfaceMap – take a look at HTypeFromIntfMap
if interface is specified it will be automatically connected |
-
getPort
(transTmpl)[source]
-
isInMyAddrRange
(addrSig)[source]
-
propagateAddr
(srcAddrSig: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, srcAddrStep: int, dstAddrSig: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, dstAddrStep: int, transTmpl: hwt.hdl.transTmpl.TransTmpl)[source]
Parameters: |
- srcAddrSig – input signal with address
- srcAddrStep – how many bits is addressing one unit of srcAddrSig
- dstAddrSig – output signal for address
- dstAddrStep – how many bits is addressing one unit of dstAddrSig
- transTmpl – TransTmpl which has meta-informations
about this address space transition
|
-
walkFieldsAndIntf
(transTmpl, structIntf)[source]
-
hwtLib.abstract.busEndpoint.
inRange
(n, lower, end)[source]
-
hwtLib.abstract.busEndpoint.
isPaddingInIntfMap
(item)[source]
-
hwtLib.abstract.busEndpoint.
walkStructIntfAndIntfMap
(structIntf, intfMap)[source]
hwtLib.abstract.denseMemory module
-
exception
hwtLib.abstract.denseMemory.
AllocationError
[source]
Bases: Exception
Exception which says that requested allocation can not be performed
-
class
hwtLib.abstract.denseMemory.
DenseMemory
(cellWidth, clk, rDatapumpIntf=None, wDatapumpIntf=None, parent=None)[source]
Bases: object
Dense memory for simulation purposes with datapump interfaces
Variables: | data – memory dict |
-
__init__
(cellWidth, clk, rDatapumpIntf=None, wDatapumpIntf=None, parent=None)[source]
Parameters: |
- cellWidth – width of items in memmory
- clk – clk signal for synchronization
- parent – parent instance of DenseMemory (memory will be shared with this instance)
|
-
_getStruct
(offset, transTmpl)[source]
Parameters: |
- offset – global offset of this transTmpl (and struct)
- transTmpl – instance of TransTmpl which specifies items in struct
|
-
_registerOnClock
(clk)[source]
-
calloc
(num, size, keepOut=None, initValues=None)[source]
Allocates a block of memory for an array of num elements, each of them
size bytes long, and initializes all its bits to zero.
Parameters: |
- num – Number of elements to allocate.
- size – Size of each element.
- keepOut – optional memory spacing between this memory region and lastly allocated
- initValues – iterable of word values to init memory with
|
Returns: | address of allocated memory
|
-
checkRequests
(simulator, _)[source]
Check if any request has appeared on interfaces
-
doRead
()[source]
-
doWrite
()[source]
-
doWriteAck
(_id)[source]
-
getArray
(addr, itemSize, itemCnt)[source]
Get array stored in memory
-
getBits
(start, end)[source]
Gets value of bits between selected range from memory
Parameters: |
- start – bit address of start of bit of bits
- end – bit address of first bit behind bits
|
Returns: | instance of BitsVal (derived from SimBits type) which contains copy of selected bits
|
-
getStruct
(addr, structT, bitAddr=None)[source]
Get HStruct from memory
Parameters: |
- addr – address where get struct from
- structT – instance of HStruct or FrameTmpl generated from it to resove structure of data
- bitAddr – optional bit precisse address is is not None param addr has to be None
|
-
malloc
(size, keepOut=None)[source]
Allocates a block of memory of size and initialize it with None (invalid value)
Parameters: |
- size – Size of each element.
- keepOut – optional memory spacing between this memory region and lastly allocated
|
Returns: | address of allocated memory
|
-
onReadReq
()[source]
-
onWriteReq
()[source]
-
parseReq
(req)[source]
-
hwtLib.abstract.denseMemory.
reshapedInitItems
(actualCellSize, requestedCellSize, values)[source]
Convert array item size and items cnt while size of array remains unchanged
Parameters: |
- actualCellSize – actual size of item in array
- requestedCellSize – requested size of item in array
- values – input array
|
Returns: | generator of new items of specified characteristik
|
hwtLib.abstract.discoverAddressSpace module
-
class
hwtLib.abstract.discoverAddressSpace.
AddressSpaceProbe
(topIntf, getMainSigFn, offset=0)[source]
Bases: object
-
__init__
(topIntf, getMainSigFn, offset=0)[source]
Parameters: |
- topIntf – interface on which should discovery start
- getMainSigFn – function which gets the main signal
form interface which should this code care about
usually address
|
-
_discoverAddressSpace
(topIntf, offset)[source]
-
walkToConverter
(mainSig)[source]
walk mainSig down to endpoints and search for any bus converter
instance
-
hwtLib.abstract.discoverAddressSpace.
getEpSignal
(sig, op)[source]
Parameters: |
- sig – main signal
- op – operator on this signal
|
Returns: | signal modified by this operator or none if this operator
is creating new datapath
|
-
hwtLib.abstract.discoverAddressSpace.
getParentUnit
(sig)[source]
hwtLib.abstract.streamBuilder module
-
class
hwtLib.abstract.streamBuilder.
AbstractStreamBuilder
(parent, srcInterface, name=None)[source]
Bases: object
Attention: | this is just abstract class unit classes has to be specified
in concrete implementation
|
Variables: |
|
Attention: | input port is taken from self.end
|
-
FifoCls
= NotImplemented
-
JoinFairCls
= NotImplemented
-
JoinPrioritizedCls
= NotImplemented
-
JoinSelectCls
= NotImplemented
-
RegCls
= NotImplemented
-
ResizerCls
= NotImplemented
-
SplitCopyCls
= NotImplemented
-
SplitFairCls
= NotImplemented
-
SplitPrioritizedCls
= NotImplemented
-
SplitSelectCls
= NotImplemented
-
__init__
(parent, srcInterface, name=None)[source]
Parameters: |
- parent – unit in which will be all units created by this builder instantiated
- name – prefix for all instantiated units
- srcInterface – start of data-path
|
-
_findSuitableName
(unitName)[source]
find suitable name for component (= name without collisions)
-
_genericInstance
(unitCls, unitName, setParams=<function AbstractStreamBuilder.<lambda>>)[source]
Instantiate generic component and connect basics
Parameters: |
- unitCls – class of unit which is being created
- unitName – name for unitCls
- setParams – function which updates parameters as is required
(parameters are already shared with self.end interface)
|
-
_getIntfCls
(intf)[source]
Get real interface class of interface
-
classmethod
_join
(joinCls, parent, srcInterfaces, name, configAs, extraConfigFn)[source]
Create builder from many interfaces by joining them together
Parameters: |
- joinCls – join component class which should be used
- parent – unit where builder should place components
- srcInterfacecs – sequence of interfaces which should be joined together (lower index = higher priority)
- configureAs – interface or another object which configuration should be applied
- extraConfigFn – function which is applied on join unit in configuration phase (can be None)
|
-
_propagateClkRstn
(u)[source]
Connect clock and reset to unit “u”
-
buff
(items=1, latency=None, delay=None)[source]
Use registers and fifos to create buffer of specified paramters
:note: if items <= latency registers are used else fifo is used
Parameters: |
- items – number of items in buffer
- latency – latency of buffer (number of clk ticks required to get data
from input to input)
- delay – delay of buffer (number of clk ticks required to get data to buffer)
|
Note: | delay can be used as synchronization method or to solve timing related problems
because it will split valid signal path
|
Note: | if latency or delay is None the most optimal value is used
|
-
getClk
()[source]
lookup clock signal on parent
-
getInfCls
()[source]
Get class of interface which this builder is currently using.
-
getRstn
()[source]
lookup reset(n) signal on parent
-
classmethod
join_fair
(parent, srcInterfaces, name=None, configAs=None, exportSelected=False)[source]
create builder from fairly joined interfaces (round robin for input select)
Parameters: | exportSelected – if True join component will have handshaked interface
with index of selected input |
Note: | other parameters same as in .AbstractStreamBuilder.join_fair |
-
split_copy
(noOfOutputs)[source]
Clone input data to all outputs
Parameters: | noOfOutputs – number of output interfaces of the split |
-
split_copy_to
(*outputs)[source]
Same like split_copy, but outputs are automatically connected
Parameters: | outputs – ports on which should be outputs of split component connected to |
-
split_fair
(noOfOutputs, exportSelected=False)[source]
Create a rund robin selector with number of outputs specified by noOfOutputs
Parameters: |
- noOfOutputs – number of outputs of multiplexer
- exportSelected – if is True split component will have interface “selectedOneHot”
of type VldSynced wich will have one hot index of selected item
|
-
split_fair_to
(*outputs, exportSelected=False)[source]
Same like split_fair, but outputs are automatically connected
Parameters: |
- outputs – ports on which should be outputs of split component connected to
- exportSelected – if is True split component will have interface “selectedOneHot”
of type VldSynced wich will have one hot index of selected item
|
-
split_prioritized
(noOfOutputs)[source]
data from input is send to output witch is ready and has highest priority from all ready outputs
Parameters: | noOfOutputs – number of output interfaces of the fork |
-
split_prioritized_to
(*outputs)[source]
Same like split_prioritized, but outputs are automatically connected
Parameters: | outputs – ports on which should be outputs of split component connected to |
-
split_select
(outputSelSignalOrSequence, noOfOutputs)[source]
Create a demultiplexer with number of outputs specified by noOfOutputs
Parameters: |
- noOfOutputs – number of outputs of multiplexer
- outputSelSignalOrSequence – handshaked interface (onehot encoded)
to control selected output or sequence of output indexes
which should be used (will be repeated)
|
-
split_select_to
(outputSelSignalOrSequence, *outputs)[source]
Same like split_select, but outputs are automatically connected
Parameters: | outputs – ports on which should be outputs of split component connected to |
Module contents
hwtLib.amba package
Subpackages
hwtLib.amba.axiLite_comp package
Submodules
hwtLib.amba.axiLite_comp.endpoint module
-
class
hwtLib.amba.axiLite_comp.endpoint.
AxiLiteEndpoint
(structTemplate, intfCls=<class 'hwtLib.amba.axi4Lite.Axi4Lite'>, shouldEnterFn=None)[source]
Bases: hwtLib.abstract.busEndpoint.BusEndpoint
Delegate request from AxiLite interface to fields of structure
write has higher priority
-
__init__
(structTemplate, intfCls=<class 'hwtLib.amba.axi4Lite.Axi4Lite'>, shouldEnterFn=None)[source]
Parameters: |
- structTemplate – instance of HStruct which describes
address space of this endpoint
- intfCls – class of bus interface which should be used
- shouldEnterFn – function(structField) return (shouldEnter, shouldUse)
where shouldEnter is flag that means iterator over this interface
should look inside of this actual object
and shouldUse flag means that this field should be used
(to create interface)
|
-
_getAddrStep
()
Returns: | how many bits is one unit of address (f.e. 8 bits for char * pointer,
36 for 36 bit bram) |
-
_getWordAddrStep
()
Returns: | size of one word in unit of address |
-
_impl
()[source]
implementations
- implement functionality of design there
- called after _declr
-
readPart
(awAddr, w_hs)[source]
-
writePart
()[source]
-
writeRespPart
(wAddr, respVld)[source]
hwtLib.amba.axiLite_comp.reg module
-
class
hwtLib.amba.axiLite_comp.reg.
AxiLiteReg
(axiCls=<class 'hwtLib.amba.axi4Lite.Axi4Lite'>)[source]
Bases: hwt.synthesizer.unit.Unit
Register for AXI3/4/lite interface
-
__init__
(axiCls=<class 'hwtLib.amba.axi4Lite.Axi4Lite'>)[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
Module contents
hwtLib.amba.axi_comp package
Submodules
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'>)[source]
Bases: hwt.synthesizer.unit.Unit
Tester 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…
-
__init__
(axiCls=<class 'hwtLib.amba.axi4.Axi4'>, cntrlCls=<class 'hwtLib.amba.axi4Lite.Axi4Lite'>)[source]
Initialize self. See help(type(self)) for accurate signature.
-
_add_ep
()[source]
-
_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.axi_comp.transCounter module
-
class
hwtLib.amba.axi_comp.transCounter.
AxiTransactionCouter
(axiCls=<class 'hwtLib.amba.axi4.Axi4'>)[source]
Bases: hwt.synthesizer.unit.Unit
Counter of beats on axi interface
write to control register to clear counters
-
__init__
(axiCls=<class 'hwtLib.amba.axi4.Axi4'>)[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
Module contents
hwtLib.amba.axis_comp package
Submodules
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.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 |
-
__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
-
class
hwtLib.amba.axis_comp.frameLinkConv.
AxiSToFrameLink
[source]
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
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.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 |
-
_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.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
hwtLib.amba.interconnect package
Submodules
hwtLib.amba.interconnect.axiInterconnectbase module
-
class
hwtLib.amba.interconnect.axiInterconnectbase.
AxiInterconnectBase
[source]
Bases: hwt.synthesizer.unit.Unit
-
configureFromDrivers
(drivers, datapump, byInterfaces=False)[source]
Check configuration of drivers and resolve MAX_LEN and aply it on datapump
and this interconnect
-
connectDrivers
(drivers, datapump)[source]
Connect drivers to datapump using this component
-
getDpIntf
(unit)[source]
-
reqHandler
(dpReq, orderFifoIn)[source]
-
hwtLib.amba.interconnect.axiInterconnectbase.
getSizeWidth
(maxLen, dataWidth)[source]
hwtLib.amba.interconnect.rStricOrder module
-
class
hwtLib.amba.interconnect.rStricOrder.
RStrictOrderInterconnect
[source]
Bases: hwtLib.amba.interconnect.axiInterconnectbase.AxiInterconnectBase
Strict order interconnect for AxiRDatapumpIntf
ensures that response on request is delivered to driver which asked for it while transactions can overlap
-
_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) |
-
getDpIntf
(unit)[source]
hwtLib.amba.interconnect.wStrictOrder module
-
class
hwtLib.amba.interconnect.wStrictOrder.
WStrictOrderInterconnect
[source]
Bases: hwtLib.amba.interconnect.axiInterconnectbase.AxiInterconnectBase
Strict order interconnect for AxiWDatapumpIntf
ensures that response on request is delivered to driver which asked for it while transactions can overlap
-
_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) |
-
ackHandler
()[source]
-
getDpIntf
(unit)[source]
-
wHandler
()[source]
Module contents
hwtLib.amba.sim package
Submodules
hwtLib.amba.sim.agentCommon module
-
class
hwtLib.amba.sim.agentCommon.
BaseAxiAgent
(intf)[source]
Bases: hwt.interfaces.agents.handshaked.HandshakedAgent
-
getRd
()[source]
get “ready” signal
-
getVld
()[source]
get “valid” signal
hwtLib.amba.sim.axi3DenseMem module
-
class
hwtLib.amba.sim.axi3DenseMem.
Axi3DenseMem
(clk, axi=None, axiAR=None, axiR=None, axiAW=None, axiW=None, axiB=None, parent=None)[source]
Bases: hwtLib.abstract.denseMemory.DenseMemory
Simulation memory for Axi3/4 interfaces (slave component)
-
__init__
(clk, axi=None, axiAR=None, axiR=None, axiAW=None, axiW=None, axiB=None, parent=None)[source]
Parameters: |
- clk – clk which should this memory use in simulation
- axi – axi (Axi3/4 master) interface to listen on
- axiR, axiAW, axiW, axiB (axiAR,) – splited interface use this
if you do not have full axi interface
- parent – parent instance of this memory, memory will operate
with same memory as parent one
|
Attention: | use axi or axi parts not bouth
|
Attention: | memories are commiting into memory in “data” property
after transaction is complete
|
-
doRead
()[source]
-
doWrite
()[source]
-
doWriteAck
(_id)[source]
-
parseReq
(req)[source]
hwtLib.amba.sim.axiMemSpaceMaster module
-
class
hwtLib.amba.sim.axiMemSpaceMaster.
AxiLiteMemSpaceMaster
(bus, registerMap)[source]
Bases: hwtLib.sim.abstractMemSpaceMaster.AbstractMemSpaceMaster
Controller of AxiLite simulation agent which keeps track of axi lite transactions
and aggregates them to proper register names on target bus
-
__init__
(bus, registerMap)[source]
Initialize self. See help(type(self)) for accurate signature.
-
_axi3lite_writeAddr
(addrChannel, addr, size)[source]
add address transaction to addr channel of agent
-
_axi4lite_writeAddr
(addrChannel, addr, size)[source]
add address transaction to addr channel of agent
-
_read
(addr, size, onDone=None)[source]
add read address transaction to agent
-
_write
(addr, size, data, mask, onDone=None)[source]
add write address and write data to agent
Parameters: | onDone – callback function(sim) -> None |
-
_writeData
(data, mask, onDone=None)[source]
add data write transaction to agent
Parameters: | onDone – callback function(sim) -> None |
-
class
hwtLib.amba.sim.axiMemSpaceMaster.
TupleWithCallback
[source]
Bases: tuple
Module contents
Submodules
hwtLib.amba.axi3 module
-
class
hwtLib.amba.axi3.
Axi3
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3Lite.Axi3Lite
Axi3 bus interface
-
LEN_WIDTH
= 4
-
LOCK_WIDTH
= 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
-
_getIpCoreIntfClass
()[source]
-
class
hwtLib.amba.axi3.
Axi3_addr
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3Lite.Axi3Lite_addr
, hwtLib.amba.axi_intf_common.Axi_id
Axi3 address channel interface
-
LEN_WIDTH
= 4
-
LOCK_WIDTH
= 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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi3.
Axi3_addrAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axi3.
Axi3_addr_withUser
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3.Axi3_addr
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi3.
Axi3_addr_withUserAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Simulation agent for Axi3_addr_withUser
interface
input/output data stored in list under “data” property
data contains tuples (id, addr, burst, cache, len, lock, prot, size, qos, user)
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axi3.
Axi3_b
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3Lite.Axi3Lite_b
, hwtLib.amba.axi_intf_common.Axi_id
Axi3 write response channel interface
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi3.
Axi3_bAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Simulation agent for Axi3_b
interface
input/output data stored in list under “data” property
data contains tuples (id, resp)
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axi3.
Axi3_r
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3Lite.Axi3Lite_r
, hwtLib.amba.axi_intf_common.Axi_id
Axi 3 read channel interface
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi3.
Axi3_rAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Simulation agent for Axi4_r
interface
input/output data stored in list under “data” property
data contains tuples (id, data, resp, last)
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axi3.
Axi3_w
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axis.AxiStream_withId
Axi3 write channel interface
-
class
hwtLib.amba.axi3.
Axi3_withAddrUser
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3.Axi3
Axi3 bus interface with user signals on address channels
-
_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
-
_getIpCoreIntfClass
()[source]
-
class
hwtLib.amba.axi3.
IP_Axi3
[source]
Bases: hwtLib.amba.axi3Lite.IP_Axi3Lite
IP core interface meta for Axi3 interface
-
__init__
()[source]
Initialize self. See help(type(self)) for accurate signature.
-
postProcess
(component, entity, allInterfaces, thisIf)[source]
-
class
hwtLib.amba.axi3.
IP_Axi3_withAddrUser
[source]
Bases: hwtLib.amba.axi3.IP_Axi3
IP core interface meta for Axi3_withAddrUser interface
-
__init__
()[source]
Initialize self. See help(type(self)) for accurate signature.
-
postProcess
(component, entity, allInterfaces, thisIf)[source]
hwtLib.amba.axi3Lite module
-
class
hwtLib.amba.axi3Lite.
Axi3Lite
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
-
_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
-
_getAddrStep
()[source]
Returns: | how many bits is one unit of address (f.e. 8 bits for char * pointer,
36 for 36 bit bram) |
-
_getIpCoreIntfClass
()[source]
-
_getWordAddrStep
()[source]
Returns: | size of one word in unit of address |
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi3Lite.
Axi3LiteAgent
(intf)[source]
Bases: hwt.simulator.agentBase.AgentBase
Composite simulation agent with agent for every axi channel
change of enable is propagated to each child
data for each agent is stored in agent for given channel (ar, aw, r, … property)
-
__init__
(intf)[source]
Initialize self. See help(type(self)) for accurate signature.
-
getDrivers
()[source]
Called before simulation to collect all drivers of interfaces
from this agent
-
getEnable
()[source]
-
getMonitors
()[source]
Called before simulation to collect all monitors of interfaces
from this agent
-
setEnable
(en, sim)[source]
-
class
hwtLib.amba.axi3Lite.
Axi3Lite_addr
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi_intf_common.Axi_hs
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi3Lite.
Axi3Lite_addrAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Variables: | data – iterable of addr |
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axi3Lite.
Axi3Lite_b
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi_intf_common.Axi_hs
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi3Lite.
Axi3Lite_bAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Variables: | data – iterable of resp |
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axi3Lite.
Axi3Lite_r
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi_intf_common.Axi_hs
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi3Lite.
Axi3Lite_w
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi_intf_common.Axi_hs
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi3Lite.
Axi3Lite_wAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Variables: | data – iterable of tuples (data, strb) |
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axi3Lite.
AxiLite_rAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Variables: | data – iterable of tuples (data, resp) |
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axi3Lite.
IP_Axi3Lite
[source]
Bases: hwt.serializer.ip_packager.interfaces.intfConfig.IntfConfig
-
__init__
()[source]
Initialize self. See help(type(self)) for accurate signature.
-
_toLowerCase
(d)[source]
-
asQuartusTcl
(buff: List[str], version: str, component, entity: hwt.hdl.entity.Entity, allInterfaces: List[hwt.synthesizer.interface.Interface], thisIf: hwt.synthesizer.interface.Interface)[source]
Add interface to Quartus tcl
Parameters: |
- buff – line buffer for output
- version – Quartus version
- intfName – name of top interface
- component – component object from ipcore generator
- entity – Entity instance of top unit
- allInterfaces – list of all interfaces of top unit
- thisIf – interface to add into Quartus TCL
|
-
get_quartus_map
()[source]
-
postProcess
(component, entity, allInterfaces, thisIf)[source]
hwtLib.amba.axi4 module
-
class
hwtLib.amba.axi4.
Axi4
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3.Axi3
Basic AMBA AXI4 bus interface
Variables: |
- ar – read address channel
- r – read data channel
- aw – write address channel
- w – write data channel
- b – write acknowledge channel
|
-
LEN_WIDTH
= 8
-
LOCK_WIDTH
= 1
-
_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
-
_getIpCoreIntfClass
()[source]
-
class
hwtLib.amba.axi4.
Axi4_addr
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3.Axi3_addr
Axi4 address channel interface
(axi3 address channel with different size of len and lock signals
and additional qos signal)
-
LEN_WIDTH
= 8
-
LOCK_WIDTH
= 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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi4.
Axi4_addrAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axi4.
Axi4_b
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3.Axi3_b
Axi4 write response channel interface
(same as axi3)
-
class
hwtLib.amba.axi4.
Axi4_r
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3.Axi3_r
Axi4 read channel interface
(same as axi3)
-
class
hwtLib.amba.axi4.
Axi4_w
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axis.AxiStream
Axi4 write channel interface
(Axi3_w without id signal)
-
class
hwtLib.amba.axi4.
IP_Axi4
[source]
Bases: hwtLib.amba.axi3.IP_Axi3
IP core interface meta for Axi4 interface
-
__init__
()[source]
Initialize self. See help(type(self)) for accurate signature.
hwtLib.amba.axi4Lite module
-
class
hwtLib.amba.axi4Lite.
Axi4Lite
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3Lite.Axi3Lite
Axi4-lite bus interface
-
_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
-
_getIpCoreIntfClass
()[source]
-
class
hwtLib.amba.axi4Lite.
Axi4Lite_addr
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3Lite.Axi3Lite_addr
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi4Lite.
Axi4Lite_addrAgent
(intf)[source]
Bases: hwtLib.amba.axi3Lite.Axi3Lite_addrAgent
Variables: | data – iterable of addr |
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axi4Lite.
Axi4Lite_b
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3Lite.Axi3Lite_b
-
class
hwtLib.amba.axi4Lite.
Axi4Lite_r
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3Lite.Axi3Lite_r
-
class
hwtLib.amba.axi4Lite.
Axi4Lite_w
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi3Lite.Axi3Lite_w
-
class
hwtLib.amba.axi4Lite.
IP_Axi4Lite
[source]
Bases: hwtLib.amba.axi3Lite.IP_Axi3Lite
IP core meta description for Axi4-lite interface
-
__init__
()[source]
Initialize self. See help(type(self)) for accurate signature.
hwtLib.amba.axi4_rDatapump module
-
class
hwtLib.amba.axi4_rDatapump.
Axi_rDatapump
(axiAddrCls=<class 'hwtLib.amba.axi4.Axi4_addr'>)[source]
Bases: hwtLib.amba.axi_datapump_base.Axi_datapumpBase
-
_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
-
addrHandler
(addRmSize, rErrFlag)[source]
-
arIdHandler
(lastReqDispatched)[source]
-
dataHandler
(rmSizeOut)[source]
-
remSizeToStrb
(remSize, strb)[source]
-
class
hwtLib.amba.axi4_rDatapump.
TransEndInfo
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.HandshakeSync
-
_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
hwtLib.amba.axi4_streamToMem module
-
class
hwtLib.amba.axi4_streamToMem.
Axi4streamToMem
[source]
Bases: hwt.synthesizer.unit.Unit
Most simple DMA for AXI4 interface.
0x0 control reg.
rw bit 0 - on/off (1 means on)
r bit 1 - idle
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 stayes 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.
-
_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
-
axiWAddrHandler
(st, baseAddr, actualAddr, lenRem)[source]
AXI write addr logic
-
connectRegisters
(st, onoff, baseAddr)[source]
connection of axilite registers
-
dataWFeed
(st, lenRem, actualLenRem)[source]
Connection between din and axi.w channel
-
mainFsm
(st, onoff, lenRem, actualLenRem)[source]
-
w_allAck
(st)[source]
In this clk data word will be transfered
hwtLib.amba.axi4_wDatapump module
-
class
hwtLib.amba.axi4_wDatapump.
Axi_wDatapump
(axiAddrCls=<class 'hwtLib.amba.axi4.Axi4_addr'>, axiWCls=<class 'hwtLib.amba.axi4.Axi4_w'>)[source]
Bases: hwtLib.amba.axi_datapump_base.Axi_datapumpBase
-
__init__
(axiAddrCls=<class 'hwtLib.amba.axi4.Axi4_addr'>, axiWCls=<class 'hwtLib.amba.axi4.Axi4_w'>)[source]
Initialize self. See help(type(self)) for accurate signature.
-
_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
-
axiAwHandler
(wErrFlag)[source]
-
axiBHandler
()[source]
-
axiWHandler
(wErrFlag)[source]
-
class
hwtLib.amba.axi4_wDatapump.
BFifoIntf
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.Handshaked
-
_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
-
class
hwtLib.amba.axi4_wDatapump.
WFifoIntf
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.Handshaked
-
_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
hwtLib.amba.axiDatapumpIntf module
-
class
hwtLib.amba.axiDatapumpIntf.
AddrSizeHs
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.Handshaked
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axiDatapumpIntf.
AddrSizeHsAgent
(intf)[source]
Bases: hwt.interfaces.agents.handshaked.HandshakedAgent
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axiDatapumpIntf.
AxiRDatapumpIntf
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
Interface of read datapump driver
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axiDatapumpIntf.
AxiRDatapumpIntfAgent
(intf)[source]
Bases: hwt.simulator.agentBase.AgentBase
Composite agent with agent for every AxiRDatapumpIntf channel
enable is shared
-
__init__
(intf)[source]
Initialize self. See help(type(self)) for accurate signature.
-
enable
-
getDrivers
()[source]
Called before simulation to collect all drivers of interfaces
from this agent
-
getMonitors
()[source]
Called before simulation to collect all monitors of interfaces
from this agent
-
class
hwtLib.amba.axiDatapumpIntf.
AxiWDatapumpIntf
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
Interface of write datapump driver
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axiDatapumpIntf.
AxiWDatapumpIntfAgent
(intf)[source]
Bases: hwt.simulator.agentBase.AgentBase
Composite agent with agent for every AxiRDatapumpIntf channel
enable is shared
-
__init__
(intf)[source]
Initialize self. See help(type(self)) for accurate signature.
-
enable
-
getDrivers
()[source]
Called before simulation to collect all drivers of interfaces
from this agent
-
getMonitors
()[source]
Called before simulation to collect all monitors of interfaces
from this agent
hwtLib.amba.axi_datapump_base module
-
class
hwtLib.amba.axi_datapump_base.
Axi_datapumpBase
(axiAddrCls=<class 'hwtLib.amba.axi4.Axi4_addr'>)[source]
Bases: hwt.synthesizer.unit.Unit
Variables: |
- MAX_TRANS_OVERLAP (param) – max number of concurrent transactions
- driver – interface which is used to drive this datapump (AxiRDatapumpIntf or AxiWDatapumpIntf)
|
-
__init__
(axiAddrCls=<class 'hwtLib.amba.axi4.Axi4_addr'>)[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
-
axiAddrDefaults
()[source]
-
getAxiLenMax
()[source]
-
getBurstAddrOffset
()[source]
-
getSizeAlignBits
()[source]
-
useTransSplitting
()[source]
hwtLib.amba.axi_datapump_utils module
-
hwtLib.amba.axi_datapump_utils.
connectDp
(parent, controller, datapump, axi, exclude=None)[source]
Connect datapump with it’s controller(s) and axi
Parameters: |
- controller – (controller compatible with Axi_wDatapump or Axi_rDatapump)
or list/tuple/generator of them
- datapump – Axi_wDatapump or Axi_rDatapump
- axi – axi(3/4) interface which datapump should use
|
hwtLib.amba.axi_intf_common module
-
hwtLib.amba.axi_intf_common.
AxiMap
(prefix, listOfNames, d=None)[source]
-
class
hwtLib.amba.axi_intf_common.
Axi_hs
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.HandshakeSync
AXI handshake interface with ready and valid signal
(same as HandshakeSync just vld is valid and rd is ready)
transaction happens when both ready and valid are high
Variables: |
- ready – when high slave is ready to receive data
- valid – when high master is sending data to slave
|
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axi_intf_common.
Axi_id
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
-
_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
-
class
hwtLib.amba.axi_intf_common.
Axi_strb
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
-
_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
-
class
hwtLib.amba.axi_intf_common.
Axi_user
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
-
_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
hwtLib.amba.axis module
-
class
hwtLib.amba.axis.
AxiStream
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axis.AxiStream_withoutSTRB
, hwtLib.amba.axi_intf_common.Axi_strb
AxiStream_withoutSTRB
with strb signal
Variables: | strb – byte strobe signal, has bit for each byte of data,
data valid if corresponding bit ins strb signal is high |
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axis.
AxiStreamAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Simulation agent for AxiStream
interface
input/output data stored in list under “data” property
data contains tuples (data, strb, last)
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axis.
AxiStream_withId
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi_intf_common.Axi_id
, hwtLib.amba.axis.AxiStream
AxiStream
with id signal
Variables: | id – id signal, usually identifies type or destination of frame |
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axis.
AxiStream_withIdAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Simulation agent for AxiStream_withId
interface
input/output data stored in list under “data” property
data contains tuples (id, data, strb, last)
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axis.
AxiStream_withUserAndNoStrb
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axis.AxiStream_withoutSTRB
, hwtLib.amba.axi_intf_common.Axi_user
AxiStream_withoutSTRB
with user signal
Variables: | user – generic signal with user specified meaning |
-
_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
-
class
hwtLib.amba.axis.
AxiStream_withUserAndStrb
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axis.AxiStream
, hwtLib.amba.axi_intf_common.Axi_user
AxiStream
with user signal
Variables: | user – generic signal with user specified meaning |
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axis.
AxiStream_withUserAndStrbAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Simulation agent for AxiStream_withUserAndStrb
interface
input/output data stored in list under “data” property
data contains tuples (data, strb, user, last)
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axis.
AxiStream_withoutSTRB
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.amba.axi_intf_common.Axi_hs
Bare AMBA AXI-stream interface
Variables: |
- IS_BIGENDIAN – Param which specifies if interface uses bigendian
byte order or litleendian byte order
- DATA_WIDTH – Param which specifies width of data signal
- data – main data signal
- last – signal which if high this data is last in this frame
|
Attention: | no checks are made for endianity, this is just information
|
Note: | bigendian for interface means that items which are send through
this interface has reversed byte endianity that means that most significant
byte is is on lower address than les significant ones
f.e. litle endian value 0x1a2b will be 0x2b1a
but iterface itselelf is not reversed in any way
|
-
_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
-
_getIpCoreIntfClass
()[source]
-
_initSimAgent
()[source]
-
class
hwtLib.amba.axis.
AxiStream_withoutSTRBAgent
(intf)[source]
Bases: hwtLib.amba.sim.agentCommon.BaseAxiAgent
Simulation agent for AxiStream_withoutSTRB
interface
input/output data stored in list under “data” property
data contains tuples (data, strb, last)
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.amba.axis.
IP_AXIStream
[source]
Bases: hwt.serializer.ip_packager.interfaces.intfConfig.IntfConfig
Class which specifies how to describe AxiStream interfaces in IP-core
-
__init__
()[source]
Initialize self. See help(type(self)) for accurate signature.
-
hwtLib.amba.axis.
packAxiSFrame
(dataWidth, structVal, withStrb=False)[source]
pack data of structure into words on axis interface
-
hwtLib.amba.axis.
unpackAxiSFrame
(structT, frameData, getDataFn=None, dataWidth=None)[source]
opposite of packAxiSFrame
hwtLib.amba.constants module
-
hwtLib.amba.constants.
BYTES_IN_TRANS
(n)[source]
hwtLib.amba.fullDuplexAxiStream module
-
class
hwtLib.amba.fullDuplexAxiStream.
FullDuplexAxiStream
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
-
_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
Module contents
hwtLib.clocking package
Submodules
hwtLib.clocking.clkBuilder module
-
class
hwtLib.clocking.clkBuilder.
ClkBuilder
(parent, srcInterface, name=None)[source]
Bases: object
Variables: |
- compId – last component id used to avoid name collisions
- parent – unit in which will be all units created by this builder instantiated
- name – prefix for all instantiated units
- end – interface where builder ended
|
-
__init__
(parent, srcInterface, name=None)[source]
Parameters: |
- parent – unit in which will be all units created by this builder instantiated
- name – prefix for all instantiated units
- srcInterface – input clock
|
-
edgeDetector
(sig, rise=False, fall=False, last=None, initVal=0)[source]
Parameters: |
- sig – signal to detect edges on
- rise – if True signal for rise detecting will be returned
- fall – if True signal for fall detecting will be returned
- last – last value for sig (use f.e. when you have register and it’s next signal (sig=reg.next, last=reg))
if last is None last register will be automatically generated
- initVal – if last is None initVal will be used as its initialization value
|
Returns: | signals which is high on on rising/falling edge or both (specified by rise, fall parameter)
|
-
oversample
(sig, sampleCount, sampleTick, rstSig=None) → Tuple[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal][source]
[TODO] last sample is not sampled correctly
Parameters: |
- sig – signal to oversample
- sampleCount – count of samples to do
- sampleTick – signal to enable next sample taking
- rstSig – rstSig signal to reset internal counter, if is None it is not used
|
Returns: | typle (oversampled signal, oversample valid signal)
|
-
timer
(period, enableSig=None, rstSig=None)[source]
Same as timers, just for one
-
timerDynamic
(periodSig, enableSig=None, rstSig=None) → hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal[source]
Same as timer, just period is signal which can be configured dynamically
-
timers
(periods, enableSig=None, rstSig=None)[source]
generate counters specified by count of iterations
Parameters: |
- periods – list of integers/params which specifies periods of timers
or tuple (name, integer/param)
- enableSig – enable signal for all counters
- rstSig – reset signal for all counters
|
Attention: | if tick of timer his high and enableSig falls low tick will stay high
|
Returns: | list of tick signals from timers
|
hwtLib.clocking.clkDivider module
-
class
hwtLib.clocking.clkDivider.
ClkDiv3
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.clocking.clkDivider.
ClkDiv3TC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
test_oscilation
()[source]
hwtLib.clocking.timers module
-
class
hwtLib.clocking.timers.
DynamicTimerInfo
(maxVal, name=None)[source]
Bases: hwtLib.clocking.timers.TimerInfo
Meta informations about timer with dynamic period
-
__init__
(maxVal, name=None)[source]
Initialize self. See help(type(self)) for accurate signature.
-
static
_instantiateTimerTickLogic
(timer: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, period: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, enableSig: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, NoneType], rstSig: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, NoneType])[source]
Instantiate incrementing timer with optional reset and enable signal
Parameters: |
- timer – timer main register
- period – signal with actual period
- enableSig – optional enable signal for this timer
- rstSig – optional reset signal for this timer
|
-
class
hwtLib.clocking.timers.
TimerInfo
(maxVal, name=None)[source]
Bases: object
Variables: |
- cntrRegister – counter register for this timer
- tick – signal with tick from this timer
- parent – parent TimerInfo object from which this timer can be generated
- maxValOriginal – original value of maxVal
- maxVal – evaluated value of maxVal
- name – name prefix which is used for registers and signals for this timer
|
-
__init__
(maxVal, name=None)[source]
Initialize self. See help(type(self)) for accurate signature.
-
static
_instantiateTimer
(parentUnit, timer, enableSig=None, rstSig=None)[source]
Parameters: |
- enableSig – enable signal for all counters
- rstSig – reset signal for all counters
|
-
static
_instantiateTimerTickLogic
(parentUnit: hwt.synthesizer.unit.Unit, timer: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, origMaxVal: Union[int, hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, hwt.hdl.value.Value], enableSig: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, NoneType], rstSig: Union[hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal, NoneType]) → hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal[source]
Instantiate logic of this timer
Returns: | tick signal from this timer |
-
static
_instantiateTimerWithParent
(parentUnit, timer, parent, enableSig, rstSig)[source]
-
cntrRegister
-
static
instantiate
(parentUnit, timers, enableSig=None, rstSig=None)[source]
Parameters: |
- enableSig – enable signal for all counters
- rstSig – reset signal for all counters
|
-
maxVal
-
maxValOriginal
-
name
-
parent
-
static
resolveSharing
(timers)[source]
-
tick
Module contents
hwtLib.handshaked package
Submodules
hwtLib.handshaked.compBase module
-
class
hwtLib.handshaked.compBase.
HandshakedCompBase
(hsIntfCls)[source]
Bases: hwt.synthesizer.unit.Unit
-
__init__
(hsIntfCls)[source]
Parameters: | hsIntfCls – class of interface which should be used as interface of this unit |
-
_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
-
getData
(intf)[source]
-
getRd
(intf)[source]
-
getVld
(intf)[source]
hwtLib.handshaked.fifo module
-
class
hwtLib.handshaked.fifo.
HandshakedFifo
(hsIntfCls)[source]
Bases: hwtLib.handshaked.compBase.HandshakedCompBase
Fifo for handshaked interfaces
-
_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
-
_regCls
alias of hwtLib.handshaked.reg.HandshakedReg
hwtLib.handshaked.intfBiDirectional module
-
class
hwtLib.handshaked.intfBiDirectional.
HandshakedBiDirectional
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.Handshaked
hwt.interfaces.std.Handshaked
interface with data
- channels in bout direction
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.handshaked.intfBiDirectional.
HandshakedBiDirectionalAgent
(intf)[source]
Bases: hwt.interfaces.agents.handshaked.HandshakedAgent
Simulation agent for HandshakedBiDirectional
interface
Attention: | for monitor number of items in dinData has to match with number of received items |
-
__init__
(intf)[source]
Initialize self. See help(type(self)) for accurate signature.
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
onDriverWriteAck
(simulator)[source]
read din
-
onMonitorReady
(simulator)[source]
write din
hwtLib.handshaked.joinFair module
-
class
hwtLib.handshaked.joinFair.
HsJoinFairShare
(hsIntfCls)[source]
Bases: hwtLib.handshaked.joinPrioritized.HsJoinPrioritized
Join input stream to single output stream
inputs with lower number has higher priority
Priority is changing every clock
If prioritized input is not sending valid data,
input with lowest index and valid is used
combinational
-
_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
-
inputMuxLogic
(isSelectedFlags, vldSignals)[source]
-
isSelectedLogic
()[source]
Resolve isSelected signal flags for each input, when isSelected flag signal is 1 it means
input has clearance to make transaction
-
static
priorityAck
(priorityReg, vldSignals, index)[source]
Generate ack logic for selected input
Parameters: |
- priorityReg – priority register with one hot encoding, 1 means input of this index should have be prioritized.
- vldSignals – list of vld signals of input
- index – index of input for which you wont get ack logic
|
Returns: | ack signal for this input
|
hwtLib.handshaked.joinPrioritized module
-
class
hwtLib.handshaked.joinPrioritized.
HsJoinPrioritized
(hsIntfCls)[source]
Bases: hwtLib.handshaked.compBase.HandshakedCompBase
Join input stream to single output stream
inputs with lower number has higher priority
combinational
-
_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
-
dataConnectionExpr
(dIn, dOut)[source]
Create connection between input and output interface
hwtLib.handshaked.ramAsHs module
-
class
hwtLib.handshaked.ramAsHs.
RamAsHs
[source]
Bases: hwt.synthesizer.unit.Unit
Converter from ram port to handshaked interfaces
-
_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) |
-
class
hwtLib.handshaked.ramAsHs.
RamHsR
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.handshaked.ramAsHs.
RamHsRAgent
(intf)[source]
Bases: hwt.simulator.agentBase.AgentBase
Composite agent with agent for addr and data channel
enable is shared
-
__init__
(intf)[source]
Initialize self. See help(type(self)) for accurate signature.
-
enable
-
getDrivers
()[source]
Called before simulation to collect all drivers of interfaces
from this agent
-
getMonitors
()[source]
Called before simulation to collect all monitors of interfaces
from this agent
hwtLib.handshaked.reg module
-
class
hwtLib.handshaked.reg.
HandshakedReg
(hsIntfCls)[source]
Bases: hwtLib.handshaked.compBase.HandshakedCompBase
Register for Handshaked interface
-
_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
-
_implLatencyAndDelay
(inVld, inRd, inData, outVld, outRd, prefix)[source]
-
_impl_latency
(inVld, inRd, inData, outVld, outRd, prefix)[source]
hwtLib.handshaked.resizer module
-
class
hwtLib.handshaked.resizer.
HsResizer
(hsIntfCls, scale, inIntfConfigFn, outIntfConfigFn)[source]
Bases: hwtLib.handshaked.compBase.HandshakedCompBase
Resize width of handshaked interface
-
__init__
(hsIntfCls, scale, inIntfConfigFn, outIntfConfigFn)[source]
Parameters: |
- hsIntfCls – class of interface which should be used as interface of this unit
- scale – tuple (in scale, out scale) one of scales has to be 1, f. e. (1,2) means output
will be 2x wider
- inIntfConfigFn – function inIntfConfigFn(input interface) which will be applied on dataIn
- outIntfConfigFn – function outIntfConfigFn(input interface) which will be applied on dataOut
|
-
_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
-
_downscale
(factor)[source]
-
_impl
()[source]
implementations
- implement functionality of design there
- called after _declr
-
_upscale
(factor)[source]
-
_upscaleDataPassLogic
(inputRegs_cntr, ITEMS)[source]
hwtLib.handshaked.splitCopy module
-
class
hwtLib.handshaked.splitCopy.
HsSplitCopy
(hsIntfCls)[source]
Bases: hwtLib.handshaked.compBase.HandshakedCompBase
Clone input stream to n identical output streams
transaction is made in all interfaces or none of them
combinational
-
_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.handshaked.splitFair module
-
class
hwtLib.handshaked.splitFair.
HsSplitFair
(hsIntfCls)[source]
Bases: hwtLib.handshaked.splitCopy.HsSplitCopy
Split input stream to outputs, select single output for every
input data based on priority.
Priority is changing every clock
If prioritized output is not ready,
input with lowest index and ready is used
combinational
Variables: | selectedOneHot – handshaked interface with one hot encoded
index of selected output |
-
_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
-
isSelectedLogic
()[source]
Resolve isSelected signal flags for each input, when isSelected flag
signal is 1 it means input has clearance to make transaction
hwtLib.handshaked.splitPrioritized module
-
class
hwtLib.handshaked.splitPrioritized.
HsSplitPrioritized
(hsIntfCls)[source]
Bases: hwtLib.handshaked.splitCopy.HsSplitCopy
Split input stream to n output streams
Data is send to output interface which is ready and has lowest index
combinational
-
_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.handshaked.splitSelect module
-
class
hwtLib.handshaked.splitSelect.
HsSplitSelect
(hsIntfCls)[source]
Bases: hwtLib.handshaked.compBase.HandshakedCompBase
Split data from input interface to output interface based on explicit output index
provided by select interface
-
_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.handshaked.streamNode module
-
class
hwtLib.handshaked.streamNode.
ExclusiveStreamGroups
[source]
Bases: list
list of tuples (cond, StreamNode instance)
Only one stream from this group can be activated at the time
-
ack
()[source]
Returns: | expression which’s value is high when transaction can be made
over at least on child streaming node |
-
sync
(enSig=None)[source]
Create synchronization logic between streams
(generate valid/ready synchronization logic for interfaces)
Parameters: | enSig – optional signal to enable this group of nodes |
Returns: | list of assignements which are responsible for synchronization
of streams |
-
class
hwtLib.handshaked.streamNode.
StreamNode
(masters=None, slaves=None, extraConds=None, skipWhen=None)[source]
Bases: object
Group of stream master and slave interfaces to synchronize them to each other
Variables: |
- masters – interfaces which are inputs into this node
- slaves – interfaces which are outputs of this node
- extraConds – dict interface : extraConditionSignal
where extra conditions will be added to expression for channel enable
for master it means it will get ready only when extraConditionSignal
is 1 for slave it means it will not get valid only
when extraConditionSignal is 1 but all interfaces have to wait
on each other
- skipWhen – dict interface : skipSignal
where if skipSignal is high interface is disconnected from stream
sync node and others does not have to wait on it
(master does not need to have valid and slave ready)
|
Attention: | skipWhen has higher priority
|
-
__init__
(masters=None, slaves=None, extraConds=None, skipWhen=None)[source]
Initialize self. See help(type(self)) for accurate signature.
-
ack
()[source]
Returns: | expression which’s value is high when transaction can be made over interfaces |
-
ackForMaster
(master)[source]
Returns: | driver of ready signal for master |
-
ackForSlave
(slave)[source]
Returns: | driver of valid signal for slave |
-
getExtraAndSkip
(intf)[source]
Returns: | optional extraCond and skip flags for interface |
-
rd
(intf)[source]
Returns: | ready signal of slave interface for synchronization of othres |
-
sync
(enSig=None)[source]
Create synchronization logic between streams
(generate valid/ready synchronization logic for interfaces)
Parameters: | enSig – optional signal to enable this node |
Returns: | list of assignements which are responsible for synchronization of streams |
-
vld
(intf)[source]
Returns: | valid signal of master interface for synchronization of othres |
-
hwtLib.handshaked.streamNode.
_exStreamMemberAck
(m)[source]
-
hwtLib.handshaked.streamNode.
_getRd
(intf)[source]
-
hwtLib.handshaked.streamNode.
_getVld
(intf)[source]
Module contents
hwtLib.i2c package
Submodules
hwtLib.i2c.intf module
-
class
hwtLib.i2c.intf.
I2c
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
-
_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
-
_getIpCoreIntfClass
()[source]
-
_initSimAgent
()[source]
-
class
hwtLib.i2c.intf.
I2cAgent
(intf, allowNoReset=True)[source]
Bases: hwt.simulator.agentBase.AgentWitReset
-
START
= 'start'
-
__init__
(intf, allowNoReset=True)[source]
Initialize self. See help(type(self)) for accurate signature.
-
driver
(sim)[source]
Implement this method to drive your interface
in simulation/verification
-
getDrivers
()[source]
Called before simulation to collect all drivers of interfaces
from this agent
-
getMonitors
()[source]
Called before simulation to collect all monitors of interfaces
from this agent
-
monitor
(sim)[source]
Implement this method to monitor your interface
in simulation/verification
-
startListener
(sim)[source]
-
startSender
(sim)[source]
-
class
hwtLib.i2c.intf.
IP_IIC
[source]
Bases: hwt.serializer.ip_packager.interfaces.intfConfig.IntfConfig
-
__init__
()[source]
Initialize self. See help(type(self)) for accurate signature.
hwtLib.i2c.masterBitCntrl module
-
class
hwtLib.i2c.masterBitCntrl.
I2cBitCntrlCmd
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.RdSynced
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.i2c.masterBitCntrl.
I2cBitCntrlCmdAgent
(intf, allowNoReset=True)[source]
Bases: hwt.interfaces.agents.rdSynced.RdSyncedAgent
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.i2c.masterBitCntrl.
I2cMasterBitCtrl
[source]
Bases: hwt.synthesizer.unit.Unit
Translate simple commands into SCL/SDA transitions
Each command has 5 states, 0/1/2/3/idle
Timing: |
Normal mode |
Fast mode |
Fscl |
100KHz |
400KHz |
Th_scl |
4.0us |
0.6us High period of SCL |
Tl_scl |
4.7us |
1.3us Low period of SCL |
Tsu:sta |
4.7us |
0.6us setup time for a repeated start condition |
Tsu:sto |
4.0us |
0.6us setup time for a stop condition |
Tbuf |
4.7us |
1.3us Bus free time between a stop and start condition |
-
_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
-
arbitrationLostDriver
(st, sda, sda_chk, sda_t, stopCond, stateClkEn)[source]
aribitration lost when:
- master drives SDA high, but the i2c bus is low
- stop detected while not requested (detect during ‘idle’ state)
-
detectStartAndStop
(scl, sda, scl_t)[source]
Attention: | also dout driver |
-
filter
(name, sig)[source]
attempt to remove glitches
-
stateClkGen
(scl_sync, scl_t, scl)[source]
-
hwtLib.i2c.masterBitCntrl.
hasFallen
(last, actual)[source]
-
hwtLib.i2c.masterBitCntrl.
hasRisen
(last, actual)[source]
Module contents
hwtLib.img package
Submodules
hwtLib.img.charToBitmap module
-
hwtLib.img.charToBitmap.
addCharToBitmap
()[source]
Add rom to translate ascii to 8x8 char bitmap,
first row is placed on lower address,
font is taken from png image
Returns: | Bits(8)[128 * 8] where are stored bitmaps of chars, up is first lower char is first |
-
hwtLib.img.charToBitmap.
asciiArtOfChar
(ch, inverted=True)[source]
-
hwtLib.img.charToBitmap.
getCharRow
(charOrd, row)[source]
Module contents
hwtLib.interfaces package
Submodules
hwtLib.interfaces.addrDataHs module
-
class
hwtLib.interfaces.addrDataHs.
AddrDataBitMaskHs
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.interfaces.addrDataHs.AddrDataHs
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.interfaces.addrDataHs.
AddrDataHs
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.HandshakeSync
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.interfaces.addrDataHs.
AddrDataHsAgent
(intf)[source]
Bases: hwt.interfaces.agents.handshaked.HandshakedAgent
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.interfaces.addrDataHs.
AddrDataMaskHsAgent
(intf)[source]
Bases: hwt.interfaces.agents.handshaked.HandshakedAgent
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
hwtLib.interfaces.frameLink module
-
class
hwtLib.interfaces.frameLink.
FrameLink
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
Stream with “byte enable” and “start/end of frame/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
Module contents
hwtLib.ipif package
Submodules
hwtLib.ipif.endpoint module
-
class
hwtLib.ipif.endpoint.
IpifEndpoint
(structTemplate, intfCls=<class 'hwtLib.ipif.intf.Ipif'>, shouldEnterFn=None)[source]
Bases: hwtLib.abstract.busEndpoint.BusEndpoint
Delegate request from bus to fields of structure
Attention: | interfaces are dynamically generated from names of fileds in structure template |
Attention: | byte enable and register clock enable signals are ignored |
-
__init__
(structTemplate, intfCls=<class 'hwtLib.ipif.intf.Ipif'>, shouldEnterFn=None)[source]
Parameters: |
- structTemplate – instance of HStruct which describes
address space of this endpoint
- intfCls – class of bus interface which should be used
- shouldEnterFn – function(structField) return (shouldEnter, shouldUse)
where shouldEnter is flag that means iterator over this interface
should look inside of this actual object
and shouldUse flag means that this field should be used
(to create interface)
|
-
_getAddrStep
()
Returns: | how many bits is one unit of address (f.e. 8 bits for char * pointer,
36 for 36 bit bram) |
-
_getWordAddrStep
()
Returns: | size of one word in unit of address |
-
_impl
()[source]
implementations
- implement functionality of design there
- called after _declr
hwtLib.ipif.intf module
-
class
hwtLib.ipif.intf.
Ipif
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
-
READ
= 1
-
WRITE
= 0
-
_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
-
_getAddrStep
()[source]
Returns: | how many bits is one unit of address (f.e. 8 bits for char * pointer,
36 for 36 bit bram) |
-
_getWordAddrStep
()[source]
Returns: | size of one word in unit of address |
-
_initSimAgent
()[source]
-
class
hwtLib.ipif.intf.
IpifAgent
(intf, allowNoReset=True)[source]
Bases: hwt.simulator.agentBase.SyncAgentBase
Variables: |
- requests – list of tuples (request type, address, [write data], [write mask]) - used for driver
- data – list of data in memory, used for monitor
- mem – if agent is in monitor mode (= is slave) all reads and writes are performed on
mem object
- actual – actual request which is performed
|
-
__init__
(intf, allowNoReset=True)[source]
Initialize self. See help(type(self)) for accurate signature.
-
doReq
(sim, req)[source]
-
driver
(sim)[source]
Implement this method to drive your interface
in simulation/verification
-
monitor
(sim)[source]
Implement this method to monitor your interface
in simulation/verification
-
class
hwtLib.ipif.intf.
IpifWithCE
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.ipif.intf.Ipif
-
_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
hwtLib.ipif.reg module
-
class
hwtLib.ipif.reg.
IpifReg
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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
-
connectRegistered
(intfFrom, intfTo)[source]
hwtLib.ipif.simMaster module
-
class
hwtLib.ipif.simMaster.
IPFISimMaster
(bus, registerMap)[source]
Bases: hwtLib.sim.abstractMemSpaceMaster.AbstractMemSpaceMaster
Simulation address space master for IPIF interface
-
_read
(addr, size, onDone=None)[source]
Add read transaction to agent of interface
:param addr: address value on bus to read froms
:param size: size of data to read in bites
:param onDone: on read done callback function(sim) -> None
-
_write
(addr, size, data, mask, onDone=None)[source]
Add write transaction to agent of interface
Parameters: |
- addr – address value on bus to write on
- size – size of data to write in bites
- data – data to write on bus
- onDone – on write done callback function(sim) -> None
|
Module contents
hwtLib.logic package
Submodules
hwtLib.logic.binToOneHot module
-
class
hwtLib.logic.binToOneHot.
BinToOneHot
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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) |
-
class
hwtLib.logic.binToOneHot.
BinToOneHotTC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
test_basic
()[source]
hwtLib.logic.bitonicSorter module
-
class
hwtLib.logic.bitonicSorter.
BitonicSorter
(cmpFn=<function BitonicSorter.<lambda>>)[source]
Bases: hwt.synthesizer.unit.Unit
-
__init__
(cmpFn=<function BitonicSorter.<lambda>>)[source]
Parameters: | cmpFn – function (item0, item1) if returns true,
items are not swaped |
-
_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
-
bitonic_compare
(cmpFn, x, layer, offset)[source]
-
bitonic_merge
(cmpFn, x, layer, offset)[source]
-
bitonic_sort
(cmpFn, x, layer=0, offset=0)[source]
-
class
hwtLib.logic.bitonicSorter.
BitonicSorterTC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
SIM_TIME
= 40000
-
createUnit
()[source]
-
getOutputs
()[source]
-
setInputs
(values)[source]
-
test_reversed
()[source]
-
test_sorted
()[source]
hwtLib.logic.cntrGray module
-
class
hwtLib.logic.cntrGray.
GrayCntr
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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) |
-
class
hwtLib.logic.cntrGray.
GrayCntrTC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
test_count
()[source]
hwtLib.logic.crc module
-
class
hwtLib.logic.crc.
Crc
[source]
Bases: hwt.synthesizer.unit.Unit
Crc generator for any crc
polynom can be string in usual format or integer f.e.”x^3+x+1” or 0b1011
-
_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
-
build_CRC_XOR
(inputBits, xorMatrix)[source]
-
parsePoly
(POLY_WIDTH)[source]
-
wrapWithName
(sig, name)[source]
hwtLib.logic.crcComb module
-
class
hwtLib.logic.crcComb.
CrcComb
[source]
Bases: hwt.synthesizer.unit.Unit
CRC generator
polynomial can be string in usual format or integer (f.e.”x^3+x+1” or 0b1011)
@attention: Input not reflected, Result not reflected, Initial Value: 0x0, Final Xor Value: 0x0
-
_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
-
parsePoly
()[source]
hwtLib.logic.crcPoly module
hwtLib.logic.crcUtils module
-
hwtLib.logic.crcUtils.
buildCrcMatrix
(coefs, polyWidth, dataWidth)[source]
-
hwtLib.logic.crcUtils.
buildCrcMatrix_dataMatrix
(coefs, polyWidth, dataWidth)[source]
generate LSFR reg, matrix[MxN]
Parameters: |
- coefs – Polynomial coefficients
- polyWidth – number of bits of Polynomial
- dataWidth – number of bits of data signal
|
-
hwtLib.logic.crcUtils.
buildCrcMatrix_reg0Matrix
(coefs, polyWidth, dataWidth)[source]
-
hwtLib.logic.crcUtils.
crc_serial_shift
(num_bits_to_shift, polySize, coefs, lfsr_cur, dataWidth, data_cur)[source]
Parameters: |
- polySize – bit size of polynomial
- coefs – array of 1,0 which representing the polynomial
- lfsr_cur – array with single 1 flag which specifies
for which bit we are currently counting the crc
|
Pram dataWidth: | bit widtho of input signal to this crc round
|
Pram data_cur: | ray with single 1 flag which specifies
for which bit we are currently counting the crc
|
-
hwtLib.logic.crcUtils.
parsePolyStr
(polyStr, width)[source]
-
hwtLib.logic.crcUtils.
parsePolyStr_parse_n
(string)[source]
Parse the number part of a polynomial string term
-
hwtLib.logic.crcUtils.
parsePolyStr_parse_p
(string)[source]
Parse the power part of a polynomial string term
hwtLib.logic.lsfr module
-
class
hwtLib.logic.lsfr.
Lsfr
[source]
Bases: hwt.synthesizer.unit.Unit
Linear shift feedback register,
form of hardware pseudorandom generator
-
_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.logic.lsfr.
LsfrTC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
test_simple
()[source]
hwtLib.logic.oneHotToBin module
-
class
hwtLib.logic.oneHotToBin.
OneHotToBin
[source]
Bases: hwt.synthesizer.unit.Unit
Converts one hot signal to binary, bin.vld is high when oneHot != 0
-
_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) |
-
hwtLib.logic.oneHotToBin.
oneHotToBin
(parent, signals, resName='oneHotToBin')[source]
hwtLib.logic.pid module
-
class
hwtLib.logic.pid.
PidController
[source]
Bases: hwt.synthesizer.unit.Unit
The PID Control block compares the input to the target
and calculates an error. Based on this error, a output value is calculated
that should result in a smaller error on the next iteration of the loop,
assuming your parameters are tuned properly.
u(k) = u(k-1) + a0*e(k) + a1*y(k) + a2*y(k-1) + a3*y(k-2)
e(k): error in this step (= target value - input)
y(k): input in step k
ax: PID coeficient
The PID parameter inputs for this equation are slightly different
from the traditional K_p, K_i, and K_d.
a0 = K_i * T_s
a1 = -K_p - K_d / T_s
a2 = K_p + 2K_d/T_s
a3 = - K_d / T_s
Note: | You can obtain coeficiet f.e. by Ziegler-Nichols method. |
-
_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.logic.segment7 module
-
class
hwtLib.logic.segment7.
Segment7
[source]
Bases: hwt.synthesizer.unit.Unit
7-segment display decoder
Note: | led in display becomes active when output = 0 |
display pin connection:
-
_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
hwtLib.mem package
Subpackages
hwtLib.mem.atomic package
Submodules
hwtLib.mem.atomic.flipCntr module
-
class
hwtLib.mem.atomic.flipCntr.
FlipCntr
[source]
Bases: hwt.synthesizer.unit.Unit
Counter with FlipRegister which is form memory with atomic access
interface doFilip drives switching of memories in flip register
dataIn has higher priority than doIncr
-
_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 first obj of it’s class
Parameters: | priv – private data for this function
(first object with class == obj.__class__) |
Returns: | tuple (do serialize this object, next priv)
where priv is private data for this function
(first object with class == obj.__class__) |
-
dataHanldler
()[source]
-
flipHandler
()[source]
hwtLib.mem.atomic.flipRam module
-
class
hwtLib.mem.atomic.flipRam.
FlipRam
[source]
Bases: hwt.synthesizer.unit.Unit
Switchable RAM, there are two memories and two sets of ports,
Each set of ports is every time connected to opposite ram.
By select you can choose between RAMs.
This component is meant to be form of synchronization.
Example first RAM is connected to first set of ports, writer performs actualizations on first RAM
and reader reads data from second ram by second set of ports.
Then select is set and access is flipped. Reader now has access to RAM 0 and writer to RAM 1.
-
_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) |
hwtLib.mem.atomic.flipReg module
-
class
hwtLib.mem.atomic.flipReg.
FlipRegister
[source]
Bases: hwt.synthesizer.unit.Unit
Switchable register, there are two registers and two sets of ports,
Each set of ports is every time connected to opposite reg.
By select you can choose between regs.
This component is meant to be form of synchronization.
Example first reg is connected to first set of ports, writer performs actualizations
on first reg and reader reads data from second ram by second set of ports.
Then select is set and access is flipped. Reader now has access to reg 0 and writer to reg 1.
-
_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 first obj of it’s class
Parameters: | priv – private data for this function
(first object with class == obj.__class__) |
Returns: | tuple (do serialize this object, next priv)
where priv is private data for this function
(first object with class == obj.__class__) |
-
connectReadIntf
(regA, regB)[source]
-
connectWriteIntf
(regA, regB)[source]
Module contents
Submodules
hwtLib.mem.bramPortEndpoint module
-
class
hwtLib.mem.bramPortEndpoint.
BramPortEndpoint
(structTemplate, intfCls=<class 'hwt.interfaces.std.BramPort_withoutClk'>, shouldEnterFn=None)[source]
Bases: hwtLib.abstract.busEndpoint.BusEndpoint
Delegate transaction from BrapmPort interface to interfaces
for fields of specified structure
Attention: | interfaces are dynamically generated from names
of fields in structure template |
-
__init__
(structTemplate, intfCls=<class 'hwt.interfaces.std.BramPort_withoutClk'>, shouldEnterFn=None)[source]
Parameters: |
- structTemplate – instance of HStruct which describes
address space of this endpoint
- intfCls – class of bus interface which should be used
- shouldEnterFn – function(structField) return (shouldEnter, shouldUse)
where shouldEnter is flag that means iterator over this interface
should look inside of this actual object
and shouldUse flag means that this field should be used
(to create interface)
|
-
_getAddrStep
()
Returns: | how many bits is one unit of address (f.e. 8 bits for
char * pointer, 36 for 36 bit bram) |
-
_getWordAddrStep
()
Returns: | size of one word in unit of address |
-
_impl
()[source]
implementations
- implement functionality of design there
- called after _declr
hwtLib.mem.bramPortSimMemSpaceMaster module
-
class
hwtLib.mem.bramPortSimMemSpaceMaster.
BramPortSimMemSpaceMaster
(bus, registerMap)[source]
Bases: hwtLib.sim.abstractMemSpaceMaster.AbstractMemSpaceMaster
-
_read
(addr, size, onDone)[source]
Add read transaction to agent of interface
:param addr: address value on bus to read froms
:param size: size of data to read in bites
:param onDone: on read done callback function(sim) -> None
-
_write
(addr, size, data, mask, onDone=None)[source]
Add write transaction to agent of interface
Parameters: |
- addr – address value on bus to write on
- size – size of data to write in bites
- data – data to write on bus
- onDone – on write done callback function(sim) -> None
|
-
_writeAddr
(addrChannel, addr, size)[source]
hwtLib.mem.cam module
-
class
hwtLib.mem.cam.
Cam
[source]
Bases: hwt.synthesizer.unit.Unit
Content addressable memory
Simple combinational version
MATCH_LATENCY = 1
-
_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) |
-
matchHandler
(mem)[source]
-
writeHandler
(mem)[source]
hwtLib.mem.clkSynchronizer module
-
class
hwtLib.mem.clkSynchronizer.
ClkSynchronizer
[source]
Bases: hwt.synthesizer.unit.Unit
Signal synchronization between two clock domains
http://www.sunburst-design.com/papers/CummingsSNUG2008Boston_CDC.pdf
-
_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.mem.cuckooHashTable module
-
class
hwtLib.mem.cuckooHashTable.
CInsertIntf
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.HandshakeSync
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.mem.cuckooHashTable.
CInsertIntfAgent
(intf)[source]
Bases: hwt.interfaces.agents.handshaked.HandshakedAgent
Agent for CInsertIntf interface
-
__init__
(intf)[source]
Initialize self. See help(type(self)) for accurate signature.
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.mem.cuckooHashTable.
CuckooHashTable
(polynomials=[1947962583, 517762881])[source]
Bases: hwtLib.mem.hashTableCore.HashTableCore
Cuckoo hash uses more tables with different hash functions
Lookup is performed in all tables at once and if item is found in any
table item is found otherwise item is not in tables.
lookup time: O(1)
Insert has to first lookup if item is in any table. If there is such a item
it is replaced. If there is any empty element item is stored there.
If there is a valid item under this key in all tables. One is selected
and it is replaced by current item. Insert process then repeats with this item.
Inserting into table does not have to be successful and in this case,
fsm ends up in infinite loop and it will be reinserting items.
-
__init__
(polynomials=[1947962583, 517762881])[source]
Parameters: | polynomials – list of polynomials for crc hashers used in tables
for each item in this list table will be instantiated |
-
_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
-
cleanUpAddrIterator
(en)[source]
-
insertAddrSelect
(targetOH, state, cleanAddr)[source]
-
insetOfTablesDriver
(state, insertTargetOH, insertIndex, stash, isExternLookup)[source]
Parameters: |
- state – state register of main fsm
- insertTargetOH – index of table where insert should be performed,
one hot encoding
- insertIndex – address for table where item should be placed
- stash – stash register
- isExternLookup – flag for lookup initialized by external
“lookup” interface
|
-
lookupOfTablesDriver
(state, tableKey)[source]
-
lookupResDriver
(state, lookupOrigin, lookupAck, insertFoundOH)[source]
If lookup request comes from external interface “lookup” propagate results
from tables to “lookupRes”.
-
lookupResOfTablesDriver
(resRead, resAck)[source]
-
stashLoad
(isIdle, stash, lookupOrigin_out)[source]
-
class
hwtLib.mem.cuckooHashTable.
ORIGIN_TYPE
[source]
Bases: object
-
DELETE
= 2
-
INSERT
= 0
-
LOOKUP
= 1
hwtLib.mem.fifo module
-
class
hwtLib.mem.fifo.
Fifo
[source]
Bases: hwt.synthesizer.unit.Unit
Generic fifo instance usually mapped to BRAM
Variables: |
- EXPORT_SIZE – parameter, if true “size” signal will be exported
- size – optional signal with count of items stored in this fifo
- EXPORT_SPACE – parameter, if true “space” signal is exported
- space – optional signal with count of items which can be added to this fifo
|
-
_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) |
hwtLib.mem.fifoAsync module
-
class
hwtLib.mem.fifoAsync.
FifoAsync
[source]
Bases: hwtLib.mem.fifo.Fifo
Asynchronous fifo using BRAM memory, based on:
http://www.asic-world.com/examples/vhdl/asyn_fifo.html
-
_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) |
hwtLib.mem.hashTableCore module
-
class
hwtLib.mem.hashTableCore.
HashTableCore
(polynome)[source]
Bases: hwt.synthesizer.unit.Unit
Generic hash table, in block RAM
there is a input key which is hashed ad this has is used as an index into memory
item on this place is checked and returned on “lookupRes” interface
(item does have to be found, see “found” flag in LookupResultIntf)
memory is an array of items in format
struct item {
bool vldFlag;
data_t data;
key_t key;
};
Variables: |
- ITEMS_CNT – number of items in memory of hash table
- KEY_WIDTH – width of the key used by hash table
- DATA_WIDTH – width of data, can be zero and then no data
interface is instantiated
- LOOKUP_ID_WIDTH – width of id signal for lookup (tag used only
by parent component to mark this lookup for later result processing,
can be 0)
- LOOKUP_HASH – flag if this interface should have hash signal
- LOOKUP_KEY – flag if this interface should have key signal
- POLYNOME – polynome for crc hash used in this table
|
-
__init__
(polynome)[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
-
insertLogic
(ramW)[source]
-
lookupLogic
(ramR)[source]
-
parseItem
(sig)[source]
Parse data stored in hash table
hwtLib.mem.hashTable_intf module
-
class
hwtLib.mem.hashTable_intf.
InsertIntf
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.HandshakeSync
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.mem.hashTable_intf.
InsertIntfAgent
(intf)[source]
Bases: hwt.interfaces.agents.handshaked.HandshakedAgent
Simulation agent for .InsertIntf interface
- data format:
- if interface has data signal, data format is tuple (hash, key, data, vldFlag)
- if interface does not have data signal, data format is tuple (hash, key, vldFlag)
-
__init__
(intf)[source]
Initialize self. See help(type(self)) for accurate signature.
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.mem.hashTable_intf.
LookupKeyIntf
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.HandshakeSync
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.mem.hashTable_intf.
LookupKeyIntfAgent
(intf)[source]
Bases: hwt.interfaces.agents.handshaked.HandshakedAgent
Simulation agent for LookupKeyIntf interface
-
__init__
(intf)[source]
Initialize self. See help(type(self)) for accurate signature.
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.mem.hashTable_intf.
LookupResultIntf
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.interfaces.std.Handshaked
Interface for result of lookup in hash table
Variables: |
- HASH_WIDTH – width of the hash used by hash table
- KEY_WIDTH – width of the key used by hash table
- LOOKUP_HASH – flag if this interface should have hash signal
- LOOKUP_KEY – flag if this interface should have hash signal
- hash – hash for this key (= index in this table)
- key – original key which was searched for
- data – data under this key
- occupied – flag which tells if there is an valid item under this key
|
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.mem.hashTable_intf.
LookupResultIntfAgent
(intf)[source]
Bases: hwt.interfaces.agents.handshaked.HandshakedAgent
Simulation agent for .LookupResultIntf
data is stored in .data
data format is tuple (hash, key, data, found) but some items
can be missing depending on configuration of interface
-
__init__
(intf)[source]
Initialize self. See help(type(self)) for accurate signature.
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
hwtLib.mem.lutRam module
-
class
hwtLib.mem.lutRam.
RAM64X1S
Bases: hwt.synthesizer.unit.Unit
-
_config
()
-
_declr
()
-
_impl
()
-
static
_serializeDecision
(parentUnit, obj, isDeclaration, priv)
Always decide not to serialize obj
Parameters: | priv – private data for this function first unit of this class |
Returns: | tuple (do serialize this object, next priv) |
-
hwtLib.mem.lutRam.
mkLutRamCls
(DATA_WIDTH)[source]
Lut ram generator
hdl code will be excluded from serialization because we expect vendor library to contains it
hwtLib.mem.ram module
-
class
hwtLib.mem.ram.
RamSingleClock
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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) |
-
_sportPort
(index) → None[source]
-
connectPort
(port: hwt.interfaces.std.BramPort_withoutClk, mem: hwt.synthesizer.rtlLevel.rtlSignal.RtlSignal)[source]
-
static
genPortName
(index) → str[source]
-
getPortByIndx
(index) → hwt.interfaces.std.BramPort_withoutClk[source]
-
class
hwtLib.mem.ram.
Ram_dp
[source]
Bases: hwtLib.mem.ram.Ram_sp
-
_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.mem.ram.
Ram_sp
[source]
Bases: hwt.synthesizer.unit.Unit
Write first variant
-
_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) |
-
connectPort
(port, mem)[source]
Module contents
hwtLib.samples package
Subpackages
hwtLib.samples.arithmetic package
Submodules
hwtLib.samples.arithmetic.cntr module
-
class
hwtLib.samples.arithmetic.cntr.
Cntr
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.arithmetic.selfRefCntr module
-
class
hwtLib.samples.arithmetic.selfRefCntr.
SelfRefCntr
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.arithmetic.twoCntrs module
-
class
hwtLib.samples.arithmetic.twoCntrs.
TwoCntrs
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.arithmetic.widthCasting module
-
class
hwtLib.samples.arithmetic.widthCasting.
WidthCastingExample
[source]
Bases: hwt.synthesizer.unit.Unit
Demonstration of how HWT width conversions are serialized into HDL
-
_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.samples.arithmetic.widthCasting.
WidthCastingExampleTC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
test_basic
()[source]
Module contents
hwtLib.samples.axi package
Submodules
hwtLib.samples.axi.simpleAxiRegs module
-
class
hwtLib.samples.axi.simpleAxiRegs.
SimpleAxiRegs
[source]
Bases: hwt.synthesizer.unit.Unit
Axi litle mapped registers example,
0x0 - reg0
0x4 - reg1
-
_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
Module contents
hwtLib.samples.builders package
Submodules
hwtLib.samples.builders.ethAddrUpdater module
-
class
hwtLib.samples.builders.ethAddrUpdater.
EthAddrUpdater
[source]
Bases: hwt.synthesizer.unit.Unit
This is example unit which reads dst and src addresses(MAC and IPv4)
from ethernet frame stored in memory and writes this addresses
in reverse direction into second frame.
-
_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.samples.builders.handshakedBuilderSimple module
-
class
hwtLib.samples.builders.handshakedBuilderSimple.
HandshakedBuilderSimple
[source]
Bases: hwt.synthesizer.unit.Unit
Simple example of HsBuilder which can build components
for Handshaked interfaces
-
_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.samples.builders.handshakedBuilderSimple.
HandshakedBuilderSimpleTC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
test_passData
()[source]
hwtLib.samples.builders.hsBuilderSplit module
-
class
hwtLib.samples.builders.hsBuilderSplit.
HsBuilderSplit
[source]
Bases: hwt.synthesizer.unit.Unit
Example of HsBuilder.split_* functions
-
_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.samples.builders.pingResponder module
-
class
hwtLib.samples.builders.pingResponder.
PingResponder
[source]
Bases: hwt.synthesizer.unit.Unit
Listen for echo request on rx axi stream interface and respond with echo response on tx interface
Note: | incoming checksum is not checked |
Attention: | you have to ping “ping -s 0 <ip>” because unit ignores additional data in packet and linux by
defaults adds it |
-
_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
-
connect_resp
(resp, forgeIn, sendingReply)[source]
Connect response data on inputs of frame forge
Parameters: |
- resp – registers with response data
- forgeIn – input interface of frame forge
- sendingRepply – flag which signalizes that data should be forged into frame and send
|
-
icmp_checksum
(header)[source]
Note: | we do not need to care about endianity because parser/forge will swap it for us
and we can work with little endians only |
Returns: | checksum for icmp header |
-
req_load
(parsed, regs, freeze)[source]
Load request from parser input into registers
Parameters: |
- parsed – input interface with parsed fields of ICPM frame
- regs – registers for ICMP frame
- freeze – signal to freeze value in registers
- defVal – dictionary item from regs: default value
|
Attention: | dst and src are swapped
|
Module contents
hwtLib.samples.errors package
Submodules
hwtLib.samples.errors.accessingSubunitInternalIntf module
-
class
hwtLib.samples.errors.accessingSubunitInternalIntf.
AccessingSubunitInternalIntf
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.errors.errorsTestCase module
-
class
hwtLib.samples.errors.errorsTestCase.
ErrorsTC
(methodName='runTest')[source]
Bases: unittest.case.TestCase
-
test_accessingSubunitInternalIntf
()[source]
-
test_inconsistentIntfDirection
()[source]
-
test_invalidTypeConnetion
()[source]
-
test_multipleDriversOfChildNet
()[source]
-
test_multipleDriversOfChildNet2
()[source]
-
test_unusedSubunit
()[source]
-
test_unusedSubunit2
()[source]
hwtLib.samples.errors.inconsistentIntfDirection module
-
class
hwtLib.samples.errors.inconsistentIntfDirection.
InconsistentIntfDirection
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.errors.invalidTypeConnetion module
-
class
hwtLib.samples.errors.invalidTypeConnetion.
InvalidTypeConnetion
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.errors.multipleDriversOfChildNet module
-
class
hwtLib.samples.errors.multipleDriversOfChildNet.
ExampleChild
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.errors.multipleDriversOfChildNet.
MultipleDriversOfChildNet
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.errors.multipleDriversOfChildNet.
MultipleDriversOfChildNet2
[source]
Bases: hwtLib.samples.errors.multipleDriversOfChildNet.MultipleDriversOfChildNet
-
_impl
()[source]
implementations
- implement functionality of design there
- called after _declr
hwtLib.samples.errors.unusedSubunit module
-
class
hwtLib.samples.errors.unusedSubunit.
ExampleChild
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.errors.unusedSubunit.
UnusedSubunit
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.errors.unusedSubunit.
UnusedSubunit2
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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
hwtLib.samples.hierarchy package
Submodules
hwtLib.samples.hierarchy.groupOfBlockrams module
-
class
hwtLib.samples.hierarchy.groupOfBlockrams.
GroupOfBlockrams
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.hierarchy.netFilter module
-
class
hwtLib.samples.hierarchy.netFilter.
Exporter
[source]
Bases: hwt.synthesizer.interfaceLevel.emptyUnit.EmptyUnit
-
_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.samples.hierarchy.netFilter.
Filter
[source]
Bases: hwt.synthesizer.interfaceLevel.emptyUnit.EmptyUnit
-
_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
Bases: hwt.synthesizer.interfaceLevel.emptyUnit.EmptyUnit
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
implementations
- implement functionality of design there
- called after _declr
-
class
hwtLib.samples.hierarchy.netFilter.
NetFilter
[source]
Bases: hwt.synthesizer.unit.Unit
This unit has actually no functionality it is just example
of hierarchical design.
-
_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.samples.hierarchy.netFilter.
PatternMatch
[source]
Bases: hwt.synthesizer.interfaceLevel.emptyUnit.EmptyUnit
-
_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.samples.hierarchy.netFilter_serialized module
hwtLib.samples.hierarchy.simpleSubunit module
-
class
hwtLib.samples.hierarchy.simpleSubunit.
SimpleSubunit
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.hierarchy.simpleSubunit2 module
-
class
hwtLib.samples.hierarchy.simpleSubunit2.
SimpleSubunit2
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.hierarchy.simpleSubunit2.
SimpleSubunit2TC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
setUp
()[source]
Hook method for setting up the test fixture before exercising it.
-
test_simplePass
()[source]
hwtLib.samples.hierarchy.simpleSubunit3 module
-
class
hwtLib.samples.hierarchy.simpleSubunit3.
SimpleSubunit3
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.hierarchy.simpleSubunit3.
SimpleSubunit3TC
(methodName='runTest')[source]
Bases: hwtLib.samples.hierarchy.simpleSubunit2.SimpleSubunit2TC
-
setUp
()[source]
Hook method for setting up the test fixture before exercising it.
hwtLib.samples.hierarchy.unitToUnitConnection module
-
class
hwtLib.samples.hierarchy.unitToUnitConnection.
UnitToUnitConnection
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.hierarchy.unitToUnitConnection.
UnitToUnitConnectionTC
(methodName='runTest')[source]
Bases: hwtLib.samples.hierarchy.simpleSubunit2.SimpleSubunit2TC
-
setUp
()[source]
Hook method for setting up the test fixture before exercising it.
Module contents
hwtLib.samples.intfArray package
Submodules
hwtLib.samples.intfArray.interfaceArray0 module
-
class
hwtLib.samples.intfArray.interfaceArray0.
InterfaceArraySample0
[source]
Bases: hwt.synthesizer.unit.Unit
Sample unit with array interface (a and b)
which is not using items of these array interfaces
-
_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.samples.intfArray.interfaceArray0.
InterfaceArraySample0ConcatOnly
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.intfArray.interfaceArray0.
InterfaceArraySample0SliceOnly
[source]
Bases: hwt.synthesizer.unit.Unit
Sample unit with array interface a and three of output interfaces b
-
_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.samples.intfArray.interfaceArray0.
InterfaceArraySample0TC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
setUpUnit
(unitCls)[source]
-
test_InterfaceArraySample0ConcatOnly_simplePass
()[source]
-
test_InterfaceArraySample0SliceOnly_simplePass
()[source]
-
test_InterfaceArraySample0_simplePass
()[source]
hwtLib.samples.intfArray.interfaceArray1 module
-
class
hwtLib.samples.intfArray.interfaceArray1.
InterfaceArraySample1
[source]
Bases: hwt.synthesizer.unit.Unit
Example unit which contains two subuints (u0 and u1)
and two array interfaces (a and b)
first items of this interfaces are connected to u0
second to u1
-
_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.samples.intfArray.interfaceArray1.
InterfaceArraySample1TC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
setUp
()[source]
Hook method for setting up the test fixture before exercising it.
-
test_simplePass
()[source]
-
class
hwtLib.samples.intfArray.interfaceArray1.
SimpleSubunit
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.intfArray.interfaceArray2 module
-
class
hwtLib.samples.intfArray.interfaceArray2.
InterfaceArraySample2
[source]
Bases: hwt.synthesizer.unit.Unit
Example unit which contains two subunits (u0 and u1)
and two array interfaces (a and b)
first items of this interfaces are connected to u0
second to u1
-
_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.samples.intfArray.interfaceArray2.
InterfaceArraySample2TC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
setUp
()[source]
Hook method for setting up the test fixture before exercising it.
-
test_simplePass
()[source]
-
class
hwtLib.samples.intfArray.interfaceArray2.
SimpleSubunit
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.intfArray.interfaceArray3 module
-
class
hwtLib.samples.intfArray.interfaceArray3.
InterfaceArraySample3
[source]
Bases: hwt.synthesizer.unit.Unit
Sample unit with array interface (a and b)
which is not using items of these array interfaces
-
_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.samples.intfArray.interfaceArray3.
InterfaceArraySample3TC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
_test
(u)[source]
-
test_resources
()[source]
-
test_resources_b
()[source]
-
test_simplePass
()[source]
-
test_simplePass_b
()[source]
-
class
hwtLib.samples.intfArray.interfaceArray3.
InterfaceArraySample3b
[source]
Bases: hwtLib.samples.intfArray.interfaceArray3.InterfaceArraySample3
Sample unit with array interface (a and b)
which is not using items of these array interfaces
-
_impl
()[source]
implementations
- implement functionality of design there
- called after _declr
Module contents
hwtLib.samples.mem package
Submodules
hwtLib.samples.mem.ram module
-
class
hwtLib.samples.mem.ram.
SimpleAsyncRam
[source]
Bases: hwt.synthesizer.unit.Unit
Note that there is no such a thing in hw yet…
-
_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.samples.mem.ram.
SimpleSyncRam
[source]
Bases: hwtLib.samples.mem.ram.SimpleAsyncRam
-
_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.samples.mem.reg module
note: | everything in hwtLib.samples is just example
and it is usually more elegant way to do this |
-
class
hwtLib.samples.mem.reg.
AsyncResetReg
[source]
Bases: hwtLib.samples.mem.reg.DReg
-
_impl
()[source]
implementations
- implement functionality of design there
- called after _declr
-
class
hwtLib.samples.mem.reg.
DDR_Reg
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.mem.reg.
DReg
[source]
Bases: hwt.synthesizer.unit.Unit
Basic d flip flop
Attention: | using this unit is pointless because HWToolkit can automatically
generate such a register for any interface and datatype |
-
_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.samples.mem.reg.
DReg_asyncRst
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.mem.reg.
DoubleDReg
[source]
Bases: hwt.synthesizer.unit.Unit
Attention: | using DReg unit instance is pointless because it can be instantiated
by _reg in this unit |
-
_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.samples.mem.reg.
Latch
[source]
Bases: hwt.synthesizer.unit.Unit
Example showing how to implement latch in hwt
-
_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.samples.mem.reg.
OptimizedOutReg
[source]
Bases: hwtLib.samples.mem.reg.DReg
-
_impl
()[source]
implementations
- implement functionality of design there
- called after _declr
hwtLib.samples.mem.rom module
-
class
hwtLib.samples.mem.rom.
SimpleRom
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.mem.rom.
SimpleSyncRom
[source]
Bases: hwtLib.samples.mem.rom.SimpleRom
-
_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
hwtLib.samples.operators package
Submodules
hwtLib.samples.operators.concat module
-
class
hwtLib.samples.operators.concat.
SimpleConcat
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.operators.indexing module
-
class
hwtLib.samples.operators.indexing.
IndexingInernJoin
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.operators.indexing.
IndexingInernRangeSplit
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.operators.indexing.
IndexingInernSplit
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.operators.indexing.
SimpleIndexingJoin
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.operators.indexing.
SimpleIndexingRangeJoin
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.operators.indexing.
SimpleIndexingSplit
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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
hwtLib.samples.rtlLvl package
Subpackages
hwtLib.samples.rtlLvl.arithmetic package
Submodules
hwtLib.samples.rtlLvl.arithmetic.counter module
-
hwtLib.samples.rtlLvl.arithmetic.counter.
Counter
()[source]
hwtLib.samples.rtlLvl.arithmetic.leadingZero module
-
hwtLib.samples.rtlLvl.arithmetic.leadingZero.
LeadingZero
()[source]
Module contents
Submodules
hwtLib.samples.rtlLvl.axiReaderCore module
-
hwtLib.samples.rtlLvl.axiReaderCore.
AxiReaderCore
()[source]
hwtLib.samples.rtlLvl.complexConditions module
-
hwtLib.samples.rtlLvl.complexConditions.
ComplexConditions
()[source]
hwtLib.samples.rtlLvl.indexOps module
-
hwtLib.samples.rtlLvl.indexOps.
IndexOps
()[source]
hwtLib.samples.rtlLvl.netlistToRtl module
-
hwtLib.samples.rtlLvl.netlistToRtl.
netlistToVhdlStr
(name, netlist, interfaces)[source]
hwtLib.samples.rtlLvl.simpleEnum module
-
hwtLib.samples.rtlLvl.simpleEnum.
SimpleEnum
()[source]
hwtLib.samples.rtlLvl.simpleRegister module
-
hwtLib.samples.rtlLvl.simpleRegister.
SimpleRegister
()[source]
hwtLib.samples.rtlLvl.simpleWhile module
-
hwtLib.samples.rtlLvl.simpleWhile.
SimpleWhile
()[source]
hwtLib.samples.rtlLvl.switchStatement module
-
hwtLib.samples.rtlLvl.switchStatement.
SwitchStatement
()[source]
Module contents
hwtLib.samples.statements package
Submodules
hwtLib.samples.statements.constDriver module
-
class
hwtLib.samples.statements.constDriver.
ConstDriverUnit
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.forLoopCntrl module
-
class
hwtLib.samples.statements.forLoopCntrl.
StaticForLoopCntrl
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.fsm module
-
class
hwtLib.samples.statements.fsm.
FsmExample
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.fsm.
HadrcodedFsmExample
[source]
Bases: hwtLib.samples.statements.fsm.FsmExample
-
_impl
()[source]
implementations
- implement functionality of design there
- called after _declr
hwtLib.samples.statements.ifStm module
-
class
hwtLib.samples.statements.ifStm.
IfStatementPartiallyEnclosed
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.ifStm.
SimpleIfStatement
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.ifStm.
SimpleIfStatement2
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.ifStm.
SimpleIfStatement2b
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.ifStm.
SimpleIfStatement2c
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.ifStm.
SimpleIfStatement3
[source]
Bases: hwtLib.samples.statements.ifStm.SimpleIfStatement
-
_impl
()[source]
implementations
- implement functionality of design there
- called after _declr
-
class
hwtLib.samples.statements.ifStm.
SimpleIfStatementMergable
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.ifStm.
SimpleIfStatementMergable1
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.ifStm.
SimpleIfStatementMergable2
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.statements.switchStm module
-
class
hwtLib.samples.statements.switchStm.
SwitchStmUnit
[source]
Bases: hwt.synthesizer.unit.Unit
Example which is using switch statement to create multiplexer
-
_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.samples.statements.vldMaskConflictsResolving module
-
class
hwtLib.samples.statements.vldMaskConflictsResolving.
VldMaskConflictsResolving
[source]
Bases: hwt.synthesizer.unit.Unit
Example how invalid value of condition does not matter when it has no effect on result
-
_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
Submodules
hwtLib.samples.emptyUnitWithSpi module
-
class
hwtLib.samples.emptyUnitWithSpi.
EmptyUnitWithSpi
[source]
Bases: hwt.synthesizer.interfaceLevel.emptyUnit.EmptyUnit
-
_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
-
class
hwtLib.samples.emptyUnitWithSpi.
EmptyUnitWithSpiTC
(methodName='runTest')[source]
Bases: unittest.case.TestCase
-
test_vhdl
()[source]
hwtLib.samples.ipCoreCompatibleWrap module
-
class
hwtLib.samples.ipCoreCompatibleWrap.
ArrayIntfExample
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.parametrization module
-
class
hwtLib.samples.parametrization.
ParametrizationExample
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.showcase0 module
-
class
hwtLib.samples.showcase0.
Showcase0
[source]
Bases: hwt.synthesizer.unit.Unit
Every HW component class has to be derived from Unit class (any kind of inheritance supported)
-
__init__
()[source]
Initialize self. See help(type(self)) for accurate signature.
-
_declr
()[source]
In this function collecting of public interfaces is performed
on every attribute assignment. Instances of Interface or Unit are recognized
by Unit instance and are used as public interface of this unit.
Direction of interfaces is resolved by access from inside of this unit
and you do not have to care about it.
-
_impl
()[source]
Purpose of this method
In this method all public interfaces and configuration
has been made and they can not be edited.
-
hwtLib.samples.showcase0.
foo
(condition0, statements, condition1, fallback0, fallback1)[source]
Python functions used as macro
hwtLib.samples.simple module
-
class
hwtLib.samples.simple.
SimpleUnit
[source]
Bases: hwt.synthesizer.unit.Unit
In order to create a new unit you have to make new class derived from Unit.
-
_declr
()[source]
_declr() is like header of Unit.
There you have to declare things which should be visible from outside.
-
_impl
()[source]
_impl() is like body of unit.
Logic and connections are specified i`qn this function.
hwtLib.samples.simple2withNonDirectIntConnection module
-
class
hwtLib.samples.simple2withNonDirectIntConnection.
Simple2withNonDirectIntConnection
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.simple2withNonDirectIntConnection.
Simple2withNonDirectIntConnectionTC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
test_passData
()[source]
hwtLib.samples.simpleAxiStream module
-
class
hwtLib.samples.simpleAxiStream.
SimpleUnitAxiStream
[source]
Bases: hwt.synthesizer.unit.Unit
Example of unit with axi stream interface
-
_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.samples.simpleWithNonDirectIntConncetion module
-
class
hwtLib.samples.simpleWithNonDirectIntConncetion.
SimpleWithNonDirectIntConncetion
[source]
Bases: hwt.synthesizer.unit.Unit
Example of fact that interfaces does not have to be only extern
the can be used even for connection inside unit
-
_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.samples.simpleWithNonDirectIntConncetion.
SimpleWithNonDirectIntConncetionTC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
test_passData
()[source]
hwtLib.samples.simpleWithParam module
-
class
hwtLib.samples.simpleWithParam.
SimpleUnitWithParam
[source]
Bases: hwt.synthesizer.unit.Unit
Simple parametrized unit.
-
_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.samples.simpleWithParam.
SimpleUnitWithParamTC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
test_canNotSetAfterSynth
()[source]
-
test_simple
()[source]
hwtLib.samples.timers module
-
class
hwtLib.samples.timers.
DynamicCounterInstancesExample
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.timers.
TimerInfoTest
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.samples.timers.
TimerTC
(methodName='runTest')[source]
Bases: hwt.simulator.simTestCase.SimTestCase
-
test_basic
()[source]
-
test_dynamic_simple
()[source]
-
class
hwtLib.samples.timers.
TimerTestUnit
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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
hwtLib.sim package
Submodules
hwtLib.sim.abstractMemSpaceMaster module
-
class
hwtLib.sim.abstractMemSpaceMaster.
AbstractMemSpaceMaster
(bus, registerMap)[source]
Bases: hwtLib.sim.abstractMemSpaceMaster.MemorySpaceItemStruct
Abstraction over bus interface which converts it to memory space
from where you can read or write
-
__init__
(bus, registerMap)[source]
Initialize self. See help(type(self)) for accurate signature.
-
_mask
(start, width)[source]
-
_read
(addr, size, onDone=None)[source]
Add read transaction to agent of interface
:param addr: address value on bus to read froms
:param size: size of data to read in bites
:param onDone: on read done callback function(sim) -> None
-
_write
(addr, size, data, mask, onDone=None)[source]
Add write transaction to agent of interface
Parameters: |
- addr – address value on bus to write on
- size – size of data to write in bites
- data – data to write on bus
- onDone – on write done callback function(sim) -> None
|
-
parse_responses
()[source]
Parse responses after sim
-
class
hwtLib.sim.abstractMemSpaceMaster.
MemorySpaceItem
(memHandler, transTmpl, offset=0)[source]
Bases: object
Abstraction over place in memory, allows you read and write data to/from this space
-
__init__
(memHandler, transTmpl, offset=0)[source]
Initialize self. See help(type(self)) for accurate signature.
-
_add_read_resp
(resp)[source]
-
_add_write_resp
(resp)[source]
-
read
(onDone=None)[source]
read data from place in memory
-
write
(data, onDone=None)[source]
write data to place in memory
-
class
hwtLib.sim.abstractMemSpaceMaster.
MemorySpaceItemArr
(memHandler, transTmpl, offset=0)[source]
Bases: object
Abstraction over place in memory, allows you read and write data
to/from this space
-
__init__
(memHandler, transTmpl, offset=0)[source]
Initialize self. See help(type(self)) for accurate signature.
-
class
hwtLib.sim.abstractMemSpaceMaster.
MemorySpaceItemStruct
(memHandler, transTmpl, offset=0)[source]
Bases: object
-
__init__
(memHandler, transTmpl, offset=0)[source]
Initialize self. See help(type(self)) for accurate signature.
-
_decorateWithRegisters
(memHandler, structT)[source]
Decorate this object with attributes from memory space
(name is same as specified in register map)
Parameters: |
- memHandler – instance of AbstractMemSpaceMaster(subclass of)
- structT – instance of HStruct or TransTmpl used as template
|
-
class
hwtLib.sim.abstractMemSpaceMaster.
PartialField
(originalField)[source]
Bases: object
HStruct field made from proxy interface
-
__init__
(originalField)[source]
Initialize self. See help(type(self)) for accurate signature.
Module contents
hwtLib.spi package
Submodules
hwtLib.spi.intf module
-
class
hwtLib.spi.intf.
QSPI
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.spi.intf.SpiTristate
SPI interface with 4 tristate data wires
-
_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
-
class
hwtLib.spi.intf.
Spi
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
Bare SPI interface (Serial peripheral interface)
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.spi.intf.
SpiAgent
(intf, allowNoReset=False)[source]
Bases: hwt.simulator.agentBase.SyncAgentBase
Simulation agent for SPI interface
Variables: |
- txData – data to transceive container
- rxData – received data
- chipSelects – values of chip select
|
chipSelects, rxData and txData are lists of integers
-
BITS_IN_WORD
= 8
-
__init__
(intf, allowNoReset=False)[source]
Initialize self. See help(type(self)) for accurate signature.
-
driverRx
(sim)[source]
-
driverTx
(s)[source]
-
getDrivers
()[source]
Called before simulation to collect all drivers of interfaces
from this agent
-
getMonitors
()[source]
Called before simulation to collect all monitors of interfaces
from this agent
-
mergeBits
(bits)[source]
-
monitorRx
(sim)[source]
-
monitorTx
(sim)[source]
-
readRxSig
(sim, sig)[source]
-
setEnable
(en)[source]
-
splitBits
(v)[source]
-
writeTxSig
(sim, sig)[source]
-
class
hwtLib.spi.intf.
SpiTristate
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.spi.intf.Spi
SPI interface where mosi and miso signal are merged into one tristate wire
-
_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
hwtLib.spi.master module
-
class
hwtLib.spi.master.
SpiCntrlData
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwtLib.handshaked.intfBiDirectional.HandshakedBiDirectional
HandshakedBiDirectional interface with last and slave signal added.
If last=1 slave will be deselected and initial slave select wait will be.
Slave selects the slave where data should be read from and written to.
-
_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
-
_initSimAgent
()[source]
-
class
hwtLib.spi.master.
SpiCntrlDataAgent
(intf)[source]
Bases: hwtLib.handshaked.intfBiDirectional.HandshakedBiDirectionalAgent
-
doRead
(s)[source]
extract data from interface
-
doWrite
(s, data)[source]
write data to interface
-
class
hwtLib.spi.master.
SpiMaster
[source]
Bases: hwt.synthesizer.unit.Unit
Master for SPI interface
Variables: |
- SPI_FREQ_PESCALER – frequency prescaler to get SPI clk from main clk (Param)
- SS_WAIT_CLK_TICKS – number of SPI ticks to wait with SPI clk activation after slave select
- HAS_TX – if set true write part will be instantiated
- HAS_RX – if set true read part will be instantiated
|
Attention: | this implementation expects that slaves are reading data on rising edge of SPI clk
and data from slaves are ready on risign edge as well
and SPI clk is kept high in idle
(most of them does but there are some exceptions)
|
-
_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
-
readPart
(readTick)[source]
-
spiClkGen
(requiresInitWait, en)[source]
create clock generator for SPI
writeTick is 1 on falling edge of spi clk
readTick is 1 on rising edge of spi clk
Returns: | tuple of tick signals (if data should be send, if data should be read) |
-
writePart
(writeTick, isLastTick, data)[source]
Module contents
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
|
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)
|
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
hwtLib.types package
Subpackages
hwtLib.types.net package
Submodules
hwtLib.types.net.arp module
-
class
hwtLib.types.net.arp.
ARP_HW_TYPE
[source]
Bases: object
-
ARP_SEC
= 32
-
ETHERNET
= 1
-
FIBRE_CHANNEL
= 18
-
FRAME_RELAY
= 15
-
INIFNIBAND
= 32
-
IP_SEC_TUNNEL
= 31
-
class
hwtLib.types.net.arp.
ARP_OPTCODE
[source]
Bases: object
-
ARP_NAK
= 10
-
class
DRARP
[source]
Bases: object
-
ERROR
= 7
-
REPLY
= 6
-
REQUEST
= 5
-
IN_ARP_REPLY
= 9
-
IN_ARP_REQUEST
= 8
-
MAPOS_UNARP
= 23
-
class
MARS
[source]
Bases: object
-
GROUPLIST_REPLY
= 21
-
GROUPLIST_REQUEST
= 20
-
JOIN
= 14
-
LEAVE
= 15
-
MSERV
= 13
-
MULTI
= 12
-
NAK
= 16
-
REDIRECT_MAP
= 22
-
REQUEST
= 11
-
SJOIN
= 18
-
SLEAVE
= 19
-
UNSERV
= 17
-
OP_EXP1
= 24
-
OP_EXP2
= 25
-
REPLY
= 2
-
REQUEST
= 1
-
REQUEST_REVERSE
= 3
hwtLib.types.net.dpdk module
hwtLib.types.net.eth module
-
class
hwtLib.types.net.eth.
ETHER_TYPE
[source]
Bases: object
-
ARP
= 2054
-
IPX
= 33079
-
IPX_b
= 33080
-
IPv4
= 2048
-
IPv6
= 34525
-
MPLS_multicast
= 34888
-
MPLS_unicast
= 34887
-
QNX_qnet
= 33284
-
WoL
= 2114
-
hwtLib.types.net.eth.
parse_eth_addr
(macStr)[source]
-
hwtLib.types.net.eth.
pprint_eth_addr
(mac)[source]
hwtLib.types.net.icmp module
-
class
hwtLib.types.net.icmp.
ICMP_TYPE
[source]
Bases: object
-
DESTINATION_UNREACHABLE
= 3
-
ECHO_REPLY
= 0
-
ECHO_REQUEST
= 8
-
PARAMETER_PROBLE
= 12
-
REDIRECT
= 5
-
ROUTER_ADVERTISEMENT
= 9
-
ROUTER_SOLICITATION
= 10
-
TIMESTAMP
= 13
-
TIMESTAMP_REPLY
= 14
-
TIME_EXCEEDED
= 11
-
TRACEROUTE
= 30
hwtLib.types.net.ip module
-
class
hwtLib.types.net.ip.
IP_FLAGS
[source]
Bases: object
-
DONT_FRAGMENT
= 2
-
MORE_FRAGMENTS
= 4
-
class
hwtLib.types.net.ip.
IP_PROTOCOL
[source]
Bases: object
-
EGP
= 8
-
ENCAP
= 41
-
ETHERIP
= 97
-
GGP
= 3
-
HOPOPT
= 0
-
ICMP
= 1
-
IGMP
= 2
-
IGP
= 9
-
IPIP
= 94
-
IPv4
= 4
-
IPv6_ICMP
= 58
-
IPv6_frag
= 44
-
IPv6_noNxt
= 59
-
IPv6_opts
= 60
-
IPv6_route
= 43
-
L2TP
= 115
-
OSPF
= 89
-
QNX
= 106
-
SCTP
= 132
-
SMP
= 121
-
TCP
= 6
-
UDP
= 17
hwtLib.types.net.tcp module
-
class
hwtLib.types.net.tcp.
TCP_FLAGS
[source]
Bases: object
-
ACK
= 4
-
CWR
= 7
-
ECN
= 6
-
FIN
= 0
-
PSH
= 3
-
RST
= 2
-
SYN
= 1
-
URG
= 5
hwtLib.types.net.udp module
Module contents
Submodules
hwtLib.types.ctypes module
Module contents
hwtLib.uart package
Submodules
hwtLib.uart.intf module
-
class
hwtLib.uart.intf.
IP_Uart
[source]
Bases: hwt.serializer.ip_packager.interfaces.intfConfig.IntfConfig
-
__init__
()[source]
Initialize self. See help(type(self)) for accurate signature.
-
class
hwtLib.uart.intf.
Uart
(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]
Bases: hwt.synthesizer.interface.Interface
-
_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
-
_getIpCoreIntfClass
()[source]
hwtLib.uart.rx module
-
class
hwtLib.uart.rx.
UartRx
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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.uart.tx module
-
class
hwtLib.uart.tx.
UartTx
[source]
Bases: hwt.synthesizer.unit.Unit
-
_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
Module contents
Module contents