|
bool | calculateParity (const boost::dynamic_bitset<> &data) noexcept |
|
template<std::size_t DataBits> |
constexpr bool | calculateParity (const std::bitset< DataBits > &data) noexcept |
|
template<std::size_t DataBits, typename IntType , std::enable_if_t< std::is_integral_v< IntType >, int > = 0> |
bool | calculateParity (const std::bitset< DataBits > &data, IntType parityBit) |
|
template<std::size_t DataBits, std::size_t EncodedBits, std::enable_if_t< greaterThan_v< EncodedBits, DataBits >, int > = 0> |
std::size_t | checkBitsConsistent () |
|
template<typename IntType1 , typename IntType2 , std::enable_if_t< std::is_integral_v< IntType1 >, int > = 0, std::enable_if_t< std::is_integral_v< IntType2 >, int > = 0> |
std::vector< std::size_t > | dataBitsCovered (IntType1 numDataBits, IntType2 parityBit) |
|
template<std::size_t DataBits, std::size_t EncodedBits, std::enable_if_t< greaterThan_v< EncodedBits, DataBits >, int > = 0> |
std::bitset< DataBits > | extractData (const std::bitset< EncodedBits > &encodedBits) noexcept |
|
template<typename IntType , std::enable_if_t< std::is_integral_v< IntType >, int > = 0> |
constexpr bool | isPowerOfTwo (IntType n) noexcept |
| Tests if value is a power of two. More...
|
|
template<typename IntType , std::enable_if_t< std::is_integral_v< IntType >, int > = 0> |
std::size_t | nextPowerOfTwo (IntType n) |
|
template<typename IntType , std::enable_if_t< std::is_integral_v< IntType >, int > = 0> |
std::size_t | numSecdedParityBitsNeeded (IntType numDataBits) |
|
template<typename IntType , std::enable_if_t< std::is_integral_v< IntType >, int > = 0> |
std::vector< std::size_t > | powersOfTwo (IntType n) |
|
template<std::size_t DataBits, typename IntType , std::enable_if_t< std::is_integral_v< IntType >, int > = 0>
bool nc::edac::detail::calculateParity |
( |
const std::bitset< DataBits > & |
data, |
|
|
IntType |
parityBit |
|
) |
| |
Calculates the specified Hamming parity bit (1, 2, 4, 8, etc.) for the given data. Assumes even parity to allow for easier computation of parity using XOR.
- Parameters
-
data | the data word |
parityBit | the parity bit number |
- Returns
- parity bit value
- Exceptions
-
std::invalid_argument | if parityBit is not a power of two |
std::bad_alloc | if unable to allocate return vector |
template<typename IntType1 , typename IntType2 , std::enable_if_t< std::is_integral_v< IntType1 >, int > = 0, std::enable_if_t< std::is_integral_v< IntType2 >, int > = 0>
std::vector< std::size_t > nc::edac::detail::dataBitsCovered |
( |
IntType1 |
numDataBits, |
|
|
IntType2 |
parityBit |
|
) |
| |
Returns the indices of all data bits covered by a specified parity bit in a bitstring of length numDataBits. The indices are relative to DATA BITSTRING ITSELF, NOT including parity bits.
- Parameters
-
numDataBits | the number of data bits to encode |
parityBit | the parity bit number |
- Returns
- number of Hamming SECDED parity bits
- Exceptions
-
std::invalid_argument | if parityBit is not a power of two |
std::bad_alloc | if unable to allocate return vector |