Exception and Interrupt Handler: B.Tech ECE V Semester SENSE VIT University
Exception and Interrupt Handler: B.Tech ECE V Semester SENSE VIT University
Exception and Interrupt Handler: B.Tech ECE V Semester SENSE VIT University
Shorthand
RESET UNDEF SWI
Address
0x00000000 0x00000004 0x00000008
High Address
0xffff0000 0xffff0004 0xffff0008
Prefetch Abort
Data Abort Reserved Interrupt Request Fast Interrupt Request
PABT
DABT IRQ FIQ
0x0000000C
0x000000010 0x000000014 0x000000018 0x00000001C
0xffff000C
0xffff0010 0xffff0014 0xffff0018 0xffff001C
Exception Handling
ARM processor modes and Exceptions Vector table Exception Priorities Link Register Offsets
Vector table
B<address> LDR pc, [pc, #offset] MOV pc, #immediate
priorities
Interrupts
Two types of interrupts
External SWI
Interrupt Latency
IRQ
FIQ
Stack Organization
Stack area is different for each and every mode Descending Stack is common Nested interrupt handler requires larger stack While choosing stack location Should not overrun the vector table
B.Tech ECE V semester SENSE VIT University
Interrupt Stack
Context switching Each mode has a dedicated register containing a stack pointer
Exception handlers
Reset Handler
Initializes the system, setting Stack pointers, memory, External interrupt sources before enabling the FIQ and IRQ. Code should be designed to avoid further triggering of exceptions
Data Abort
FIQ can be raised within DATA abort handler
FIQ
External peripheral generates FIQ signal Core disables both FIQ and IRQ
IRQ
Occurs when an External device generates IRQ signal IRQ handler will be entered if neither an FIQ and Data abort occurs. On entry IRQ exception is disabled and should remain disabled for the handler if not enabled by the handler
Prefetch abort
Occurs when an attempt to fetch an instruction results in memory fault. FIQ exception can be serviced
Undefined instruction
Occurs when an instruction is not in ARM or thumb instruction
FIQ and IRQ can be serviced after the Execution stage Others can be serviced during execution stage.
Interrupt Assignment
An interrupt controller connects multiple external interrupts to either FIQ or IRQ IRQ are normally assigned to general purpose interrupts
Ex: periodic timer interrupt to force a context switch
FIQ is reserved for an interrupt source which requires fast response time [less latency]
B.Tech ECE V semester SENSE VIT University
Interrupt Latency
Hardware and software latency
Eg for HW is FIQ Eg for SW is Nested handler, priority assignment, Average latency of Higher priority interrupt is less.
3 stage pipeline
At any time slice, 3 different instruction may occupy each of these stages, so the hardware in each stage has to be capable of independent operations When the processor is executing data processing instructions, Latency =3 cycles When accessing R15, r15 = address of current instruction +8
B.Tech ECE V semester SENSE VIT University
Decode
Execute
ADD
SUB ADD
CMP
SUB
ADD
Filling the pipeline Allows the core to execute an instruction every cycle
B.Tech ECE V semester SENSE VIT University
SWI Handler