WORD 7
WORD 6
WORD 5
WORD 4
WORD 3
WORD 2
WORD 1
WORD 0
WORD 6
WORD 5
WORD 4
WORD 3
WORD 2
WORD 1
WORD 0
WORD 7
TAG
Prefetch Buffer 1
255
127
96 95
64 63
32 31
0
128
159
160
191
192
223
224
Prefetch Buffer 0
TAG
Functional Description
536
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Internal Memory
The interleaved memory prefetches 256 bits at a time. The prefetch buffers allow the maximum
performance of a 120-MHz CPU speed to be maintained with linear code or loops that fit within the
prefetch buffer. It is recommended that code be compiled with switches set to eliminate literals as much as
possible, as a literal causes a flash access for that word and a stall for the wait states. Most compilers
support transforming literals into in-line code, which executes faster in a system in which the memory
subsystem is slower than the CPU.
Because the memory is two-way interleaved and each bank individually is an 8KB sector, when the user
erases a sector, using the ERASE bits in the Flash Memory Control (FMC) register, it is a 16KB erase.
Erasing a block causes the entire contents of the block to be reset to all 1s.
7.2.3.1
Flash Configuration
Depending on the CPU frequency, the application must program the flash clock high time (FBCHT), flash
bank clock edge (FBCE) and flash wait states (FWS) in the Memory Timing Parameter Register 0 for main
flash and EEPROM (MEMTIM0) at System Control Module offset 0x0C0.
lists details the bit field
values that are required for the given CPU frequency ranges.
Table 7-1. MEMTIM0 Register Configuration and Frequency
CPU Frequency Range
(f) in MHz
Time Period Range (t)
in ns
Flash Bank Clock High
Time (FBCHT)
Flash Bank Clock
Edge (FBCE)
Flash Wait States
(FWS)
16
62.5
0x0
1
0x0
16 < f
≤
40
62.5 > t
≥
25
0x2
0
0x1
40 < f
≤
60
25 > t
≥
16.67
0x3
0
0x2
60 < f
≤
80
16.67 > t
≥
12.5
0x4
0
0x3
80 < f
≤
100
12.5 > t
≥
10
0x5
0
0x4
100 < f
≤
120
10 > t
≥
8.33
0x6
0
0x5
To update the MEMTIM0 register with the new flash configuration values, the MEMTIMU bit must be set in
the Run and Sleep Mode Configuration (RSCLKCFG) register at System Control offset 0x0B0.
NOTE:
The associated flash and EEPROM fields in the MEMTIM0 register must be programmed to
the same values. For example, the FWS field must be programmed to the same value as the
EWS field.
7.2.3.2
Prefetch Buffers
The prefetch buffers can exist as a single set of 2 × 256-bit buffers or 4 × 256-bit buffers, depending on
the SPFE bit programmed in the Flash Configuration (FLASHCONF) register at offset 0xFC8. At reset, all
four buffers are enabled. The buffers are filled using a least-recently-used (LRU) method. When operating
in a single set buffer configuration, the two, 256-bit buffers create a deterministic configuration as each
next
write is sent to the previous buffer that was written.
depicts the single 256-bit buffer set.
The single prefetch buffer set should only be used when the code execution must be purely deterministic
for the number of clock cycles it takes to execute. Using the four prefetch buffer configuration is the
preferred method of configuration.
Figure 7-4. Single 256-Bit Prefetch Buffer Set
When the buffers are configured as four, 256-bit buffers, they function as one set with one of the four
buffers tagged as the LRU and the next to be used when an autofill or miss occurs.