English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (197/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
9.3.4
PREDICTIVE PREFETCH
BEHAVIOR
When configured for predictive prefetch on cacheable
addresses, the module predicts the next line address
and returns it into the pseudo LRU line of the cache. If
enabled, the prefetch function starts predicting based
on the first CPU instruction fetch. When the first line is
placed in the cache, the module simply increments the
address to the next 16-byte aligned address and starts
a flash access. When running linear code (i.e. no
jumps), the flash returns the next set of instructions
into the prefetch buffer on or before all instructions can
be executed from the previous line.
If at any time during a predicted flash access, a new
CPU address does not match the predicted one, the
flash access will be changed to the correct address.
This behavior does not cause the CPU access to take
any longer than without prediction.
If an access that misses the cache hits the prefetch
buffer, the instructions are placed in the pseudo LRU
line along with its address tag. The pseudo LRU value
is marked as the most recently used line and other
lines are updated accordingly. If an access misses
both the cache and the prefetch buffer, the access
passes to the flash and those returning instructions
are placed in the pseudo LRU line.
When configured for predictive prefetch on non-
cacheable addresses, the controller only uses the
prefetch buffer. The LRU cache line is not updated for
hits or fills so the cache remains intact. For linear
code, enabling predictive prefetch for non-cacheable
addresses allows the CPU to fetch instructions in zero
Wait states.
It is not useful to use non-cacheable predictive
prefetching when accesses to the flash are set for zero
Wait states. The controller holds prefetched instruc-
tions on the output of the flash for up to 3 clock cycles
(while the CPU is fetching from the buffer). This con-
sumes more power without any benefit for zero Wait
state flash accesses.
Predictive data prefetching is not supported. However,
a data access in the middle of a predictive instruction
fetch causes the prefetch controller to stop the flash
access for the instruction fetch and to start the data
load from flash. The predictive prefetch does not
resume, but instead waits for another instruction fetch.
At which time, it either fills the buffer because of a
miss, or starts a prefetch because of a hit.
PIC32MX3XX/4XX
9.3.5 COHERENCY SUPPORT
It is not possible to execute out of cache while pro-
gramming the flash memory. The flash controller stalls
the cache during the programming sequence. There-
fore, user code that initiates a programming sequence
must not be located in a cacheable address region.
If CHECON.CHECOH = 1, then coherency is strictly
supported by invalidating, unlocking, and clearing
masks for all lines whenever the Flash Program
Memory is written or programmed.
If CHECON.CHECOH = 0, then only lines that are not
locked are forced invalid. Lines that are locked are
retained.
9.4 Prefetch Module Interrupts and
Exceptions
The prefetch module does not generate any interrupts.
Exceptions can occur if cache lines are marked as valid
manually by writing to individual CHETAG registers
then executing code that hits one of these lines contain-
ing invalid instructions. Also manually placing data into
an un-locked cache line may cause a coherency prob-
lem from an eviction due to a cache miss in the middle
of the loading algorithm.
9.5 I/O Pin Configuration
The prefetch module does not use any external pins.
© 2008 Microchip Technology Inc.
Preliminary
DS61143E-page 195