How do I find TLB misses occurring in the worst case during a program memory accesses

How do I find TLB misses occurring in the worst case during a program memory accesses

if for example, I have the following parameters
32 TLB entries, Page size 4096 Byte and 32 bit program and data word size

with ff. code (where '$' represent a register)

ADDI $1 $1 4
loop1:
SUB $2 $2 $2
Loop2:
LW $4 0($2)
SW $4 1024($3)
BNE $1 $2 LOOP2
ADDI $2 $2 4
BNE$1 $3 loop 1
ADDI $3$3 4
NOP

if the TLB HAS NO VALID ENTRIES AT PROGRAM START:INCLUDING THE NOP INSTRUCTION:
HOW CAN I CALCULATE THE NUMBER OF TLB MISSES WHICH WILL OCCUR IN THE WORST CASE DURING THE PROGRAM MEMORY ACCESSES:

I will be very grateful for a very quick reply to get my way through on TLB MISSES:
THANKS

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.