EDACType
EDACType()
Enumerate of the EDAC Type system
EDACMethod
EDACMethod(
edac_type: EDACType = EDACType.NO_EDAC, debug: Debug = Debug.DEPLOY
)
The Base class of the EDAC Method which means that all EDAC should contains all the methods it contains and will only be call the method it contains
Args
- TYPE (EDACType) : The type of the EDAC system
- DEBUG (bool) : Debug flag
Methods:
.get_parity_size
.get_parity_size()
Generate the parity size of the EDAC system
Returns
- int : parity size of the EDAC system
._create_block
._create_block(
data: int, n: int
)
Parse data into blocks so that every block have n bits of data
Raises
- ValueError : If the data's type isn't
bytes
Returns
- list : the list of blocks needed
.decode
.decode(
data: int
)
The method that the EDAC system need to decode for checking the correctness
Args
- data (bytes) : The data to be decode
Returns
- tuple (bool, bytes, list) : should be formated
(error, original data, error bits)
.encode
.encode(
data: int
)
The method that the EDAC system need to encode for futher EDAC usage
Args
- data (bytes) : The data to be encoded
- n (int) : The block size given (
Noneas default)
Returns
- bytes : The data encoded
._parse_parity
._parse_parity(
data: int
)
Parse the parity and original data from the message
Args
- data (int) : encoded data
Returns
- tuple (int, int) : the data and the parity
.get_default_block
.get_default_block()
Generate default block of the EDAC system
Returns
- int : default block of the EDAC system