A DMA retirement trace counts a write for the wrong guest. Locate the first disagreement and repair the commit guard.
Hardware context: Two-stage DMA page filter. Virtualised device access
In this exercise, translation has finished. Each write ticket carries the owner recorded when the request entered the queue. Decide if it may retire now.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
snapshot | 11 | input of each check |
Full specification
| Input | Meaning at this sample |
|---|---|
| valid | The slot holds a write ticket. |
| guest_write_ok, host_write_ok | Both stages must permit a write. |
| revoked | A set bit cancels the ticket. |
| ticket, owner | Three-bit saved and current owner codes. Every bit must match. |
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
Idle Slot- Input
Flags 0000, ticket 2, owner 2
- Output
commit = 0
The empty slot produces no write.
Example 2
Matching Ticket- Input
Flags 1110, ticket 2, owner 2
- Output
commit = 1
Both stages permit this live write for owner two.
Example 3
Revoked Ticket- Input
Flags 1111, ticket 2, owner 2
- Output
commit = 0
Revocation cancels the otherwise permitted transfer.
Constraints and Contract
- Drive commit high exactly when all four qualifications hold and the owners match. Use a combinational decision on known binary inputs.
Hints
Hint 1
Read the flags in port order.
Hint 2
Find the first sample where the target sees an unexpected write.
Hint 3
Compare the saved and current ownership codes at that sample.
What the grader checks: All known binary combinations at a single write retirement point.
27 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