1
$\begingroup$

I tried referring a few material (videos on youtube and this link as well), but I still couldn't wrap my head around the concept.

My (brief) understanding of the Virtually addressed, Physically addressed and Virtually indexed Physically tagged cache:

Virtually addressed cache
The virtual address generated by the CPU is used to perform a cache read/write. In the case of a miss the address is translated into a physical address and the appropriate data is loaded into cache and the cache directory is updated. The Translation Look-aside Buffer (TLB) is only used during a cache miss, i.e. when the virtual address is to be converted to a physical address. The cache directory stores a virtual tag.

Physically addressed cache
The physical address acquired from the TLB translation of the virtual address (virtual number + page offset => physical number + page offset) is utilised to perform a cache read/write. The tag stored in the cache directory is the physical tag.

Virtually indexed, Physically tagged cache
The virtual address is forwarded to both TLB and cache. The cache uses the index from the virtual address and finds the corresponding physical tag from the cache directory, the TLB finds the corresponding physical tag from the virtual address and the two tags (from cache directory and TLB) are compared to check if it was a hit/miss.

From what I understood, the cache index and block offset values derived from the logical address could either be equal (with respect to size) to the page offset or not, i.e the page offset either contains the index and block offset or not.
When the size of the index plus block offset do not equal the page offset, wouldn't the size of the physical tag of the cache directory not match the physical tag of the TLB ? And if that is true, how are the physical tags from the cache directory and TLB compared ? Further more, I also could not understand how Virtually indexed, Physically tagged cache could have the synonym problem when the size of the index plus block offset dont match the page offset.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.