hwt.synthesizer.interfaceLevel package¶
interfaceLevel is responsible for manipulation of high-level interfaces.
Submodules¶
hwt.synthesizer.interfaceLevel.directionFns module¶
hwt.synthesizer.interfaceLevel.getDefaultClkRts module¶
- hwt.synthesizer.interfaceLevel.getDefaultClkRts.getClk(module: HwModuleBase)[source]¶
Get clock signal from unit instance
- hwt.synthesizer.interfaceLevel.getDefaultClkRts.getRst(module: HwModuleBase)[source]¶
Get reset signal from unit instance
hwt.synthesizer.interfaceLevel.hwModuleImplHelpers module¶
hwt.synthesizer.interfaceLevel.implDependent module¶
- class hwt.synthesizer.interfaceLevel.implDependent.HwIOImplDependentFns[source]¶
Bases:
objectHwIO functions which have high potential to be overloaded in concrete interface implementation
- _getAssociatedClk()[source]¶
If interface has associated clk return it otherwise try to find clk on parent recursively
hwt.synthesizer.interfaceLevel.propDeclrCollector module¶
- class hwt.synthesizer.interfaceLevel.propDeclrCollector.MakeClkRstAssociations(module: HwModule, clk=None, rst=None)[source]¶
Bases:
objectAll newly added interfaces will be associated with clk, rst specified in constructor of this object.
Bases:
objectAll newly added interfaces and units will share all parametes with unit specified in constructor of this object.
- class hwt.synthesizer.interfaceLevel.propDeclrCollector.PropDeclrCollector[source]¶
Bases:
objectClass which manages the registration of components and interfaces in specified elaboration phases.
It uses __setattr__ listeners to detect new properties and then calls a listener function to process the registration.
Used for HwModule, HwIO classes to detect and load interfaces and components.
- _associated(clk=None, rst=None) MakeClkRstAssociations[source]¶
associate newly added interfaces to “self” with selected clk, rst (if interface is not associated agents try to find clk/rst by _getAssociatedClk/_getAssociatedRst which will search for any clk/rst on parent recursively) Usage:
with self._associated(clk=self.myClk, rst=self.myRst): self.myAxi = Axi4Stream() # this interface is associated with myClk and myRst # simulation agents and component builders will use them
- Parameters:
exclude – params which should not be shared
Auto-propagate params by name to child components and interfaces Usage:
with self._hwParamsShared(): # your interfaces and unit which should share all params with "self" there
- Parameters:
exclude – tuple (src param names to exclude, dst param names to exclude)
prefix – prefix which should be added to name of child parameters before parameter name matching
- _registerArray(name: str | None, items: HObjList[Self], onParentPropertyPath: TypePath)[source]¶
Register array of items on interface level object
- _registerArray_append(arr: HObjList[Self], item: Self, index: int)[source]¶
Register a single object in the list
- _registerHwIO(hwIOName: str, hwIO: HwIOBase, onParentPropertyPath: TypePath, isPrivate: bool)[source]¶
Register HwIO object on interface level object
- _registerHwIOInHwImpl(hwIOName: str, hwio: HwIOBase, onParentPropertyPath: TypePath)[source]¶
Register interface in implementation phase
- _registerParameter(pName: str, parameter: HwParam) None[source]¶
Register HwParam object on interface level object
- _registerSubmodule(mName: str, submodule: HwModule, onParentPropertyPath: TypePath)[source]¶
Register unit object on interface level object
- _registerSubmoduleInImpl(name: str, m: HwModuleBase, onParentPropertyPath: TypePath)[source]¶
- Attention:
unit has to be parametrized before it is registered (some components can change interface by parametrization)
- _updateHwParamsFrom(otherObj: PropDeclrCollector, updater: Callable[[PropDeclrCollector, HwParam, HwParam], None], exclude: Tuple[Set[str], Set[str]] | None, prefix: str) PropDeclrCollector[source]¶
Update all parameters which are defined on self from otherObj
- Parameters:
otherObj – other object which HwParam instances should be updated
updater – updater function(self, myParameter, otherParameter)
exclude – tuple of set of param names for src and dst which which should be excluded
prefix – prefix which should be added to name of paramters of this object before matching parameter name on parent
- hwConfig() None[source]¶
Configure object parameters
setup all parameters on this object, use HwParam class instances to allow use of parameter inheritance
called in __init__ of class
- hwDeclr() None[source]¶
In this function user should specify the declaration of interfaces for communication with outside word. It is also better to declare sub components there as it allows for better parallelization during the build.
_declr method is called after _config
if this object is
hwt.hwModule.HwModuleall interfaces are treated as externally accessible interfaces if this object is HwIO instance all subinterfaces are loaded as well
- hwt.synthesizer.interfaceLevel.propDeclrCollector.nameAvailabilityCheck(obj: PropDeclrCollector, propName: str, prop: object)[source]¶
Check if not redefining property on obj but allow to cast current property to a HwParam
hwt.synthesizer.interfaceLevel.utils module¶
- hwt.synthesizer.interfaceLevel.utils.HwIO_connectPacked(srcPacked: RtlSignalBase, dstInterface: HwIOBase | RtlSignalBase, exclude: Container[HwIOBase | RtlSignalBase] | None = None)[source]¶
Connect 1D vector signal to this structuralized interface (LSB of first interface is LSB of result)
- Parameters:
packedSrc – vector which should be connected
dstInterface – structuralized interface where should packedSrc be connected to
exclude – sub interfaces of self which should be excluded
- hwt.synthesizer.interfaceLevel.utils.HwIO_pack(hio: HwIOBase, masterDirEqTo=DIRECTION.OUT, exclude: Container[HwIOBase | RtlSignalBase] | None = None) HBitsConst | RtlSignalBase[HBits][source]¶
Concatenate all signals to one big signal, recursively (LSB of first interface is LSB of result)
- Parameters:
masterDirEqTo – only signals with this direction are packed
exclude – sequence of signals/interfaces to exclude