Remember which interrupt entered service, then release its slot on the matching end operation.
Hardware context: Interrupt service slot. Interrupt handler integration
A selector offers a pending interrupt ID and priority. Build the clocked service slot behind it. All IDs, priorities and masks are unsigned three-bit numbers.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
sample | 10 | input of each check |
Full specification
Synchronous active-high reset clears busy and owner. While idle, accept offered only when ack and pending are high and prio is below mask.
While busy, ignore offers. Clear both outputs only on eoi with end_id equal to owner, or reset. A new offer must wait until a later edge.
Examples
Example 1
Acknowledge ID 5 at Priority 3 Under Mask 4- Input
Acknowledge ID 5 at priority 3 under mask 4
- Output
busy = 1, owner = 5
The slot records ID 5.
Example 2
End ID 5 After Acknowledging ID 5- Input
End ID 5 after acknowledging ID 5
- Output
busy = 0, owner = 0
A matching retirement frees the slot.
Example 3
Offer ID 5 at Priority Equal to the Mask- Input
Offer ID 5 at priority equal to the mask
- Output
busy = 0, owner = 0
The mask comparison is strict.
Constraints and Contract
- Sample at each rising edge. Retain state between operations. ID zero is valid.
Hints
Hint 1
Start each edge from the old busy state.
Hint 2
Separate eligibility from acceptance.
Hint 3
Test an end ID close to the owner.
What the grader checks: Every priority pair and every retirement ID pair plus reset and conflicting operations.
147 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