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
clk - of type hwt.interfaces.std.Clk with dtype=<Bits, 1bit> - SLAVE
rst - of type hwt.interfaces.std.Rst with dtype=<Bits, 1bit> - SLAVE
en - of type hwt.interfaces.std.Signal with dtype=<Bits, 1bit> - SLAVE
val - of type hwt.interfaces.std.Signal with dtype=<Bits, 2bits> - MASTER
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
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.interfaces.std.Clk with dtype=<Bits, 1bit> - SLAVE
rst_n - of type hwt.interfaces.std.Rst_n with dtype=<Bits, 1bit> - SLAVE
dataIn - of type hwtLib.examples.arithmetic.multiplierBooth.TwoOperandsHs - SLAVE
dataOut - of type hwt.interfaces.std.Handshaked - MASTER
- class hwtLib.examples.arithmetic.multiplierBooth.TwoOperandsHs(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]¶
Bases:
Handshaked
hwtLib.examples.arithmetic.privateSignals module¶
hwtLib.examples.arithmetic.selfRefCntr module¶
- class hwtLib.examples.arithmetic.selfRefCntr.SelfRefCntr(hdl_name_override: Optional[str] = None)[source]¶
Bases:
Unit
- HDL IO
clk - of type hwt.interfaces.std.Clk with dtype=<Bits, 1bit> - SLAVE
rst_n - of type hwt.interfaces.std.Rst_n with dtype=<Bits, 1bit> - SLAVE
dout - of type hwt.interfaces.std.Signal with dtype=<Bits, 8bits, unsigned> - MASTER
hwtLib.examples.arithmetic.twoCntrs module¶
- class hwtLib.examples.arithmetic.twoCntrs.TwoCntrs(hdl_name_override: Optional[str] = None)[source]¶
Bases:
Unit
- HDL IO
clk - of type hwt.interfaces.std.Clk with dtype=<Bits, 1bit> - SLAVE
rst_n - of type hwt.interfaces.std.Rst_n with dtype=<Bits, 1bit> - SLAVE
a_en - of type hwt.interfaces.std.Signal with dtype=<Bits, 1bit> - SLAVE
b_en - of type hwt.interfaces.std.Signal with dtype=<Bits, 1bit> - SLAVE
eq - of type hwt.interfaces.std.Signal with dtype=<Bits, 1bit> - MASTER
ne - of type hwt.interfaces.std.Signal with dtype=<Bits, 1bit> - MASTER
lt - of type hwt.interfaces.std.Signal with dtype=<Bits, 1bit> - MASTER
gt - of type hwt.interfaces.std.Signal with dtype=<Bits, 1bit> - MASTER
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'¶
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
clk - of type hwt.interfaces.std.Clk with dtype=<Bits, 1bit> - SLAVE
rst_n - of type hwt.interfaces.std.Rst_n with dtype=<Bits, 1bit> - SLAVE
a - of type hwt.interfaces.std.Signal with dtype=<Bits, 8bits> - SLAVE
b - of type hwt.interfaces.std.Signal with dtype=<Bits, 11bits> - SLAVE
c - of type hwt.interfaces.std.Signal with dtype=<Bits, 12bits> - MASTER
d - of type hwt.interfaces.std.Signal with dtype=<Bits, 8bits> - MASTER