Integrated Diagram: TLB and Cache Operations for a Logical/Virtual Address
A modern processor typically performs address translation (virtual physical) via a keywordTLB/keyword, and then performs a cache lookup (using the resulting address) in one or more **keywordcaches/keyword.
The most integrated “mental model” is: TLB lookup gates the cache lookup, because many cache designs are indexed/tagged with the physical address after translation.
Below is a unified diagram for a single logical/virtual address generated by the processor, showing both the TLB path and cache path, including the main miss/retry flows. (The exact internal policy—e.g., whether the cache lookup is partially speculative—is implementation dependent.)
Key points captured by the diagram:
- keywordTLB hit/keyword: Translation exists; cache lookup can proceed using PA.
- keywordTLB miss/keyword: A **keywordpage-table walk/keyword runs (often involving additional memory reads), then the TLB is updated and the request is retried.
- Cache miss flow: After PA is known, lookup continues through lower cache levels and/or memory until the block/line is fetched and filled.
Integrated VA → PA → Cache Flow (Single Request)
Addressing
1. VA generatedCPU produces a virtual address (VA) and identifies whether it’s instruction (ITLB) or data (DTLB)."
Translation
2. TLB lookupTLB lookup uses the VA page number; outcome is HIT (PA ready) or MISS (page walk needed)."
Physical address
3. PA formedPA = translated physical page base + original page offset."
Caching
4. Cache lookupCache hierarchy lookup proceeds using PA (often for indexing/tagging)."
Refill + retry
5. Fill on missOn TLB miss, translation inserted and operation retried; on cache miss, lines are fetched and filled."
End-to-end sequence for one logical/virtual address
- 1Step 1
CPU forms VA and routes it to ITLB (instruction fetch) or DTLB (load/store).
- 2Step 2
Search TLB for VA page number; check valid/permission bits as part of translation.
- 3Step 3
Compute PA by combining translated physical page base with the VA page offset.
- 4Step 4
Perform L1 cache lookup (and possibly proceed to L2/memory on miss) using PA.
- 5Step 5
On miss, query the next cache level; if still missing, fetch the line from memory and fill.
- 6Step 6
Run page-table walk to resolve VA→PA, insert translation into TLB, then restart the cache lookup with PA.
Pro Tip: Think of TLB as a gate to PA-based caching
Even when pipelines overlap work, most cache tag checks logically depend on having a trustworthy PA, so translation is treated as the gating step for correct caching.
Warning: Exact timing/speculation differs by microarchitecture
Some designs may speculatively start cache accesses (or use tricks like VIPT), but the core correctness still requires translation and permission checks for final PA usage.
To further ground the diagram, here’s a compact “decision table” aligning the two subsystems:
keywordPA/keyword becomes the common “currency” for caching in many designs, while keywordVA/keyword is what the TLB consumes.
Where time is spent on typical misses (conceptual)
Conceptual relative latency components (illustrative, not universal).
Common modeling questions
Virtual Memory & TLB - Address Translation and Caching (conceptual walkthrough)
Knowledge Check
In the integrated flow, what primarily gates cache lookup correctness on many architectures?
Explore Related Topics
Various Addressing Modes of 8051 Microcontroller
The 8051 microcontroller provides multiple addressing modes that define how an instruction identifies the location or value of its operand.
- Immediate (
#data) – constant value encoded in the instruction, used for loading fixed numbers. - Register (
Rn) – operand resides in CPU registers R0‑R7 (or A/B), giving the shortest and fastest code. - Direct (
addr) – 8‑bit address is part of the opcode, accessing internal RAM or SFRs directly. - Register indirect (
@R0,@R1,@DPTR) – a register holds the operand’s address, enabling pointer‑like traversal of memory. - Indexed (
@A+DPTRor@A+PC) – adds the accumulator to DPTR or PC for table look‑ups in code memory; branch modes (relative, absolute, long) extend this concept for short, page‑limited, and full‑range jumps.
Translating Arithmetic Expressions into Three-Address Code (TAC): From Syntax Tree to TAC
Inverted Page Table
An inverted page table (IPT) is a global paging structure that keeps one entry per physical frame, recording the virtual page, process ID, and status bits, thus reducing page‑table memory.
- Fields: frame index, VPN, PID/ASID, control bits, hash/link.
- Entries = Physical memory ÷ page size (e.g., ).
- Lookup uses PID + VPN key; hashing and TLB hide most cost.
- Benefit: memory usage depends on frames, not on all virtual pages.
- Cost: slower translation than direct indexing; relies on hashing/TLB.