2.4.1.7 ECC

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.

Table 2-6. Mapping of ECC Position bits to Error Bit Position
ECC_ERROR_POS[6:0]Error Bit Position
7’h80127 (check-bit 7)
7’h40126 (check-bit 6)
7’h20125 (check-bit 5)
7’h10124 (check-bit 4)
7’h08123 (check-bit 3)
7’h04122 (check-bit 2)
7’h02121 (check-bit 1)
7’h01120 (check-bit 0)
7'd127119
7'd126118
7'd125117
7'd124116
7'd123115
7'd122114
7'd121113
7'd120112
7'd119111
7'd118110
7'd117109
7'd116108
7'd115107
7'd114106
7'd113105
7'd112104
7'd111103
7'd110102
7'd109101
7'd108100
7'd10799
7'd10698
7'd10597
7'd10496
7'd10395
7'd10294
7'd10193
7'd10092
7'd9991
7'd9890
7'd9789
7'd9688
7'd9587
7'd9486
7'd9385
7'd9284
7'd9183
7'd9082
7'd8981
7'd8880
7'd8779
7'd8678
7'd8577
7'd8476
7'd8375
7'd8274
7'd8173
7'd8072
7'd7971
7'd7870
7'd7769
7'd7668
7'd7567
7'd7466
7'd7365
7'd7264
7'd7163
7'd7062
7'd6961
7'd6860
7'd6759
7'd6658
7'd6557
7'd6356
7'd6255
7'd6154
7'd6053
7'd5952
7'd5851
7'd5750
7'd5649
7'd5548
7'd5447
7'd5346
7'd5245
7'd5144
7'd5043
7'd4942
7'd4841
7'd4740
7'd4639
7'd4538
7'd4437
7'd4336
7'd4235
7'd4134
7'd4033
7'd3932
7'd3831
7'd3730
7'd3629
7'd3528
7'd3427
7'd3326
7'd3125
7'd3024
7'd2923
7'd2822
7'd2721
7'd2620
7'd2519
7'd2418
7'd2317
7'd2216
7'd2115
7'd2014
7'd1913
7'd1812
7'd1711
7'd1510
7'd149
7'd138
7'd127
7'd116
7'd105
7'd94
7'd73
7'd62
7'd51
7'd30
Note:
  • 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.