EDACType

source

EDACType()

Enumerate of the EDAC Type system


EDACMethod

source

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

source

.get_parity_size()

Generate the parity size of the EDAC system

Returns

  • int : parity size of the EDAC system

._create_block

source

._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

source

.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

source

.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 (None as default)

Returns

  • bytes : The data encoded

._parse_parity

source

._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

source

.get_default_block()

Generate default block of the EDAC system

Returns

  • int : default block of the EDAC system