Can the number of cashe-matching be less for size of cashe that great than in previous case

SKY_SHY

New Member
Hello! I made the model of working cache-memory. In this model FIFO-algorhythm of replacing of addresses was used. It descibe as if cashe is full then candidates for deleting are addresses which refresh seldom.

My cashe works in 2 modes: "read" and "wrire"


Number of requests is equal to lines of code of a program which was generated randomly with including number of repeating for loop code. There are several blocks 2 type loop and linear in this programm.

If "Read-mode" and if an address is not in cashe then cashe-miss ius occurs and i put this address in cashe + i put certain number of following addresses in advance to provide spatial locality (for example cashe-miss is occurs for address with № 0 then i must put following , say 10 addresses: 1,2,3,4,5,6,7,8,9,10 in advance)

if "read-mode" and if an addresse is in cashe then i count cashe-match

if "write-mode" and if an address is not in cashe then i do same steps as in the case of read and if such address isn't exist in cashe

if "write-mode" and if an address is in cashe then i count cashe-match and refresh time marker.

Time marker may refresh in case write when such address is in cashe. This marker set when an address put in cash.

Example of programm (fragment)

Each address have an unique name. if an address begin from 011 - it is linear-code
if it begin from 010 - it is loop-code
01100000000000000000000000000000 - this null address for identification of point of enter in programm
01110100110110011011101010101110
01110100110110011011101010101111
01110100110110011011101010110000
01110100110110011011101010110001
01001100000110111110001010111000
01001100000110111110001010111001
01001100000110111110001010111010
01001100000110111110001010111011
01001100000110111110001010111100
01001100000110111110001010111101
01001100000110111110001010111110
01001100000110111110001010111111
01001100000110111110001011000000
01001100000110111110001011000001
01001100000110111110001011000010
01001100000110111110001011000011
01001100000110111110001011000100
01001100000110111110001011000101
01001100000110111110001011000110
01110100110110011011101010110010
01110100110110011011101010110011
01110100110110011011101010110100
01110100110110011011101010110101
01110100110110011011101010110110
01110100110110011011101010110111
01110100110110011011101010111000
01001100000110111110001011000111
01001100000110111110001011001000
01001100000110111110001011001001
01001100000110111110001011001010
01110100110110011011101010111001
01001100000110111110001011001011
01001100000110111110001011001100
01001100000110111110001011001101
01001100000110111110001011001110
01001100000110111110001011001111
01001100000110111110001011010000
01001100000110111110001011010001
01001100000110111110001011010010
01001100000110111110001011010011
01001100000110111110001011010100
01001100000110111110001011010101

I get following graph in condition:

Mode: Read. Cashe-size increase from 10 to 60 for putting addresses. Average lines in each block of code is 16 lines. Number of addresses which are intended for putting when cashe-miss is occured is 10.
mav0bn.jpg

If cashe -size is greater than in previous case for less size - number of cashe-matching decrease in very small value. Difference is evident. I would explain it. For example. When some block of loop - code ends in last number, say #35 and if there is cashe-miss in this case then 10 following addresses (36,37,38,39,40,41,42,43,44,45) put in cashe.
After it, linears address wanna go in the cashe. Then cashe-miss occurs again. Ok! No problem i count cashe miss and put this addresses in cashe. So, i must deleting some addresses in accordance with FIFO. But after it addresses from a new loop-code wanna in the cashe and this block. This block begins from address # 36 Ok! There is cashe-match in this case. But this block is too long and cashe-miss occurs when the address # 46 from this loop-code try to enter in the cash and it isn't there. And in this case i need to delete the addresses which were in pre-previous request - i.e. #36, 37 - and i get the cashe-miss again, which i may avoid if my cashe have size less.
P.S. I'm sorry for my English. If you share your idea for this behavour of cash - i'm glad see it
 
Last edited:
Top