RTL Design · Hard · SystemVerilog

Cache Line Store

Store tag, valid, dirty and four 32-bit words for each direct-mapped cache line.

Task

Implement 16 cache lines. Support indexed metadata writes and indexed word writes, and expose the selected line.

Examples

Constraints

What this problem is testing

A strong answer translates the requirement into synthesizable state and combinational logic, states reset and update semantics precisely, and handles boundary conditions rather than only the nominal case.

Interview habit: before coding, state reset behavior, the state that must be stored, and the conditions that update each output.

Verification plan

Edge cases worth testing

Common mistakes

Interview follow-up questions

Concepts to review

cache, memory, dirty bit

Open Cache Line Store in the HDLForge interactive editor.

Related problems

Explore the RTL Design Practice & Interview Preparation hub.

Continue practising