An interrupt doesn't belong to any one block. It starts as a hardware event inside a peripheral, crosses into an interrupt controller that aggregates it with dozens of others, and ends as a trap the CPU services in software - three different pieces of logic, usually in three different clock domains, that all have to agree on what happened and when. A peripheral's own testbench can prove it raises the signal correctly. Only an SoC-level bench can prove the interrupt actually survives the trip to the handler.
8 min read | Intermediate Level
What You'll Learn
- Why an interrupt is a cross-block signal that no single block's testbench can fully verify on its own
- The classic clear-versus-reassert race that silently drops a real interrupt
- How to verify a shared interrupt line correctly identifies which of several sources actually fired
- Why interrupt latency needs a repeatable measurement, not just a functional pass/fail
- Why an interrupt arriving mid-ISR, or while its own handler's DMA is still running, needs its own tests
Why an Interrupt Is a Cross-Block Signal, Not a Local One
A peripheral's block-level bench can confirm the peripheral raises its interrupt output under the right condition - that part is a local, single-block check.
Everything that happens next is cross-block by definition: the raw signal reaching an interrupt controller, getting combined with every other source feeding that controller, getting masked or prioritized against the CPU's current state, and finally landing as a trap the CPU actually takes. A bug in any one of those handoffs can make a perfectly correct peripheral produce an interrupt that software never sees.
The Clear-Versus-Reassert Race: How a Real Interrupt Goes Missing
The single most common interrupt bug is a lost event at the exact moment software is clearing the last one. An ISR reads a peripheral's status, sees the interrupt is pending, and writes back to clear it. If the peripheral raises a brand-new interrupt condition in that same narrow window - just before, during, or just after the clearing write - some implementations miss it entirely.
A level-sensitive line usually survives this, since the CPU simply resamples the line and sees it's still asserted. An edge-sensitive one is far more fragile: if the clear logic and the new edge land close enough together, the edge-detection circuit can treat the clear as having already consumed that edge, and the second, genuinely new interrupt never gets flagged at all.
Verifying this means deliberately constructing the race, not hoping a random test stumbles into it - drive the peripheral's second event to land inside the exact cycle the ISR's clear write is in flight, and confirm the interrupt is still pending afterward:
task test_clear_reassert_race();
fork
begin
// Sequence acting as the CPU: read status, then clear it
read_reg(STATUS_REG);
write_reg(STATUS_REG, CLEAR_BIT);
end
begin
// Drive a brand-new event timed to land during that clear
#(CLEAR_WRITE_DELAY) pulse_peripheral_event();
end
join
read_reg(STATUS_REG);
if (status_reg_val[PENDING_BIT] !== 1)
`uvm_error("IRQ_RACE", "Interrupt reasserted during clear was dropped")
endtask
Mistake: Only testing a clean assert-service-clear sequence, one interrupt at a time.
That sequence never puts a new event anywhere near the clearing write, so it can pass cleanly on hardware that would silently drop a real back-to-back interrupt. The race has to be constructed on purpose; it essentially never happens by accident in a directed test.
Shared Interrupt Lines: Finding the Right Source Among Many
Most interrupt controllers aggregate many raw sources onto fewer physical lines reaching the CPU, and software disambiguates by reading a cause or status register once it traps. That register has to reflect reality exactly: if two sources assert at once, both bits need to be set, not just whichever one the hardware happened to sample first.
And acknowledging or clearing one source's bit must not touch any other source's bit that also happens to be pending - a shared clear-on-read or clear-on-write path is an easy place for one interrupt's service routine to accidentally swallow a different, unrelated one.
This is the same aggregation problem the SoC address map's connectivity matrix deals with, just one layer up - many contributors feeding one shared resource, where the verification job is proving each one's identity survives the merge intact.
Interrupt Latency: How Fast Is Fast Enough
Plenty of interrupts have a real timing budget - an audio buffer that has to be refilled before it underruns, a real-time control loop with a hard deadline. Correctness alone doesn't prove the budget is met; that needs an actual latency measurement, timestamped from the cycle the hardware event occurs to the cycle the CPU's handler starts executing, repeated across enough runs to catch the worst case, not just a typical one.
A single passing run says the path works; it says nothing about whether it's fast enough under load, with other traffic competing for the same interconnect and the same CPU cycles the ISR needs to even begin running.
Interrupts Racing Against Other Cross-Block Activity
Two more scenarios are worth testing deliberately because they only exist at SoC level, never at block level. First, a higher-priority interrupt arriving while a lower-priority one's ISR is already running - the controller has to correctly preempt, and the CPU has to correctly resume the first ISR afterward rather than losing track of where it was.
Second, an interrupt whose handler is going to kick off a DMA transfer, arriving while a different DMA channel from a completely unrelated transfer is still in flight on the shared bus - the interconnect and DMA arbitration this chapter already covered have to hold up under that extra contention, and a scoreboard reused from block level has no way to catch a bug that only exists in that overlap.
Common Mistakes
Mistake: Treating "the ISR eventually ran" as proof the interrupt path is correct.
A single interrupt serviced correctly says nothing about whether a second, closely timed one would have been dropped by the clear-reassert race, or whether a shared line correctly attributes two simultaneous sources. Each of those needs its own deliberately constructed scenario.
Mistake: Measuring interrupt latency once, under no other bus traffic.
Real interrupts fire while the interconnect is busy with everything else the SoC is doing. A latency number measured in isolation doesn't represent the case that actually matters - the worst case, under realistic contention.
Mistake: Assuming a shared status register's clear-on-write only affects the bit software intended to clear.
A write that clears more bits than intended silently drops a second, unrelated interrupt that happened to be pending at the same moment - a bug that only shows up when two sources actually overlap in time, which single-source testing never produces.
Summary
In this article, you learned:
- An interrupt crosses from a peripheral through an interrupt controller to the CPU, and only an SoC-level bench can verify that whole path, not any one block's own testbench
- The clear-versus-reassert race can silently drop a real interrupt on edge-sensitive lines, and needs a deliberately constructed test that lands a new event during the clearing write
- A shared interrupt line's status register needs to correctly reflect every simultaneously pending source, and clearing one source must not clear another
- Interrupt latency needs an actual timestamped measurement under realistic bus contention, not just a single clean pass
- Priority preemption and an interrupt landing during unrelated DMA activity are cross-block scenarios that only exist at SoC level and need their own dedicated tests