d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Simulating A Victim Cache In C
Add Reply New Topic New Poll
Member
Posts: 5,988
Joined: May 6 2006
Gold: 30.00
Nov 20 2013 03:53pm
I'm writing this program to simulate a victim cache, but i have a quick question about how victim caches work


I have a main cache ( which can be n- set associative or direct mapped) and a victim cache ( which is fully associative and FIFO)

When you have a main cache, if a dirty line gets evicted from the cache, it goes into the victim cache.
Main Cache --> Victim Cache
My question is, when you have a victim cache hit, which of these 2 options will happen:
a ) The main cache takes the cache line from the victim cache and removes it from the victim cache
b ) The victim cache maintains a copy of the cache line and sends one to the main cache

THe only way I can see b ) being usefu isl if the main cache doesnt modify the cache line after grabbing it from the victim cache...because then it wouldnt have to send data back to the victim cache. but then again, it probably wouldnt take much time to send back there anyways. And also, this would mess up the fifo algorithm i guess.

This post was edited by oOn on Nov 20 2013 04:18pm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll