RN-F1 wrote 5a into its cache, yet RN-F0 reads 00. Find the first wrong cycle in the home node, name the cause, then repair it.
Hardware context: A CHI-style home node with a snoop filter. Coherent interconnect design and debug
This model home node serves one cache line for two requesters, RN-F0 and RN-F1. It keeps a two-bit snoop filter, present, with one bit per requester that may hold the line.
In the failing run, RN-F1 takes the line with ReadUnique and stores 5a to it. RN-F0 then issues ReadShared and receives stale data. Read the waveform, choose the cause and fix the design.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
sample | 10 | input of each check |
Full specification
On a request the home snoops the other requester only when its filter bit is set; otherwise it reads memory. ReadShared sends SnpShared, ReadUnique sends SnpUnique. The home never reads memory while a snoop is outstanding.
A response with data completes from that data. A response without data sends the home to memory. Passed-dirty data is written to memory in the completion cycle. The grant is SC when the snooped cache kept a copy, otherwise UC.
A response that did not keep a copy clears that requester's filter bit. Each completion sets the requester's bit. Outputs are zero whenever their valid is low.
Each phase lasts one cycle except the wait for the snoop response. CompAck is left out of this model. The rules come from Arm IHI 0050 issue G. B4.4.1 says the Unique Dirty holder must be snooped. Table B4.25 expects the forwarding snoops SnpSharedFwd and SnpUniqueFwd; this model uses the plain snoops, a substitution B4.4.2 permits. Tables B4.46 and B4.47 give responses.
Diagnose the Failing Run
The test below runs the buggy design. Read its log, then find where it first goes wrong in the waveform.
Log
Waveform
Click a signal at a cycle to select it. Or focus the waveform and use the arrow keys: Left and Right move one cycle, Up and Down one signal.
Step 3 is optional: fix the code in the editor, then run the tests.
Examples
Example 1
Reset- Input
reset: rst_n=0, req_valid=0, req_src=0, req_unique=0, rsp_valid=0, rsp_data=0, rsp_dirty=0, rsp_kept=0, rsp_line=8'h00
- Output
comp_line = 0x0, comp_state = none (0), comp_tgt = 0, comp_valid = 0, mem_wdata = 0x0, mem_wr = 0, mem_rd = 0, snp_unique = 0, snp_tgt = 0, snp_valid = 0
Every output is quiet after reset.
Example 2
First Request- Input
request: rst_n=1, req_valid=1, req_src=0, req_unique=1, rsp_valid=0, rsp_data=0, rsp_dirty=0, rsp_kept=0, rsp_line=8'h00
- Output
comp_line = 0x0, comp_state = none (0), comp_tgt = 0, comp_valid = 0, mem_wdata = 0x0, mem_wr = 0, mem_rd = 1, snp_unique = 0, snp_tgt = 0, snp_valid = 0
The filter is empty, so the home reads memory in the next cycle.
Example 3
Completion- Input
memory: rst_n=1, req_valid=0, req_src=0, req_unique=0, rsp_valid=0, rsp_data=0, rsp_dirty=0, rsp_kept=0, rsp_line=8'h00
- Output
comp_line = 0x0, comp_state = UC (2), comp_tgt = 0, comp_valid = 1, mem_wdata = 0x0, mem_wr = 0, mem_rd = 0, snp_unique = 0, snp_tgt = 0, snp_valid = 0
The memory word goes to the requester as Unique Clean.
Constraints and Contract
- Keep the ports, the model codes and the cycle timing. Sample inputs on the rising edge. Request and snoop-response payloads are meaningful only with their valid signal high. Memory read data is valid during mem_rd. The bench owns the memory and the two requesters.
- Stay inside your module: hierarchical names, $root, force, release, bind and defparam are refused.
Hints
Hint 1
Find the cycle after RN-F0's request. What should the home send?
Hint 2
Which filter bit records that RN-F1 holds the line?
Hint 3
Check the index used when the request arrives.
What the grader checks: Three scripted runs of 20 requests each, with real requester behaviour, silent stores and silent clean evictions, are checked cycle by cycle.
395 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 2 problems on this path