2.4.1.7 ECC
(Ask a Question)When ECC is enabled, the DDR controller computes an 8-bit ECC for every 64-bit data to support SECDED. A write operation computes and stores ECC along with the data, and a read operation reads and checks the data against the stored ECC. Therefore, when ECC is enabled, single or double-bit errors might be received when reading uninitialized memory locations. To prevent this, all memory locations must be written to before being read.
For a non 64-bit write operation, the DDR controller performs a read-modify-write (RMW) operation as follows:
- Reads the data from DDR memory (4 or 8 DDR memory bursts)
- Modifies the read data with the user data
- Computes the ECC and writes to DDR memory
The DDR subsystem uses status signals to indicate a single-bit error (ECC_ERROR_1BIT) or a double-bit error (ECC_ERROR_2BIT) along with the error position (ECC_ERROR_POS) to the fabric. The following table lists the mapping of the ECC_ERROR_POS bits to the error bit position.
| ECC_ERROR_POS[6:0] | Error Bit Position |
|---|---|
| 7’h80 | 127 (check-bit 7) |
| 7’h40 | 126 (check-bit 6) |
| 7’h20 | 125 (check-bit 5) |
| 7’h10 | 124 (check-bit 4) |
| 7’h08 | 123 (check-bit 3) |
| 7’h04 | 122 (check-bit 2) |
| 7’h02 | 121 (check-bit 1) |
| 7’h01 | 120 (check-bit 0) |
| 7'd127 | 119 |
| 7'd126 | 118 |
| 7'd125 | 117 |
| 7'd124 | 116 |
| 7'd123 | 115 |
| 7'd122 | 114 |
| 7'd121 | 113 |
| 7'd120 | 112 |
| 7'd119 | 111 |
| 7'd118 | 110 |
| 7'd117 | 109 |
| 7'd116 | 108 |
| 7'd115 | 107 |
| 7'd114 | 106 |
| 7'd113 | 105 |
| 7'd112 | 104 |
| 7'd111 | 103 |
| 7'd110 | 102 |
| 7'd109 | 101 |
| 7'd108 | 100 |
| 7'd107 | 99 |
| 7'd106 | 98 |
| 7'd105 | 97 |
| 7'd104 | 96 |
| 7'd103 | 95 |
| 7'd102 | 94 |
| 7'd101 | 93 |
| 7'd100 | 92 |
| 7'd99 | 91 |
| 7'd98 | 90 |
| 7'd97 | 89 |
| 7'd96 | 88 |
| 7'd95 | 87 |
| 7'd94 | 86 |
| 7'd93 | 85 |
| 7'd92 | 84 |
| 7'd91 | 83 |
| 7'd90 | 82 |
| 7'd89 | 81 |
| 7'd88 | 80 |
| 7'd87 | 79 |
| 7'd86 | 78 |
| 7'd85 | 77 |
| 7'd84 | 76 |
| 7'd83 | 75 |
| 7'd82 | 74 |
| 7'd81 | 73 |
| 7'd80 | 72 |
| 7'd79 | 71 |
| 7'd78 | 70 |
| 7'd77 | 69 |
| 7'd76 | 68 |
| 7'd75 | 67 |
| 7'd74 | 66 |
| 7'd73 | 65 |
| 7'd72 | 64 |
| 7'd71 | 63 |
| 7'd70 | 62 |
| 7'd69 | 61 |
| 7'd68 | 60 |
| 7'd67 | 59 |
| 7'd66 | 58 |
| 7'd65 | 57 |
| 7'd63 | 56 |
| 7'd62 | 55 |
| 7'd61 | 54 |
| 7'd60 | 53 |
| 7'd59 | 52 |
| 7'd58 | 51 |
| 7'd57 | 50 |
| 7'd56 | 49 |
| 7'd55 | 48 |
| 7'd54 | 47 |
| 7'd53 | 46 |
| 7'd52 | 45 |
| 7'd51 | 44 |
| 7'd50 | 43 |
| 7'd49 | 42 |
| 7'd48 | 41 |
| 7'd47 | 40 |
| 7'd46 | 39 |
| 7'd45 | 38 |
| 7'd44 | 37 |
| 7'd43 | 36 |
| 7'd42 | 35 |
| 7'd41 | 34 |
| 7'd40 | 33 |
| 7'd39 | 32 |
| 7'd38 | 31 |
| 7'd37 | 30 |
| 7'd36 | 29 |
| 7'd35 | 28 |
| 7'd34 | 27 |
| 7'd33 | 26 |
| 7'd31 | 25 |
| 7'd30 | 24 |
| 7'd29 | 23 |
| 7'd28 | 22 |
| 7'd27 | 21 |
| 7'd26 | 20 |
| 7'd25 | 19 |
| 7'd24 | 18 |
| 7'd23 | 17 |
| 7'd22 | 16 |
| 7'd21 | 15 |
| 7'd20 | 14 |
| 7'd19 | 13 |
| 7'd18 | 12 |
| 7'd17 | 11 |
| 7'd15 | 10 |
| 7'd14 | 9 |
| 7'd13 | 8 |
| 7'd12 | 7 |
| 7'd11 | 6 |
| 7'd10 | 5 |
| 7'd9 | 4 |
| 7'd7 | 3 |
| 7'd6 | 2 |
| 7'd5 | 1 |
| 7'd3 | 0 |
- The SECDED bits of the fabric DDR Controller for DDR3 and DDR4 will always be 8 for 32 or 64 data width.
- The ECC status signals are supported for DDR3, LPDDR3, and DDR4.
