Repair the bank of gateways that offers a second claim while the first handler still owns the device.
Hardware context: ap_soc external interrupt gateways. Peripheral interrupt service and arbitration
The starter computes next state for four level-sensitive gateways. Software can claim one source and complete another on the same edge. A slow device keeps its request high throughout service.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
trial | 10 | input of each check |
Full specification
Each device is idle, pending or in service. The pending and in_service masks never overlap. Bit 0 belongs to ID 1. The claim and complete inputs carry previously decoded IDs. Zero and IDs above four have no effect.
Examples
Example 1
First Observation- Input
pending=2, in_service=0, levels=2, claim=2, complete=0
- Output
pending = 0x0, in_service = 0x2
ID 2 leaves pending and enters service on this edge.
Example 2
Second Observation- Input
pending=0, in_service=2, levels=2, claim=0, complete=0
- Output
pending = 0x0, in_service = 0x2
The same high level waits while the handler owns ID 2.
Example 3
Third Observation- Input
pending=0, in_service=2, levels=2, claim=0, complete=2
- Output
pending = 0x0, in_service = 0x0
The completion frees the gateway. Sampling resumes on the next edge.
Constraints and Contract
- Apply each transition to the state before the edge. An idle high level becomes pending. Pending survives a falling level until its claim. A matching claim moves pending to service. Service persists until matching completion. A completed level is sampled again on the following edge.
Hints
Hint 1
Write its state before and after a claim.
Hint 2
Unrelated completions can share that edge.
Hint 3
Try a source that never deasserts during service.
What the grader checks: Independent next-state transitions for all four gateways, every valid and invalid ID, simultaneous operations and level changes.
303 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