computerorg said:
difference between virtually indexed virtually tagged cache and virtually indexed physically tagged cache.
Note I found the wiki cache entry structure section to be confusing so I proposed a change in the discussion page:
http://en.wikipedia.org/wiki/Talk:CPU_cache#Cache_entry_structure
wiki articles:
http://en.wikipedia.org/wiki/CPU_cache#Address_translation
http://en.wikipedia.org/wiki/Translation_lookaside_buffer
Each cache row entry includes data, tag, and a valid bit (there may be other information for replacement algorithms). Each cache row entry is addressed by index (unless it's a fully associative cache), and the displacement is used to address the data within a cache row.
The tag in a cache is basically the location of the data in the physical memory right?
Not if tag and index are both based on the virtual address, since the data is accessed from the cache, not from memory. The physical address isn't required once the data is loaded into a virtually addressed cache. The cache would probably still have physical address information, needed for writes to cache (so the writes could be flushed to physical memory) and for "snooping" for any writes to physically addressed memory, such as DMA type memory writes, in order to invalidate or update cache entries.
The wiki article mentions using virtual indexed, physical tag for level 1 caches. For a non-associative cache, a portion of the virtual address is used to index cache row(s) (
n rows for a
n - way cache), the physical tag data is then read from the cache row(s) in parallel with the TLB virtual to physical address translation, then the cache and TLB physical tags are compared. Since the index to the cache is based on a virtual address, the physical tag in a cache row entry needs to include all address bits except for the displacement portion.
For a fully associative cache, the index isn't used, so the address tag needs to be all virtual or all physical.