ARM Interrupt Processing
ARM Interrupt Processing
ARM Interrupt Processing
EMBEDDED SYSTEMS
1
A R M P R O C ESSO R
I N TE R R UP T P R O C ESSI N G
Exception Mode
Reset 1 1 1
Data abort 2 1 -
FIQ 3 1 1
IRQ 4 1 -
Pre-fetch abort 5 1 -
SWI 6 1 -
Undefined 6 1 -
instructions
Reset handler
Initializes the system, setting up stack pointers,
memory, external interrupt sources before enabling
IRQ or FIQ
Code should be designed to avoid further triggering
of exceptions
Data Abort
Occurs when memory controller indicates that an
invalid memory address has been accessed
An FIQ exception can be raised within data abort
handler
Created by Mr. THOMAS KWANTWI 4/28/2018
Exception Handlers (contd.)
7
FIQ
Occurs when an external peripheral generates the FIQ
input signal
Core disables both FIQ and IRQ interrupts
IRQ
Occurs when an external device generates the IRQ input
signal
IRQ handler will be entered if neither an FIQ exception
or Data abort exception occurs
On entry IRQ exception is disabled and should remain
disabled for the handler if not enabled by the handler
Created by Mr. THOMAS KWANTWI 4/28/2018
Exception Handlers (contd.)
8
Pre-fetch 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 the ARM or
Thumb instruction
SWI and undefined instruction have the same level
of priority because they cannot occur together
Din[ 31:0]
bu s JTAG TAP
Dout [31:0]
splitter controller
mreq s eq Cy cl e Us e
0 0 N Non-sequential memory access
0 1 S Sequential memory access
1 0 I Internal cycle – bus and memory inactive
1 1 C Coprocessor register transfer – memory inactive
Created by Mr. THOMAS KWANTWI 4/28/2018
Interface signals (contd.)
21
Lock indicates that the processor should keep the bus to ensure the
atomicity of the read and write phase of a SWAP instruction
\r/w, read or write
mas[1:0], encode memory access size – byte, half-word or word
bl[3:0], externally controlled enables on latches on each of the 4 bytes
on the data input bus
MMU interface
\trans (translation control), 0: user mode, 1: privileged mode
\mode[4:0], bottom 5 bits of the CPSR (inverted)
Abort, disallow access
State
T bit, whether the processor is currently executing ARM or Thumb
instructions
Configuration
Bigend, big-endian or little-endian
Interrupt
\fiq,
fast interrupt request, higher priority
\irq, normal interrupt request
boundaries. 0x08
Memory as words
Created by Mr. THOMAS KWANTWI 4/28/2018
ARM Memory Interface
24
Sequential (S cycle)
(nMREQ, SEQ) = (0, 1)
The ARM core requests a transfer to or from an address which is either the
same, or one word or one-half-word greater than the preceding address.
Non-sequential (N cycle)
(nMREQ, SEQ) = (0, 0)
The ARM core requests a transfer to or from an address which is unrelated
to the address used in the preceding address.
Internal (I cycle)
(nMREQ, SEQ) = (1, 0)
The ARM core does not require a transfer, as it performing an internal
function, and no useful pre-fetching can be performed at the same time
Coprocessor register transfer (C cycle)
(nMREQ, SEQ) = (1, 1)
The ARM core wished to use the data bus to communicate with a
coprocessor, but does not require any action by the memory system.
Harvard Architecture
Increase available memory bandwidth
o Instruction memory interface
o Data memory interface
Simultaneous access to instruction and data memory
5 stage pipeline
Fetch
Decode
Execute
Buffer Data (access data memory or buffer)
Write back
Changes implemented to
Increase CPI~1,5
Improve maximum clock frequency
ARM Core
Physical
Address
AMBA
MMU
Address
Virtual AMBA
Address Interface
AMBA
Inst. & data
Data
Write
Inst. & data cache
Buffer
Interrupt
Controller Peripherals
r
8-bit ROM
ARM Core