SoC Verification: Interrupt Verification & Interrupt Handling – A Complete Guide
Modern System-on-Chip (SoC) designs integrate dozens or even hundreds of peripherals such as timers, UARTs, GPIOs, DMA engines, USB controllers, PCIe controllers, and AI accelerators. Since the processor cannot continuously poll every peripheral, interrupt mechanisms are used to notify the CPU whenever an event requires immediate attention.
Interrupt verification is therefore one of the most important parts of SoC verification. A single bug in interrupt handling can lead to missed events, system hangs, incorrect priority handling, or data corruption.
This article explains interrupt concepts, interrupt handling flow, architecture, verification methodology, common bugs, and coverage strategies used by ASIC verification engineers.
What is an Interrupt?
An interrupt is a signal generated by hardware or software that temporarily stops the normal execution of the processor and requests immediate servicing.
Instead of continuously checking every peripheral (polling), the processor responds only when an interrupt occurs.
Typical interrupt sources include:
- Timer expiration
- UART receive complete
- GPIO edge detection
- DMA transfer completion
- Watchdog timeout
- Hardware faults
- Software-generated interrupts
The processor pauses the current program, executes a special routine called the Interrupt Service Routine (ISR), and then resumes execution from the point where it was interrupted.
Why Interrupts are Important
Interrupts provide several advantages:
- Faster response to external events
- Better CPU utilization
- Reduced software overhead
- Lower power consumption
- Real-time responsiveness
Without interrupts, processors would waste cycles continuously polling peripherals.
Interrupt Handling Flow
A typical interrupt sequence follows these steps:
The interrupt controller acts as the bridge between peripherals and the processor by collecting interrupt requests, assigning priorities, and forwarding the appropriate interrupt to the CPU.
Types of Interrupts
Interrupts can be classified in multiple ways.
1. Based on Source
External Interrupts
Generated by hardware peripherals such as:
- GPIO
- UART
- Timer
- Ethernet
- USB
- PCIe
Internal Interrupts
Generated inside the processor due to:
- Divide-by-zero
- Illegal instruction
- Memory fault
- Software interrupt
- Debug events
2. Based on Masking
Maskable Interrupts
These interrupts can be enabled or disabled by software.
Examples:
- UART interrupt
- Timer interrupt
- GPIO interrupt
Non-Maskable Interrupts (NMI)
These cannot be disabled because they represent critical events.
Examples:
- Hardware failure
- Power failure
- Watchdog reset
3. Based on Triggering
Level-Triggered Interrupt
The interrupt remains active as long as the signal remains asserted.
Example:
IRQ ██████████
Edge-Triggered Interrupt
Generated only during signal transitions.
Examples:
- Rising edge
- Falling edge
- Both edges
IRQ ____/‾‾‾‾
Typical Interrupt Architecture
A simplified interrupt architecture looks like:
The interrupt controller performs:
- Interrupt collection
- Priority resolution
- Interrupt masking
- Pending status management
- Routing interrupts to CPU cores
CPU Interrupt Handling Steps
When an interrupt occurs, the processor typically performs the following sequence:
Step 1: Interrupt Request
A peripheral asserts the interrupt request signal.
INT_REQ = 1
Step 2: Finish Current Instruction
Modern processors generally complete the current instruction before servicing the interrupt.
Step 3: Interrupt Acknowledge
The CPU acknowledges the interrupt request.
IRQ_ACK = 1
Step 4: Save Processor Context
The CPU saves:
- Program Counter (PC)
- Processor Status Register (PSR)
- General-purpose registers
- Stack Pointer (if required)
Step 5: Fetch ISR Address
The processor obtains the ISR address from the interrupt vector table.
Step 6: Execute ISR
The Interrupt Service Routine:
- Clears interrupt source
- Services peripheral
- Processes data
- Updates registers
Step 7: End of Interrupt (EOI)
The CPU informs the interrupt controller that servicing has completed.
Step 8: Restore Context
Previously saved registers are restored.
Step 9: Resume Execution
Execution continues exactly where it was interrupted.
Key Interrupt Signals
A typical interrupt interface includes:
| Signal | Purpose |
|---|---|
| INT_REQ | Interrupt request from peripheral |
| IRQ | Interrupt line to CPU |
| IRQ_ACK | CPU acknowledges interrupt |
| ENABLE | Enables interrupt |
| MASK | Masks interrupt |
| PEND | Indicates pending interrupt |
| PRIORITY | Interrupt priority level |
| EOI | End of interrupt |
| INT_VEC | Interrupt vector number |
| NMI | Non-maskable interrupt |
Interrupt Verification Checklist
An interrupt verification plan should ensure that every stage of interrupt handling functions correctly.
Key verification points include:
- Interrupt generation from every source
- Delivery to interrupt controller
- Delivery to CPU
- Priority resolution
- Interrupt masking and unmasking
- Interrupt acknowledgment
- ISR execution
- Context save and restore
- End-of-Interrupt signaling
- Return to previous program
- Prevention of interrupt loss
- Prevention of duplicate interrupts
- Correct interrupt re-triggering after de-assertion
Important Verification Scenarios
Interrupt logic must be verified under both normal and corner-case conditions.
Normal Scenarios
- Single interrupt
- Multiple interrupt sources
- Different priority levels
- Mask and unmask operations
- ISR execution
- Correct EOI sequence
Corner Cases
- Back-to-back interrupts
- Simultaneous interrupts
- Interrupt during reset
- Interrupt during sleep or idle mode
- Nested interrupts
- Interrupt while another ISR is executing
- Spurious interrupts
- Interrupt flood or stress testing
- Mask/unmask during active interrupts
- Priority inversion scenarios
These scenarios help ensure robust interrupt behavior under real-world conditions.
Common Interrupt Bugs
Interrupt-related issues are common during SoC verification. Typical bugs include:
- Missed interrupt due to synchronization issues
- Incorrect priority arbitration
- Interrupt not cleared after ISR execution
- Re-triggering caused by incorrect EOI handling
- Corrupted CPU context after ISR
- Interrupt delivered while masked
- Wrong interrupt vector address
- False or spurious interrupt detection
- Duplicate interrupt delivery
- Lost interrupt under heavy traffic
Identifying these bugs early prevents expensive silicon re-spins.
Interrupt Verification Environment
A UVM-based interrupt verification environment typically consists of:
The environment generally includes:
- Random and directed test sequences
- Interrupt generators
- Register access sequences
- Monitors and protocol checkers
- Assertions for timing and protocol
- Scoreboards for end-to-end validation
- Functional coverage collection
Coverage Points
High functional coverage ensures confidence that all interrupt functionality has been exercised.
Typical coverage points include:
- Interrupt source coverage
- Interrupt type (level/edge) coverage
- Priority level coverage
- Mask and unmask coverage
- ISR entry and exit coverage
- EOI and acknowledgment coverage
- Spurious interrupt coverage
- Error handling coverage
- Cross coverage of source × priority × trigger type
A well-designed coverage model helps identify untested scenarios before tape-out.
Best Practices for Interrupt Verification
To improve verification quality:
- Develop both directed and constrained-random tests.
- Verify the complete interrupt flow from generation to ISR completion.
- Include assertions for protocol and timing checks.
- Stress-test the interrupt controller with high interrupt rates.
- Validate nested and simultaneous interrupt handling.
- Ensure proper context save and restore during ISR execution.
- Collect comprehensive functional coverage and close all coverage gaps.
-
Test across different power modes, reset conditions, and CPU states.
Conclusion
Interrupt handling is fundamental to reliable SoC operation, enabling processors to respond quickly and efficiently to hardware and software events. Because interrupts influence system responsiveness, reliability, and real-time performance, verifying them thoroughly is essential.
A robust interrupt verification strategy should validate the entire flow—from interrupt generation and prioritization to delivery, acknowledgment, ISR execution, and return—while also stressing corner cases such as nested, simultaneous, and spurious interrupts. Combining comprehensive UVM testbenches, protocol assertions, scoreboards, and functional coverage ensures high confidence in the design before silicon tape-out.
Whether you're verifying an interrupt controller, CPU subsystem, or a complete SoC, meticulous interrupt verification is key to building reliable, deterministic, and bug-free systems.

Comments
Post a Comment