hwtLib.examples.arithmetic package

Submodules

hwtLib.examples.arithmetic.cntr module

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

Bases: Unit

HDL params
  • DATA_WIDTH - default value 2 of type int

HDL IO
schematic

hwtLib.examples.arithmetic.multiplierBooth module

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

Bases: Unit

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
schematic
class hwtLib.examples.arithmetic.multiplierBooth.TwoOperandsHs(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Handshaked

_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.examples.arithmetic.multiplierBooth.TwoOperandsHsAgent(sim: HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: HandshakedAgent

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(hdl_name_override: Optional[str] = None)[source]

Bases: Unit

connect_tmp_chain(tmp, a_in, a_out)[source]

hwtLib.examples.arithmetic.selfRefCntr module

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

Bases: Unit

HDL IO
schematic

hwtLib.examples.arithmetic.twoCntrs module

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

Bases: Unit

HDL IO
schematic

hwtLib.examples.arithmetic.vhdl_vector_auto_casts module

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

Bases: Unit

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'
test_vhdl()[source]

hwtLib.examples.arithmetic.widthCasting module

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

Bases: Unit

Demonstration of how HWT width conversions are serialized into HDL

HDL IO
schematic
class hwtLib.examples.arithmetic.widthCasting.WidthCastingExampleTC(methodName='runTest')[source]

Bases: SimTestCase

classmethod setUpClass()[source]

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

test_basic()[source]