Interrupt Controller in SoC: A Complete Beginner's Guide to Working, Types, Priority Handling & Architecture
Interrupt Controller in SoC: A Complete Beginner's Guide to Working, Types, Priority Handling & Architecture
Modern processors interact with hundreds of hardware peripherals, including timers, keyboards, USB controllers, UARTs, Ethernet interfaces, DMA controllers, sensors, and storage devices. These peripherals continuously generate events that require the processor's attention.
If the CPU constantly checked every peripheral to determine whether it needed servicing, most of its processing power would be wasted. Instead, modern computer systems use an Interrupt Controller, which efficiently collects, prioritises, and forwards interrupt requests to the processor only when necessary.
The Interrupt Controller is one of the most important hardware blocks in System-on-Chip (SoC) design, Computer Architecture, Embedded Systems, Operating Systems, ASIC Design, and ASIC Verification.
In this article, you'll learn what an Interrupt Controller is, why it is required, how it works, its architecture, types, registers, priority handling, interrupt flow, applications, and verification concepts.
What is an Interrupt?
An Interrupt is a signal generated by hardware or software that temporarily stops the normal execution of the CPU and requests immediate attention.
When an interrupt occurs:
CPU pauses the current program.
Saves its current execution context.
Executes a special function called the Interrupt Service Routine (ISR).
Restores the saved context.
Resumes execution of the interrupted program.
Instead of continuously checking every peripheral (polling), the CPU responds only when an event actually occurs.
What is an Interrupt Controller?
An Interrupt Controller is a dedicated hardware block that manages interrupt requests from multiple peripherals and forwards the appropriate interrupt to the CPU.
Its responsibilities include:
Collecting interrupt requests
Prioritising multiple interrupt sources
Masking or enabling interrupts
Sending interrupt requests to the CPU
Tracking active interrupts
Supporting nested interrupts
Clearing interrupts after servicing
Without an interrupt controller, every peripheral would need a direct connection to the processor, making the system complex and difficult to scale.
Why Do We Need an Interrupt Controller?
Imagine a processor connected to:
Timer
UART
USB
DMA
GPIO
Ethernet
SPI
I²C
Each device can generate interrupts independently.
Without an Interrupt Controller:
CPU would need numerous interrupt input pins.
Simultaneous interrupts would create conflicts.
No mechanism would exist to determine which interrupt should be serviced first.
CPU performance would decrease significantly.
The Interrupt Controller solves these problems by acting as a central interrupt management unit.
Polling vs Interrupts
Before understanding the controller, it helps to compare polling and interrupts.
Position of the Interrupt Controller in an SoC
A simplified architecture looks like this:
How Does an Interrupt Controller Work?
The overall sequence is straightforward:
A peripheral generates an interrupt request.
The Interrupt Controller captures the request.
The controller determines its priority.
The highest-priority interrupt is forwarded to the CPU.
CPU acknowledges the interrupt.
CPU saves its execution context.
CPU executes the Interrupt Service Routine (ISR).
ISR clears the interrupt source.
CPU sends an End Of Interrupt (EOI) signal.
Controller removes the interrupt from its pending list.
CPU resumes normal execution.
This process typically completes within a few microseconds or less in modern processors.
Internal Architecture of an Interrupt Controller
A typical interrupt controller consists of several internal hardware blocks.
1. Interrupt Input Logic
This block receives interrupt requests from peripherals.
Examples:
Timer IRQ
UART IRQ
DMA IRQ
GPIO IRQ
Ethernet IRQ
It synchronises and validates incoming interrupt signals.
2. Interrupt Request Register (IRR)
The IRR stores all pending interrupt requests.
.
3. Priority Resolver
If multiple interrupts occur simultaneously, the Priority Resolver determines which interrupt should be serviced first.
Priority may be:
Fixed
Programmable
Rotating
Dynamic
The selected interrupt is forwarded to the CPU.
4. Interrupt Mask Register (IMR)
The IMR allows software to enable or disable interrupts.
Example:
1 = Interrupt Enabled
0 = Interrupt Masked
Masking is useful when:
Debugging
Performing critical operations
Preventing unnecessary interrupts
5. In-Service Register (ISR)
This register keeps track of interrupts currently being serviced.
It prevents:
Duplicate servicing
Incorrect nesting
Conflicts between interrupts
6. End of Interrupt (EOI) Logic
After the Interrupt Service Routine finishes:
CPU sends an EOI signal.
Controller clears the interrupt.
Next pending interrupt becomes eligible for service.
Types of Interrupts
Interrupts can be classified in several ways.
1. Hardware Interrupts
Generated by hardware devices.
Examples:
Keyboard
Timer
UART
DMA
Ethernet
GPIO
2. Software Interrupts
Generated by software instructions.
Used for:
System calls
Operating system services
Debugging
3. Maskable Interrupts
These interrupts can be enabled or disabled by software.
Examples:
UART receive interrupt
Timer interrupt
4. Non-Maskable Interrupt (NMI)
Cannot be disabled.
Used for critical situations such as:
Watchdog timeout
Power failure
Hardware fault
Memory parity error
Priority Handling
Modern processors receive interrupts from many sources.
Fixed Priority
Priority order never changes.
Programmable Priority
Software assigns priorities dynamically.
Advantages:
Flexible
Suitable for operating systems
Better resource allocation
Rotating Priority
After servicing one interrupt:
That interrupt moves to the lowest priority.
This prevents starvation of lower-priority devices.
Interrupt Trigger Types
Interrupts can be triggered in two ways.
Interrupt Service Routine (ISR)
An Interrupt Service Routine is the function executed when an interrupt occurs.
Typical ISR steps:
Save CPU context.
Identify interrupt source.
Service the peripheral.
Clear interrupt flag.
Send End Of Interrupt (EOI).
Restore CPU context.
Return to the interrupted program.
ISRs should be:
Short
Efficient
Deterministic
Long ISRs increase interrupt latency and reduce system performance.
Nested Interrupts
Sometimes a higher-priority interrupt arrives while another ISR is executing.
Example:
CPU is servicing:
UART interrupt
During execution:
Watchdog interrupt occurs.
Since Watchdog has higher priority:
UART ISR is paused.
Watchdog ISR executes.
CPU returns to UART ISR.
Original program resumes.
This is called Nested Interrupt Handling.
Daisy-Chained vs Centralised Interrupt Controllers
Daisy-Chained
Interrupts pass from one peripheral to another.
Advantages:
Simple
Low cost
Disadvantages:
Longer latency
Limited scalability
Centralised Controller
All peripherals connect directly to one controller.
Advantages:
Faster
Better priority handling
Easier expansion
Used in modern SoCs
Interrupt Latency
Interrupt latency is the time between:
Interrupt generation
and
Execution of the first ISR instruction.
Latency depends on:
CPU pipeline
Cache state
Controller design
Context save time
Operating system
Reducing latency is essential in real-time systems.
Real-World Example
Imagine a smartphone:
While watching a video:
Timer generates scheduling interrupt.
Touchscreen generates touch interrupt.
Wi-Fi receives packets.
Audio codec requests new samples.
Battery controller reports low battery.
The Interrupt Controller:
Collects all requests.
Prioritises them.
Delivers one interrupt at a time.
Ensures critical events are serviced first.
Without it, the CPU would struggle to manage these simultaneous events efficiently.
Popular Interrupt Controllers
Several interrupt controllers are widely used in industry.
ARM Generic Interrupt Controller (GIC)
Used in ARM Cortex-A processors.
Features:
Hundreds of interrupt sources
Multi-core support
Nested interrupts
Programmable priorities
Nested Vectored Interrupt Controller (NVIC)
Used in ARM Cortex-M microcontrollers.
Features:
Fast interrupt response
Vector table
Hardware prioritisation
Low latency
Advanced Programmable Interrupt Controller (APIC)
Used in x86 processors.
Features:
Multi-core interrupt management
Inter-processor interrupts (IPI)
High scalability
Verification of Interrupt Controllers
Interrupt Controllers are thoroughly verified before tape-out.
Typical verification scenarios include:
Single interrupt
Multiple simultaneous interrupts
Priority resolution
Interrupt masking
Nested interrupts
End Of Interrupt handling
Interrupt acknowledgement
Spurious interrupts
Level-triggered interrupts
Edge-triggered interrupts
Reset behaviour
Verification environments typically use SystemVerilog, UVM, assertions, and functional coverage.
Advantages of an Interrupt Controller
Efficient CPU utilisation
Faster event handling
Reduced polling overhead
Supports multiple peripherals
Prioritised interrupt servicing
Lower power consumption
Improved real-time performance
Scalable architecture
Simplified CPU design
Disadvantages
Additional hardware complexity
Increased silicon area
Verification challenges
Priority configuration complexity
Interrupt latency if many requests are pending
Applications
Interrupt Controllers are found in almost every digital system, including:
Smartphones
Laptops
Servers
Automotive ECUs
Industrial controllers
Networking equipment
IoT devices
Medical electronics
Aerospace systems
Consumer electronics
FPGA-based systems
ASICs and SoCs
Best Practices
When designing or verifying an Interrupt Controller:
Define clear interrupt priorities.
Keep ISRs as short as possible.
Mask unnecessary interrupts during critical operations.
Avoid interrupt starvation by using programmable or rotating priorities when appropriate.
Verify all interrupt combinations and edge cases.
Measure interrupt latency in timing-critical systems.
Ensure proper handling of nested interrupts and EOI.
Future Trends
Modern interrupt systems continue to evolve with advances in processor design.
Emerging trends include:
AI-assisted interrupt scheduling
Virtualised interrupt controllers
Chiplet-aware interrupt routing
Hardware-assisted real-time prioritisation
Multi-core interrupt balancing
Low-power interrupt management for IoT devices
These innovations help maintain responsiveness while supporting increasingly complex SoCs.
Conclusion
The Interrupt Controller is a critical component of every modern SoC. It efficiently manages interrupt requests from multiple peripherals, prioritises competing events, and ensures that the CPU responds quickly to the most important tasks.
By eliminating the need for constant polling, the Interrupt Controller improves CPU efficiency, reduces power consumption, and enables scalable, real-time system operation. Features such as programmable priorities, interrupt masking, nested interrupt support, and End Of Interrupt handling make it indispensable in embedded systems, processors, and advanced SoCs.
Whether you're learning Computer Architecture, Embedded Systems, VLSI, ASIC Design, or ASIC Verification, understanding the Interrupt Controller provides a strong foundation for exploring operating systems, processor design, and hardware–software interaction.
Frequently Asked Questions (FAQs)
1. What is an Interrupt Controller?
An Interrupt Controller is a hardware module that receives interrupt requests from multiple devices, prioritises them, and forwards the appropriate interrupt to the CPU.
2. Why is an Interrupt Controller needed?
It allows the CPU to respond efficiently to hardware and software events without continuously polling peripherals, improving system performance and reducing power consumption.
3. What is the difference between a maskable and a non-maskable interrupt?
Maskable interrupts can be enabled or disabled by software, whereas non-maskable interrupts (NMIs) cannot be disabled and are reserved for critical system events.
4. What is an Interrupt Service Routine (ISR)?
An ISR is a special software routine executed by the CPU to handle a specific interrupt, after which normal program execution resumes.
5. Which interrupt controllers are commonly used today?
Popular implementations include the ARM Generic Interrupt Controller (GIC), Nested Vectored Interrupt Controller (NVIC), and Advanced Programmable Interrupt Controller (APIC), depending on the processor architecture.
Comments
Post a Comment