hwtLib.examples.arithmetic package

Submodules

hwtLib.examples.arithmetic.cntr module

class hwtLib.examples.arithmetic.cntr.Cntr(hdlName: str | None = None)[source]

Bases: HwModule

HDL params:
  • DATA_WIDTH - default value 2 of type int

HDL IO:
  • clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE

  • rst - of type hwt.hwIOs.std.HwIORst with dtype=<HBits, 1bit> - SLAVE

  • en - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - SLAVE

  • val - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 2bits> - MASTER

schematic
__annotations__ = {}

hwtLib.examples.arithmetic.multiplierBooth module

class hwtLib.examples.arithmetic.multiplierBooth.MultiplierBooth(hdlName: str | None = None)[source]

Bases: HwModule

An implementation of Booth’s multiplication algorithm

_images/MultiplierBooth_fsm.png
max = 2 ** (DATA_WIDTH - 1) - 1
min = -1 * 2 ** (DATA_WIDTH - 1)
HDL params:
  • DATA_WIDTH - default value 4 of type int

  • RESULT_WIDTH - default value None of type None

HDL IO:
  • clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE

  • rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE

  • dataIn - of type hwtLib.examples.arithmetic.multiplierBooth.TwoOperandsHs - SLAVE

  • dataOut - of type hwt.hwIOs.std.HwIODataRdVld - MASTER

schematic
__annotations__ = {}
class hwtLib.examples.arithmetic.multiplierBooth.TwoOperandsHs(masterDir=DIRECTION.OUT, hdlName: str | dict[str, str] | None = None, loadConfig=True)[source]

Bases: HwIODataRdVld

__annotations__ = {}
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.examples.arithmetic.multiplierBooth.TwoOperandsHsAgent(sim: HdlSimulator, hwIO: HwIODataRdVld, allowNoReset=False)[source]

Bases: HwIODataRdVldAgent

__annotations__ = {}
get_data()[source]

extract data from interface

set_data(data)[source]

write data to interface

hwtLib.examples.arithmetic.privateSignals module

class hwtLib.examples.arithmetic.privateSignals.PrivateSignalsOfStructType(hdlName: str | None = None)[source]

Bases: HwModule

__annotations__ = {}
connect_tmp_chain(tmp, a_in, a_out)[source]

hwtLib.examples.arithmetic.selfRefCntr module

class hwtLib.examples.arithmetic.selfRefCntr.SelfRefCntr(hdlName: str | None = None)[source]

Bases: HwModule

HDL IO:
  • clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE

  • rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE

  • dout - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 8bits, unsigned> - MASTER

schematic
__annotations__ = {}

hwtLib.examples.arithmetic.twoCntrs module

class hwtLib.examples.arithmetic.twoCntrs.TwoCntrs(hdlName: str | None = None)[source]

Bases: HwModule

HDL IO:
  • clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE

  • rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE

  • a_en - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - SLAVE

  • b_en - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - SLAVE

  • eq - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - MASTER

  • ne - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - MASTER

  • lt - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - MASTER

  • gt - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 1bit> - MASTER

schematic
__annotations__ = {}

hwtLib.examples.arithmetic.vhdl_vector_auto_casts module

class hwtLib.examples.arithmetic.vhdl_vector_auto_casts.VhdlVectorAutoCastExample(hdlName: str | None = None)[source]

Bases: HwModule

__annotations__ = {}
class hwtLib.examples.arithmetic.vhdl_vector_auto_casts.VhdlVectorAutoCastExampleTC(methodName='runTest')[source]

Bases: BaseSerializationTC

__FILE__ = '/home/docs/checkouts/readthedocs.org/user_builds/hwtlib/checkouts/latest/hwtLib/examples/arithmetic/vhdl_vector_auto_casts.py'
__annotations__ = {}
_classSetupFailed = False
_class_cleanups = []
test_vhdl()[source]

hwtLib.examples.arithmetic.widthCasting module

class hwtLib.examples.arithmetic.widthCasting.WidthCastingExample(hdlName: str | None = None)[source]

Bases: HwModule

Demonstration of how HWT width conversions are serialized into HDL

HDL IO:
  • clk - of type hwt.hwIOs.std.HwIOClk with dtype=<HBits, 1bit> - SLAVE

  • rst_n - of type hwt.hwIOs.std.HwIORst_n with dtype=<HBits, 1bit, n> - SLAVE

  • a - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 8bits> - SLAVE

  • b - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 11bits> - SLAVE

  • c - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 12bits> - MASTER

  • d - of type hwt.hwIOs.std.HwIOSignal with dtype=<HBits, 8bits> - MASTER

schematic
__annotations__ = {}
class hwtLib.examples.arithmetic.widthCasting.WidthCastingExampleTC(methodName='runTest')[source]

Bases: SimTestCase

__annotations__ = {}
_classSetupFailed = False
_class_cleanups = []
classmethod setUpClass()[source]

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

test_basic()[source]