← RTL Design Interviews · SoC Architecture Interviews

Interview Question · Reason About Traffic and Performance

Start the Cache Before Translation Finishes

L2 Mid-LevelL3 Seniortraffic and performance

The Question

The interviewer asks

The L1 cache must select a set while the TLB looks up the physical frame. Which address bits can both paths trust?

Reveal the Model Answer

The ap_soc core runs only in machine mode and issues physical addresses directly. It has no memory management unit (MMU) to translate virtual addresses. In this model translation preserves the offset within the page. Select a set using offset bits and read its ways while the TLB works. Compare physical tags after translation and check permission before delivering data.

Self-Check

Tick each key point you covered in your answer.

What Interviewers Want to Hear (Mid-Level)

Locate the set bits in the unchanged page offset.

Choose Your Follow-up

I’ve answered the opening question

Choose the route closest to your reasoning. Answer the follow-up aloud, then open the closing question.

I used page-offset bits.

The trace maps 00404010 and 00407010 to frame 06. Why does the second load hit line 001?

Reveal the Model Answer

With 4 KiB pages, the low 12 bits survive translation. A 16-byte block uses four bits, leaving eight for the set. Both addresses have offset hex 010, so both select set 1 and match frame 06.

Self-Check

Tick each key point you covered in your answer.

Size a 32 KiB L1

The design needs 32 KiB, 4 KiB pages and 64-byte blocks. How many sets and ways preserve early indexing without special mapping rules?

Reveal the Model Answer

Six block bits leave six set bits, allowing 64 sets. Each way holds 64 × 64 bytes = 4 KiB. Use at least 32 / 4 = 8 ways and compare their tags in parallel. Check the hit path with eight comparators. A system whose smallest page is 16 KiB can use 16 KiB ways.

Self-Check

Tick each key point you covered in your answer.

I doubled the set count.

In the 512-line replay, a store writes 22222222 through 00404010. Why does 00407010 still return 11111111?

Reveal the Model Answer

Nine index bits plus four block bits require 13 bits. Bit 12 can differ between names for the same physical block. The store updates line 001 while line 101 retains its old copy.

Self-Check

Tick each key point you covered in your answer.

Size a 32 KiB L1

The design needs 32 KiB, 4 KiB pages and 64-byte blocks. How many sets and ways preserve early indexing without special mapping rules?

Reveal the Model Answer

Six block bits leave six set bits, allowing 64 sets. Each way holds 64 × 64 bytes = 4 KiB. Use at least 32 / 4 = 8 ways and compare their tags in parallel. Check the hit path with eight comparators. A system whose smallest page is 16 KiB can use 16 KiB ways.

Self-Check

Tick each key point you covered in your answer.

I proposed a software mapping rule.

Changing the second name to 00406010 gives “line 001 | frame 06 | hit”. What promise would software have to keep?

Reveal the Model Answer

Both names now agree on bit 12. Every mapping of this physical block must select the same set, including any mapping created later. One successful pair tests only those two names.

Self-Check

Tick each key point you covered in your answer.

Size a 32 KiB L1

The design needs 32 KiB, 4 KiB pages and 64-byte blocks. How many sets and ways preserve early indexing without special mapping rules?

Reveal the Model Answer

Six block bits leave six set bits, allowing 64 sets. Each way holds 64 × 64 bytes = 4 KiB. Use at least 32 / 4 = 8 ways and compare their tags in parallel. Check the hit path with eight comparators. A system whose smallest page is 16 KiB can use 16 KiB ways.

Self-Check

Tick each key point you covered in your answer.

What People Get Wrong

Common wrong answers and why they fail.

Half-Truth

Two virtual names always require two cache lines.

Both names can select the same set and match the same frame.

Half-Truth

A physical tag finds every copy.

Comparators see only the ways in the selected set.

Learn It, Then Prove It