Email: bknpk@hotmail.com Phone: +972-54-7649119


V

 

ASIC/FPGA Design and Verification Out Source Services

C++ Reference model for ECC main code.

  1. This code is part of the following project: A reference model, in c++, that generates ECC for a 256 bytes.

  2. ECC calculation is based on Micron technical note:
    TN-29-63: Error Correction Code (ECC) in SLC NAND.

  3. Based on the technical note the LP and CP are calculated in the class constructor:

    1. c_ecc::c_ecc(const unsigned char a_data[ARRAY_SZ]) {
    2. unsigned i, j;
    3. for(i=0; i < ARRAY_SZ; i++) {
    4.   xor_byte(a_data[i]);
    5.   if(i & 0x1) {
    6.     LP[1]=xor_bits ^ LP[1];
    7.   } else {
    8.     LP[0]=xor_bits ^ LP[0];
    9. ...
    10.   xor_byte(a_data[i] & 0x0f); //3210
    11.   CP[4] ^= xor_bits;
    12.   xor_byte(a_data[i] & 0xf0); //7654
    13.   CP[5] ^= xor_bits;

    A second class is responsible for ECC correction:
    1. class c_e_ccc_correct {
    2.   public:
    3.   c_e_ccc_correct(const c_ecc& prev, const c_ecc& curr);
    4.   void bit_count(const unsigned char& d);
    5.   unsigned char ecc_c[3];
    6.   unsigned char bit_cnt;
    7.   unsigned char bit_add;
    8.   unsigned char byte_ad;
    9.   unsigned i;
    10.   unsigned char total_bit_cnt;
    11. };







Search This Site


Feedback This Site




new pages on this site