Predict two consecutive claim reads while four interrupt gateways compete for one machine context.
Hardware context: ap_soc external interrupt gateways. Peripheral interrupt service and arbitration
Your bus monitor sees the controller just before the first claim. Compute the initial notification and both returned IDs. No arrival, completion or configuration write intervenes.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
trial | 10 | input of each check |
Full specification
Bits 0 through 3 represent IDs 1 through 4. The lowest three bits of weights hold ID 1’s unsigned priority. Each following group belongs to the next ID.
Examples
Example 1
First Observation- Input
pending=0x3, enabled=0x3, priorities [2,5,0,0], threshold=3
- Output
notify = 1, first = 2, second = 1
Both reads claim a source. Only the first winner exceeds the notification threshold.
Example 2
Second Observation- Input
pending=0xc, enabled=0xf, priorities [0,0,4,4], threshold=4
- Output
notify = 0, first = 3, second = 4
Both claims succeed at equal priority. The initial notification is quiet.
Example 3
Third Observation- Input
pending=0x8, enabled=0x7, priorities [1,2,3,7], threshold=0
- Output
notify = 0, first = 0, second = 0
The sole pending device is disabled. Both reads return zero.
Constraints and Contract
- A pending, enabled source with nonzero priority can be claimed. Prefer higher priority, then smaller ID. Return zero if none qualify. A claim consumes its pending bit. Threshold gates only notification, using strict greater-than.
Hints
Hint 1
Start with sources admitted by both masks.
Hint 2
Carry the first side effect into the next decision.
Hint 3
Evaluate notification at the time the monitor sampled it.
What the grader checks: All priority pairs and thresholds at equality, neighboring values, individual bits, empty and masked inputs, and mixed four-source snapshots.
328 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