hwtLib.logic.binToOneHot.
BinToOneHot
[source]¶Bases: hwt.synthesizer.unit.Unit
_config
()[source]¶Configure object parameters
_declr
()[source]¶declarations
_serializeDecision
(parentUnit, obj, isDeclaration, priv)¶Decide to serialize only objs with uniq parameters and class
Parameters: | priv – private data for this function ({frozen_params: obj}) |
---|---|
Returns: | tuple (do serialize this object, next priv) |
hwtLib.logic.bitonicSorter.
BitonicSorter
(cmpFn=<function BitonicSorter.<lambda>>)[source]¶Bases: hwt.synthesizer.unit.Unit
__init__
(cmpFn=<function BitonicSorter.<lambda>>)[source]¶Parameters: | cmpFn – function (item0, item1) if returns true, items are not swaped |
---|
_config
()[source]¶Configure object parameters
hwtLib.logic.cntrGray.
GrayCntr
[source]¶Bases: hwt.synthesizer.unit.Unit
_config
()[source]¶Configure object parameters
_declr
()[source]¶declarations
_serializeDecision
(parentUnit, obj, isDeclaration, priv)¶Decide to serialize only objs with uniq parameters and class
Parameters: | priv – private data for this function ({frozen_params: obj}) |
---|---|
Returns: | tuple (do serialize this object, next priv) |
hwtLib.logic.crc.
Crc
[source]¶Bases: hwt.synthesizer.unit.Unit
Crc generator for any crc polynom can be string in usual format or integer f.e.”x^3+x+1” or 0b1011
_config
()[source]¶Configure object parameters
hwtLib.logic.crcComb.
CrcComb
[source]¶Bases: hwt.synthesizer.unit.Unit
CRC generator polynomial can be string in usual format or integer (f.e.”x^3+x+1” or 0b1011)
Attention: | Input not reflected, Result not reflected, Initial Value: 0x0, Final Xor is not applied |
---|---|
Variables: |
|
_config
()[source]¶Configure object parameters
_declr
()[source]¶declarations
applyCrcXorMatrix
(crcMatrix: List, inBits: List, stateBits: List, refin: bool) → List[source]¶buildCrcXorMatrix
(data_width: int, polyBits: List[bool]) → List[Tuple[List[bool], List[bool]]][source]¶Parameters: | data_width – number of bits in input (excluding bits of signal wit current crc state) |
---|
:param polyBits :note: all bits are in format [LSB:MSB]
Returns: | crc_mask contains rows where each row describes which bits should be XORed to get bit of resut row is [mask_for_state_reg, mask_for_data] |
---|
hwtLib.logic.crcPoly.
CRC_1
[source]¶Bases: object
POLY
= 1¶REFIN
= False¶REFOUT
= False¶WIDTH
= 1¶hwtLib.logic.crcPoly.
CRC_16_CCITT
[source]¶Bases: object
INIT
= 65535¶POLY
= 4129¶REFIN
= False¶REFOUT
= False¶WIDTH
= 16¶XOROUT
= 0¶hwtLib.logic.crcPoly.
CRC_16_IBM
[source]¶Bases: object
INIT
= 0¶POLY
= 32773¶REFIN
= True¶REFOUT
= True¶WIDTH
= 16¶XOROUT
= 0¶hwtLib.logic.crcPoly.
CRC_32
[source]¶Bases: object
INIT
= 4294967295¶POLY
= 79764919¶REFIN
= True¶REFOUT
= True¶RESIDUE
= 3338984827¶WIDTH
= 32¶XOROUT
= 4294967295¶hwtLib.logic.crcPoly.
CRC_32C
[source]¶Bases: object
CHECK
= 3808858755¶INIT
= 4294967295¶POLY
= 517762881¶REFIN
= True¶REFOUT
= True¶RESIDUE
= 3080238136¶WIDTH
= 32¶XOROUT
= 4294967295¶hwtLib.logic.crcPoly.
CRC_3_GSM
[source]¶Bases: object
INIT
= 0¶POLY
= 3¶REFIN
= False¶REFOUT
= False¶WIDTH
= 3¶hwtLib.logic.crcPoly.
CRC_5_USB
[source]¶Bases: object
CHECK
= 25¶INIT
= 31¶POLY
= 5¶REFIN
= True¶REFOUT
= True¶RESIDUE
= 12¶WIDTH
= 5¶XOROUT
= 31¶hwtLib.logic.crcPoly.
CRC_64_ECMA
[source]¶Bases: object
POLY
= 4823603603198064275¶WIDTH
= 64¶hwtLib.logic.lsfr.
Lsfr
[source]¶Bases: hwt.synthesizer.unit.Unit
Linear shift feedback register, form of hardware pseudorandom generator
_config
()[source]¶Configure object parameters
hwtLib.logic.oneHotToBin.
OneHotToBin
[source]¶Bases: hwt.synthesizer.unit.Unit
Converts one hot signal to binary, bin.vld is high when oneHot != 0
_config
()[source]¶Configure object parameters
_declr
()[source]¶declarations
_serializeDecision
(parentUnit, obj, isDeclaration, priv)¶Decide to serialize only objs with uniq parameters and class
Parameters: | priv – private data for this function ({frozen_params: obj}) |
---|---|
Returns: | tuple (do serialize this object, next priv) |
hwtLib.logic.pid.
PidController
[source]¶Bases: hwt.synthesizer.unit.Unit
The PID Control block compares the input to the target and calculates an error. Based on this error, a output value is calculated that should result in a smaller error on the next iteration of the loop, assuming your parameters are tuned properly.
u(k) = u(k-1) + a0*e(k) + a1*y(k) + a2*y(k-1) + a3*y(k-2)
e(k): error in this step (= target value - input) y(k): input in step k ax: PID coeficient
The PID parameter inputs for this equation are slightly different from the traditional K_p, K_i, and K_d.
a0 = K_i * T_s a1 = -K_p - K_d / T_s a2 = K_p + 2K_d/T_s a3 = - K_d / T_s
Note: | You can obtain coeficiet f.e. by Ziegler-Nichols method. |
---|
_config
()[source]¶Configure object parameters
hwtLib.logic.segment7.
Segment7
[source]¶Bases: hwt.synthesizer.unit.Unit
7-segment display decoder
Note: | led in display becomes active when output = 0 |
---|
Display pin connection on image below.
-------------
| 0 |
-------------
| 5 | | 1 |
-------------
| 6 |
-------------
| 4 | | 2 |
-------------
| 3 |
-------------