Zynq-7000 AP SoC and 7 Series FPGAs MIS v4.1
128
UG586 November 30, 2016
Chapter 1:
DDR3 and DDR2 SDRAM Memory Interface Solution
The ECC functionality is implemented as three functional blocks. A write data merge and
ECC generate block. A read data ECC decode and correct block and a data buffer block for
temporarily holding the read data for read-modify-write cycles. A fourth block generates
the ECC H matrix and passes these matrices to the ECC generate and correct blocks.
For full burst write commands, data fetched from the write data buffer traverses the ECC
merge and generate block. This block computes the ECC bits and appends them to the data.
The ECC generate step is given one CLK state. Thus the data must be fetched from the write
data buffer one state earlier relative to the write command, compared to when ECC is not
enabled. At the user interface level, data must be written into the write data buffer no later
than one state after the command is written into the command buffer. Other than the earlier
data requirement, ECC imposes no other performance loss for writes.
For read cycles, all data traverses the ECC decode fix (
ecc_dec_fix
) block. This process
starts when the PHY indicates read data availability on the
phy_rddata_valid
signal. The
decode fix process is divided into two CLK states. In the first state, the syndromes are
computed. In the second state the syndromes are decoded and any indicated bit flips
(corrections) are performed. Also in the second state, the
ecc_single
and
ecc_multiple
indications are computed based on the syndrome bits and the timing
signal
ecc_status_valid
generated by the Memory Controller core logic. The core logic
also provides an
ecc_err_addr
bus. This bus contains the address of the current read
command. Error locations can be logged by looking at the
ecc_single
,
ecc_multiple,
and
ecc_err_addr
buses. ECC imposes a two state latency penalty for read requests.
Read-Modify-Write
Any writes of less than the full DRAM burst must be performed as a read-modify-write
cycle. The specified location must be read, corrections if any performed, merged with the
write data, ECC computed, and then written back to the DRAM array. The
wr_bytes
command is defined for ECC operation. When the
wr_bytes
command is given, the
Memory Controller always performs a read-modify-write cycle instead of a simple write
cycle. The byte enables must always be valid, even for simple commands. Specifically, all
byte enables must be asserted for all wr commands when ECC mode is enabled.
To write partially into memory,
app_wdf_mask
needs to be driven along with the
wr_bytes
command for ECC enabled designs.
shows the available commands
when ECC mode is enabled.
Table 1-55:
Commands for app_cmd[2:0]
Operation
app_cmd[2:0] Code
Write
000
Read 001
Write Bytes
011