hwtLib.handshaked package

Submodules

hwtLib.handshaked.builder module

class hwtLib.handshaked.builder.HsBuilder(parent, srcInterface, name=None)[source]

Bases: hwtLib.abstract.streamBuilder.AbstractStreamBuilder

Helper class which simplifies building of large stream paths

FifoCls

alias of hwtLib.handshaked.fifo.HandshakedFifo

JoinExplicitCls = NotImplemented
JoinFairCls

alias of hwtLib.handshaked.joinFair.HsJoinFairShare

JoinPrioritizedCls

alias of hwtLib.handshaked.joinPrioritized.HsJoinPrioritized

RegCls

alias of hwtLib.handshaked.reg.HandshakedReg

ResizerCls

alias of hwtLib.handshaked.resizer.HsResizer

SplitCopyCls

alias of hwtLib.handshaked.splitCopy.HsSplitCopy

SplitFairCls

alias of hwtLib.handshaked.splitFair.HsSplitFair

SplitPrioritizedCls

alias of hwtLib.handshaked.splitPrioritized.HsSplitPrioritized

SplitSelectCls

alias of hwtLib.handshaked.splitSelect.HsSplitSelect

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

_images/aafig-49cd0e8c709b1b2ad9f041a899131a3abc2b4b64.gif
_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

_images/aafig-aa623a62afb1d491649b672854cd192c7becd21e.gif
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

_images/aafig-aa623a62afb1d491649b672854cd192c7becd21e.gif
_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

_images/aafig-f721a624c332dc34009a9c5fa0e84833c0014d30.gif
_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