Intel SA-1110 Food Processor User Manual


 
SA-1110 Developers Manual 53
Caches, Write Buffer, and Read Buffer
When an RB allocate instruction is executed, the virtual address is looked up in the TB to check for
a translation hit and possible access violations. If the access misses in the TB, the pipe is stalled
until the page is fetched through the normal hardware tablewalk mechanism. If an access violation
occurs, the RB load is NOP’d. For example, an RB allocate instruction can generate a data abort.
Once the RB allocate has received a TB hit and no access violations, a bus access is requested that
fills the appropriate buffer without stalling the core pipeline. Subsequent load instructions to this
virtual address result in an RB hit and data is sourced from the appropriate entry to the core.
Any two data words with the same virtual address may not be contained in the RB at the same time.
If an RB allocate references a data word that is already contained in another RB entry, then the old
RB entry is invalidated and the new allocation is performed. It is possible for a portion of a cache
block at a given virtual address to be contained in one RB entry while another portion of the same
block is contained in another RB entry. However, a given word can not be in more than one entry at
a time.
If a load instruction misses in the RB, then a normal cache fill is performed (provided the cache is
enabled and the page is marked cacheable). It then presents the possibility of having a partial line
resident in the RB as well as having the line present in one of the Dcaches. This presents coherency
issues that must be managed by software. If this situation does occur and the addressed data is in
both the Dcache and the RB, then the data is sourced from the RB. If an RB entry contains a partial
cache block (1 or 4 words), then those words will be sourced from the RB while the remaining
words are sourced from the data cache or memory.
RB allocate instructions are not affected by the cache enable bit (bit 2 in the control register) or by
the C bit in the MMU. Any RB allocate to a valid RB entry causes that RB entry to be invalidated,
followed by a new allocation for the desired data. This occurs regardless of the address of the data
currently in the buffer. For example, back-to-back RB allocate instructions to the same entry at the
same address will invalidate the entry caused by the first instruction prior to performing the second
fill.
An RB allocate or a load instruction that is issued to an RB entry currently being filled will stall
until the fill completes. If a data abort is signaled on a read buffer allocate, the fill completes. After
that, if a load to that entry is attempted, a data abort exception is issued. The coprocessor 15
register provides the ability to invalidate individual entries in the RB or to invalidate the entire
buffer in one operation. RB coherency must be managed in software. Writes to addresses present in
the read buffer are not written into the buffer. Specific RB entries must be invalidated before
writing to the addresses or changing the page tables of the entries. Coherency is not checked
between the RB and the WB. The WB should be drained prior to performing an RB load.
Note: The write buffer must be flushed prior to loading the read buffer to maintain coherency between the
two buffers. But, if user-mode MCR access is enabled for the read buffer and the flush is attempted
while in user mode, an undefined instruction exception will occur. In this case, the exception
handler must perform the write buffer flush, then return to user mode to execute the read buffer
load. Alternatively, an SWI instruction can be used as a service call to flush the write buffer.