secded_edac¶
Dependencies¶
Description¶
This package implements Single Error Correction, Double Error Detection
(SECDED) by extending the Hamming code with an extra overall parity bit.
It is built on top of the functions implemented in hamming_edac.
The ecc_vector
is extended with an additional
parity bit to the right of the Hamming parity as shown below.
SECDED ecc_vector
layout:
MSb LSb
[(data'length - 1) <-> 0] [-1 <-> -(parity_size - 1)] [-parity_size]
data Hamming parity SECDED parity bit
Example usage¶
signal word, corrected_word : std_ulogic_vector(15 downto 0);
constant WORD_MSG_SIZE : positive := secded_message_size(word'length);
signal secded_word :
ecc_vector(word'high downto -secded_parity_size(WORD_MSG_SIZE));
...
secded_word <= secded_encode(word);
... <SEU or transmission error flips a bit>
corrected_word <= secded_decode(hamming_word);
errors := secded_has_errors(secded_word);
if errors(single_bit) or errors(double_bit) then ... -- check for error
As with hamming_edac
, it is possible to share logic between the decoder
and error checker and also between an encoder and decoder that don’t
operate simultaneously. Refer to hamming_edac and secded_codec
for examples of this approach.
Types¶
-
secded_edac.
secded_error_kind
¶ Type of SECDED errors.
-
secded_edac.
secded_errors
¶ Boolean bitfield for SECDED errors.
Subprograms¶
-
secded_edac.
secded_message_size
(Data_size : positive) → positive¶ - Determine the size of a message (data interleaved with parity) given the size of data to be protected.
Parameters: - Data_size (positive) – Number of data bits
Returns: Message size.
-
secded_edac.
secded_indices
(Data_size : positive) → ecc_range¶ - Return the left and right indices needed to declare an ecc_vector for the requested data size.
Parameters: - Data_size (positive) – Number of data bits
Returns: Range with left and right.
-
secded_edac.
secded_parity_size
(Message_size : positive) → positive¶ - Determine the number of parity bits for a given message size.
Parameters: - Message_size (positive) – Number of bits in complete message
Returns: Parity size.
-
secded_edac.
secded_data_size
(Message_size : positive) → positive¶ - Determine the number of data bits for a given message size.
Parameters: - Message_size (positive) – Number of bits in complete message
Returns: Data size.
-
secded_edac.
secded_encode
(Data : std_ulogic_vector) → ecc_vector¶ - Encode the supplied data into an ecc_vector using Hamming code for the parity and an additional overall parity for SECDED. This version uses self contained logic.
Parameters: - Data (std_ulogic_vector) – Raw data
Returns: Encoded data with parity.
-
secded_edac.
secded_encode
(Data : std_ulogic_vector; Parity_bits : unsigned) → ecc_vector¶ - Encode the supplied data into an ecc_vector using Hamming code for the parity and an additional overall parity for SECDED. This version depends on external logic to generate the Hamming parity bits.
Parameters: - Data (std_ulogic_vector) – Raw data
- Parity_bits (unsigned) – Number of parity bits
Returns: Encoded data with parity.
-
secded_edac.
secded_decode
(Encoded_data : ecc_vector) → std_ulogic_vector¶ - Decode an ecc_vector into the plain data bits, potentially correcting a single-bit error if a bit has flipped. This version uses self contained logic.
Parameters: - Encoded_data (ecc_vector) – Encoded (uninterleaved) message
Returns: Decoded data.
-
secded_edac.
secded_has_errors
(Encoded_data : ecc_vector) → secded_errors¶ - Test for a single-bit and double-bit errors in an ecc_vector. Returns true for each error type.
Parameters: - Encoded_data (ecc_vector) – Encoded (uninterleaved) message
Returns: true if message has a single or double-bit error.
-
secded_edac.
secded_has_errors
(Encoded_data : ecc_vector; Syndrome : unsigned) → secded_errors¶ - Test for a single-bit and double-bit errors in an ecc_vector. Returns true for each error type. This version depends on external logic to generate a syndrome.
Parameters: - Encoded_data (ecc_vector) – Encoded (uninterleaved) message
- Syndrome (unsigned) – Syndrome generated by hamming_parity()
Returns: true if message has a single or double-bit error.