Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Check coherent transactions under reordering

Hardware interview practice

Check coherent transactions under reordering

HardComputer ArchitecturePYTHON

Two masters access two cache lines. Accepted operations to each line serialize in acceptance order; responses for different lines may reorder. Design an executable reference model that checks retry handling, snoop acknowledgements, coherent data, completion uniqueness, and end-of-test drainage.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Starting point

Question code

request: master, id, op, line, data
snoop: target, line, invalidate, ack
response: master, id, status, data
IDs unique while outstanding; retry means not accepted; reset line value=0
Reviewed example

Work through one case

Input
M0 and M1 share line L; M0's write is accepted, but completion arrives before M1's invalidate acknowledgement
Expected output
AssertionError naming missing acknowledgement from master 1

The write cannot become the coherent line owner or update expected data until every other current sharer acknowledges invalidation.

What to cover

Requirements

  1. Track only accepted requests by ID and update no state for a retry; the same ID may later be accepted.
  2. Maintain owner, sharers, and data per line; reads observe serialized line state and writes commit only after all required invalidation acknowledgements.
  3. Permit response reordering across lines but require acceptance order within each line and exactly one completion per accepted ID.
  4. Detect unknown or duplicate completion, stale read data, missing snoop acknowledgement, and nonempty outstanding state at test end.
Continue practicing

Related questions

Computer ArchitectureUse the Exclusive cache-coherence state→CoherenceMeaning of the MOESI Owned state→
asic.fyi · Learn silicon end to end.info@asic.fyi