4 round-robin replacement algorithm, Round-robin replacement algorithm – Intel NETWORK PROCESSOR IXP2800 User Manual

Page 87

Advertising
background image

Hardware Reference Manual

87

Intel

®

IXP2800 Network Processor

Intel XScale

®

Core

The proper procedure for locking entries into the data TLB is shown in

Example 16

.

Note: Care must be exercised here when allowing exceptions to occur during this routine whose handlers

may have data that lies in a page that is trying to be locked into the TLB.

3.3.4.4

Round-Robin Replacement Algorithm

The line replacement algorithm for the TLBs is round-robin; there is a round-robin pointer that

keeps track of the next entry to replace. The next entry to replace is the one sequentially after the

last entry that was written. For example, if the last virtual to physical address translation was
written into entry 5, the next entry to replace is entry 6.

At reset, the round-robin pointer is set to entry 31. Once a translation is written into entry 31, the

round-robin pointer gets set to the next available entry, beginning with entry 0 if no entries have

been locked down. Subsequent translations move the round-robin pointer to the next sequential
entry until entry 31 is reached, where it will wrap back to entry 0 upon the next translation.

A lock pointer is used for locking entries into the TLB and is set to entry 0 at reset. A TLB lock

operation places the specified translation at the entry designated by the lock pointer, moves the
lock pointer to the next sequential entry, and resets the round-robin pointer to entry 31. Locking

entries into either TLB effectively reduces the available entries for updating. For example, if the

first three entries were locked down, the round-robin pointer would be entry 3 after it rolled over
from entry 31.

Only entries 0 through 30 can be locked in either TLB; entry 31can never be locked. If the lock

pointer is at entry 31, a lock operation will update the TLB entry with the translation and ignore the

lock. In this case, the round-robin pointer will stay at entry 31.

Example 16. Locking Entries into the Data TLB

; R1, and R2 contain the virtual addresses to translate and lock into the data TLB

MCR P15,0,R1,C8,C6,1

; Invalidate the data TLB entry specified by the

; virtual address in R1

MCR P15,0,R1,C10,C8,0

; Translate virtual address (R1) and lock into

; data TLB

; Repeat sequence for virtual address in R2

MCR P15,0,R2,C8,C6,1

; Invalidate the data TLB entry specified by the

; virtual address in R2

MCR P15,0,R2,C10,C8,0

; Translate virtual address (R2) and lock into

; data TLB

CPWAIT

; wait for locks to complete

; The MMU is guaranteed to be updated at this point; the next instruction will

; see the locked data TLB entries.

Advertising