hwtLib.examples.hierarchy package

Submodules

hwtLib.examples.hierarchy.extractHierarchy module

class hwtLib.examples.hierarchy.extractHierarchy.ExtractedUnit(externInputs: UniqList[RtlSignal], externObjsToExtract: UniqList[Union[RtlSignal, Operator]], externOutputs: UniqList[RtlSignal], hdl_name_override: Optional[str] = None)[source]

Bases: Unit

An unit which will extract selected circuit from parent on instantiation.

__init__(externInputs: UniqList[RtlSignal], externObjsToExtract: UniqList[Union[RtlSignal, Operator]], externOutputs: UniqList[RtlSignal], hdl_name_override: Optional[str] = None)[source]
_handleUpdateForOutput(o: RtlSignal, translation: Dict[RtlSignal, RtlSignal], interOuts: Dict[RtlSignal, RtlSignal], outerIoMap: Dict[RtlSignal, RtlSignal], toTranslate: Deque[Union[Operator, HdlStatement, HdlPortItem]])[source]
_moveOrCopyCircuitFromParent(translation: Dict[RtlSignal, RtlSignal], interOuts: Dict[RtlSignal, RtlSignal], outerIoMap: Dict[RtlSignal, RtlSignal])[source]
_signalsForSubUnitEntity(context: RtlNetlist, prefix: str)[source]

generate signals in this context for all ports of this subunit

hwtLib.examples.hierarchy.extractHierarchy.consumeExpr(e: Union[RtlSignal, HValue], inputs: UniqList[RtlSignal], seenObjs: UniqList[Union[RtlSignal, Operator]])[source]

To make output code readable we must extract also expressions used in statements if they are private to selected statements.

Note

Walk from endpoint to a driver. For every signal on path if all its endpoints are in seenObjs, add this to seenObjs and continue search on its drivers.

hwtLib.examples.hierarchy.extractHierarchy.extractNetlistPartToSubunit(inputs: UniqList[RtlSignal], outputs: UniqList[RtlSignal], priv: UniqList[Union[RtlSignal, Operator]]) ExtractedUnit[source]
Attention

extraction is executed on unit instantiation

Attention

each object in priv must be reachable from inputs

hwtLib.examples.hierarchy.extractHierarchy.extractRegsToSubunit(regs: Sequence[RtlSyncSignal]) ExtractedUnit[source]

hwtLib.examples.hierarchy.extractHierarchyExamples module

class hwtLib.examples.hierarchy.extractHierarchyExamples.UnitWidthDynamicallyGeneratedSubunitsForManyRegisters(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

class hwtLib.examples.hierarchy.extractHierarchyExamples.UnitWidthDynamicallyGeneratedSubunitsForRegisters(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

class hwtLib.examples.hierarchy.extractHierarchyExamples.UnitWidthDynamicallyGeneratedSubunitsForRegistersWithExpr(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

hwtLib.examples.hierarchy.groupOfBlockrams module

class hwtLib.examples.hierarchy.groupOfBlockrams.GroupOfBlockrams(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

HDL params
  • ADDR_WIDTH - default value 8 of type int

  • DATA_WIDTH - default value 64 of type int

HDL IO
HDL components
schematic

hwtLib.examples.hierarchy.netFilter module

class hwtLib.examples.hierarchy.netFilter.Exporter(hdl_name_override: Optional[str] = None)[source]

Bases: EmptyUnit

class hwtLib.examples.hierarchy.netFilter.Filter(hdl_name_override: Optional[str] = None)[source]

Bases: EmptyUnit

class hwtLib.examples.hierarchy.netFilter.HeadFieldExtractor(hdl_name_override: Optional[str] = None)[source]

Bases: EmptyUnit

class hwtLib.examples.hierarchy.netFilter.NetFilter(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

This unit has actually no functionality it is just example of hierarchical design.

HDL params
  • DATA_WIDTH - default value 64 of type int

HDL IO
HDL components
schematic
class hwtLib.examples.hierarchy.netFilter.PatternMatch(hdl_name_override: Optional[str] = None)[source]

Bases: EmptyUnit

hwtLib.examples.hierarchy.rippleadder module

class hwtLib.examples.hierarchy.rippleadder.FullAdder(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

HDL IO
schematic
class hwtLib.examples.hierarchy.rippleadder.RippleAdder0(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

HDL params
  • p_wordlength - default value 4 of type int

HDL IO
HDL components
schematic
class hwtLib.examples.hierarchy.rippleadder.RippleAdder1(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

HDL params
  • p_wordlength - default value 4 of type int

HDL IO
HDL components
schematic
class hwtLib.examples.hierarchy.rippleadder.RippleAdder2(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

HDL params
  • p_wordlength - default value 4 of type int

HDL IO
HDL components
schematic
class hwtLib.examples.hierarchy.rippleadder.RippleAdder3(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

HDL params
  • p_wordlength - default value 4 of type int

HDL IO
HDL components
schematic

hwtLib.examples.hierarchy.simpleSubunit module

class hwtLib.examples.hierarchy.simpleSubunit.SimpleSubunit(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

HDL IO
HDL components
schematic

hwtLib.examples.hierarchy.simpleSubunit2 module

class hwtLib.examples.hierarchy.simpleSubunit2.SimpleSubunit2(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

HDL params
  • USE_STRB - default value True of type bool

HDL IO
HDL components
schematic
class hwtLib.examples.hierarchy.simpleSubunit2.SimpleSubunit2TC(methodName='runTest')[source]

Bases: SimTestCase

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

test_simplePass()[source]

hwtLib.examples.hierarchy.simpleSubunit3 module

class hwtLib.examples.hierarchy.simpleSubunit3.SimpleSubunit3(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

HDL params
  • DATA_WIDTH - default value 128 of type int

  • USE_STRB - default value True of type bool

HDL IO
HDL components
schematic
class hwtLib.examples.hierarchy.simpleSubunit3.SimpleSubunit3TC(methodName='runTest')[source]

Bases: SimpleSubunit2TC

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

hwtLib.examples.hierarchy.unitToUnitConnection module

class hwtLib.examples.hierarchy.unitToUnitConnection.UnitToUnitConnection(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

HDL params
  • DATA_WIDTH - default value 8 of type int

  • USE_STRB - default value True of type bool

HDL IO
HDL components
schematic
class hwtLib.examples.hierarchy.unitToUnitConnection.UnitToUnitConnectionTC(methodName='runTest')[source]

Bases: SimpleSubunit2TC

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

hwtLib.examples.hierarchy.unitWrapper module

class hwtLib.examples.hierarchy.unitWrapper.UnitWrapper(baseUnit: Unit)[source]

Bases: Unit

Class which creates wrapper around original unit instance, original unit will be stored inside as subunit named baseUnit

Note

This is example of lazy loaded interfaces and generating of external interfaces based on internal structure.

__init__(baseUnit: Unit)[source]
Parameters

baseUnit – An hwt.synthesizer.unit.Unit instance which should be hidden in this wrapper.

_connectBaseUnitToThisWrap(origToWrapInfMap)[source]
_copyParamsAndInterfaces()[source]
_getDefaultName()[source]
_get_hdl_doc()[source]