Along with the prefetch mechanism, a data cache of
128-bits wide is also implemented to improve data-space read performance. This data
cache is not filled by the prefetch mechanism. When any kind of data-space read is
made by the CPU from an address in the bank, and if the data corresponding to the
requested address is not in the data cache, then 128 bits of data is read from the
bank and loaded in the data cache. This data is eventually sent to the CPU for
processing. The starting address of the access from Flash is automatically aligned
to a 128-bit boundary such that the requested address location is within the 128
bits to be read from the bank. By default, this data cache is disabled and can be
enabled by setting DATA_CACHE_EN bit in the FRD_INTF_CTRL register. Note that the
data cache gets bypassed when RWAIT is configured as zero.
Some other points to keep in mind when working
with Flash/ OTP memory:
- Reads of the USER OTP locations are hardwired for 10 wait states. The RWAIT bits have no effect on these locations.
- CPU writes to the Flash or OTP memory-map areas
are ignored. The writes complete in a single cycle.
- If a security zone is in the locked state and the
respective password lock bits are not all 1s, then,
- Data reads to Zx-CSMPSWD
return 0
- Program space reads to
Zx-CSMPSWD return 0
- Program fetches to
Zx-CSMPSWD return 0
- When the Code Security Module (CSM) is secured,
reads to the Flash/OTP memory-map area from outside the secure zone take the
same number of cycles as a normal access. However, the read operation returns a
zero.
- The arbitration scheme in FMC prioritizes CPU accesses in the fixed priority order of data read (highest priority), program space read and program fetches/program prefetches (lowest priority).
- When FSM interface is active for erase/program
operations, data in the prefetch buffers and data cache in FMC are flushed.
- When data cache is enabled, the debugger memory
window open to Flash/OTP memory space invokes data caching. Hence, the debugger
memory window must not be left open for Flash/OTP memory space when benchmarking
the code for performance.
Note: Flash contents are verified for ECC
correctness before the contents enter the prefetch buffer or data cache and not
inside the prefetch buffer or data cache itself.