MSMC: Set-hazarding logic withholding RT access waiting on NRT access
completion
Details:
The DDR controller prioritizes writes over reads to the same page. Additionally, MSMC
hazards transactions on the same set regardless of the real-time attribute. Due to
these two facts, a stream of writes to the same page followed by a non real-time
read to the same page can effectively block out a real-time access command
indefinitely.
Example sequence:
- Stream of Writes to page A sent from MSMC to DDR Controller
- Non Real-Time Read to page A sent from MSMC to DDR Controller
- This command will be stalled in the DDR Controller behind the
completion of the 1) Stream of Writes
- Real-Time Access to same set as the 2) Non Real-Time Read will be stalled
inside MSMC due to Set Hazarding
Workaround(s):
Software should attempt the following workarounds in order of least to most impact to
SW.
- Cadence DDR controller prioritizes writes to the same page over a read from
another page causing a delay in returning the read. Try reducing the DDR
controller command_age_count from 0xto 0xF - corresponding to reducing the
command age count from 16 DDR refresh cycles (62 us) to 1 refresh cycle (3.9
us). In most of the cases issue is resolved with this setting, but in some
cases there are still some underflows. In that case SW may require either 2
or 3 workaround.
- If possible set the ARM MMU attribute to configure DDR as “Normal memory”
instead of “Device memory” type. This makes ARM to DDR access to be more
efficient and helps to alleviate the problem. This is the observation based
on test results so far, but it may need more analysis and further system
testing. If this workaround is not possible in the system, SW may require
workaround 3).
- If possible make the Real-Time access as non IO-coherent. Set the RT access
ATYPE = 3 for non-virtualized cases, and set ATYPE=1 & MEMTYPE=0 for PVU
specific cases. This forces the RT traffic to bypass the MSMC set-hazarding
logic. SW will have to do the cache operations.