Documente Academic
Documente Profesional
Documente Cultură
Exception
Mode
FIQ
Interrupt Request
IRQ
SVC
abort
Undefined Instruction
undefined
TM
Vector Table
TM
TM
Entering an Exception
1. Preserves the address of the next instruction in the appropriate LR. When
the exception entry is from:
ARM state, the ARM7TDMI-S copies the address of the next
instruction into the LR (current PC + 4, or PC + 8 depending on the
exception)
Thumb state, the ARM7TDMI-S writes the value of the PC into the
LR, offset by a value (current PC + 4, or PC + 8 depending on the
exception).
The exception handler does not have to determine the state when
entering an exception. For example, in the case of a SWI, MOVS PC,
r14_svc always returns to the next instruction regardless of whether the
SWI was executed in ARM or Thumb state.
2. Copies the CPSR into the appropriate SPSR.
3. Forces the CPSR mode bits to a value which depends on the exception.
4. Forces the PC to fetch the next instruction from the relevant exception
vector. The ARM7TDMI-S core also sets the interrupt disable flags on
interrupt exceptions to prevent otherwise unmanageable nesting of
exceptions.
39v10 The ARM Architecture
TM
Exception Priorities
Exception
Priority
I Bit
F bit
Reset
Data abort
FIQ
IRQ
Pre-fetch
abort
SWI
Undefined
Instructions
TM
Reset
TM
Exception Handlers
Reset
Handler
Data
Abort
TM
FIQ
IRQ
TM
Abort
Undefined
instruction
TM
TM
10
10
Interrupt Assignment
IRQ
Examples:
FIQ
TM
11
11
Interrupt Latency
Hardware
Software
TM
12
12
Stack Organization
For
up
To
Design
decisions
Size
Nested interrupts handler requires larger stack
39v10 The ARM Architecture
TM
13
13
Interrupt
support:
Fast interrupt
Normal interrupt
DMA Support
TM
14
14
TM
15
15
Interrupt request
IRQ has a lower priority than FIQ, and is masked on entry to an FIQ
sequence.
You can disable IRQ at any time, by setting the I bit in the CPSR from
a privileged mode.
TM
16
16
Abort
TM
17
17
Prefetch Abort
When a Prefetch Abort occurs, the ARM7TDMI-S core marks the prefetched
instruction as invalid
but does not take the exception until the instruction reaches the execute stage of
the pipeline.
After dealing with the reason for the abort, the handler executes the following
instruction irrespective of the processor operating state:
SUBS PC,R14_abt,#4
This action restores both the PC and the CPSR and retries the aborted
instruction.
TM
18
18
Data Abort
When a Data Abort occurs, the action taken depends on the instruction type:
Single data transfer instructions (LDR, STR) write back modified base registers.
The abort handler must be aware of this.
The swap instruction (SWP) aborts as though it had not been executed. (The abort
must occur on the read access of the SWP instruction.)
Block data transfer instructions (LDM, STM) complete. When write-back is set,
the base is updated. If the instruction would have overwritten the base with data
After fixing the reason for the abort, the handler must execute the following return
instruction irrespective of the processor operating state at the point of entry:
SUBS PC,R14_abt,#8
This action restores both the PC, and the CPSR, and retries the aborted instruction.
TM
19
19
The SWI handler reads the opcode to extract the SWI function
number.
TM
20
20
Undefined instruction
This action restores the CPSR and returns to the next instruction
after the undefined instruction.
21
39v10 The ARM Architecture
TM
21
Memory Cycles
Nonsequential cycle
During this cycle, the ARM7TDMI-S core requests a transfer to, or from an
address which is unrelated to the address used in the preceding cycle.
Sequential cycle
During this cycle, the ARM7TDMI-S core requests a transfer to or from an
address that is either one word or one halfword greater than the address used in
the preceding cycle.
Internal cycle
During this cycle, the ARM7TDMI-S core does not require a transfer because it
is performing an internal function and no useful prefetching can be performed at
the same time.
TM
22
22
Coprocessor Interface
The ARM7TDMI-S processor instruction set enables you to implement specialized additional
instructions using coprocessors.
These are separate processing units that are tightly coupled to the ARM7TDMI-S core.
A coprocessor is connected to the same data bus as the ARM7TDMI-S processor in the system, and
tracks the pipeline in the ARM7TDMI-S core.
This means that the coprocessor can decode the instructions in the instruction stream, and execute
those that it supports.
Each instruction progresses down both the ARM7TDMI-S processor pipeline and the coprocessor
pipeline at the same time.
TM
23
23
Coprocessor Interface
The coprocessor:
1. Decodes instructions to determine whether it can accept the instruction.
2. Indicates whether it can accept the instruction (by signaling on CPA and
CPB).
3. Fetches any values required from its own register bank.
4. Performs the operation required by the instruction.
TM
24
24
TM
25
25
TM
26
26