Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Course Leader:
CHAITRA S
chaitra.cs.et@msruas.ac.in
1
M. S. Ramaiah University of Applied Sciences
Objectives
At the end of this lecture, students will be able to
Distinguish between embedded processors and
application processors manufactured by ARM
Describe the major features of the ARM architecture
such as instruction sets, memory, interrupt control and
exception handling
Explain the cache hierarchy of ARM processors and list
its features
2
M. S. Ramaiah University of Applied Sciences
Contents
Embedded and Application Processors
Development of the ARM Architecture
Registers and Processor Modes
Interrupt Controller
3
M. S. Ramaiah University of Applied Sciences
Embedded Processors
4
M. S. Ramaiah University of Applied Sciences
Application Processors
5
M. S. Ramaiah University of Applied Sciences
6
M. S. Ramaiah University of Applied Sciences
8
M. S. Ramaiah University of Applied Sciences
Processor Modes
The ARM has seven basic operating modes:
Each mode has access to own stack and a
different subset of registers
Some operations can only be carried out in a
privileged mode
9
M. S. Ramaiah University of Applied Sciences
IRQ
FIQ
Undef
Abort
SVC
r13 (sp)
r14 (lr)
r8
r9
r10
r11
r12
r13 (sp)
r14 (lr)
spsr
spsr
r13 (sp)
r14 (lr)
r13 (sp)
r14 (lr)
r13 (sp)
r14 (lr)
spsr
spsr
spsr
cpsr
Current mode
10
M. S. Ramaiah University of Applied Sciences
T bit
T = 0: Processor in ARM state
T = 1: Processor in Thumb state
J bit
J = 1: Processor in Jazelle state
Mode bits
Specify the processor mode
I = 1: Disables IRQ
F = 1: Disables FIQ
E bit
E = 0: Data load/store is little endian
E = 1: Data load/store is bigendian
A bit
A = 1: Disable imprecise data aborts
11
M. S. Ramaiah University of Applied Sciences
12
M. S. Ramaiah University of Applied Sciences
comparison
(set flags only)
ADC
ADD
SUB
CMN
(ADDS)
SBC
RSB
RSC
logical
AND
EOR
CMP
TST
TEQ
(SUBS)
(ANDS)
(EORS)
move
MOV
Syntax:
Examples:
ADD r0, r1, r2
; r0 = r1 + r2
TEQ r0, r1
; if r0 = r1, Z flag will be set
13
Syntax:
LDR{<size>}{<cond>} Rd, <address>
STR{<size>}{<cond>} Rd, <address>
Example:
LDRB r0, [r1]
address in r1
; byte of memory at
14
M. S. Ramaiah University of Applied Sciences
4 addressing modes
Increment after/before
Decrement after/before
Also
PUSH/POP, equivalent to STMDB/LDMIA with SP! as base register
Example
LDM r10, {r0,r1,r4} ; load registers, using r10 base
PUSH {r4-r6,pc}; store registers, using SP base
15
M. S. Ramaiah University of Applied Sciences
Subroutines
Implementing a conventional subroutine call requires two steps
Store the return address
Branch to the address of the required subroutine
16
M. S. Ramaiah University of Applied Sciences
Data Alignment
Prior to architecture v6 data accesses must
be appropriately aligned for access size
Unaligned addresses will produce
unexpected/undefined results
17
M. S. Ramaiah University of Applied Sciences
Exception Handling
1. Save processor status
Copies CPSR into SPSR_<mode>
Stores the return address in
LR_<mode>
Adjusts LR based on exception
type
1 and 2 performed
automatically by the core
3 and 4 responsibility of
software
18
M. S. Ramaiah University of Applied Sciences
Exception Handling
19
M. S. Ramaiah University of Applied Sciences
Memory Types
Each defined memory region will specify a memory type
The memory type controls the following:
Memory access ordering rules
Caching and buffering behaviour
20
M. S. Ramaiah University of Applied Sciences
L1 and L2 Caches
Typical memory system can have multiple levels of cache
Level 1 memory system typically consists of L1-caches, MMU/MPU and
TCMs
Level 2 memory system depends on the system design
21
M. S. Ramaiah University of Applied Sciences
L1 and L2 Caches
22
M. S. Ramaiah University of Applied Sciences
Cache Lockdown
Prevents line Eviction from a specified Cache Way
(discussed later)
Pseudo-random
strategies
and
Round-robin
replacement
23
M. S. Ramaiah University of Applied Sciences
Streaming, Critical-Word-First
Cache data is forwarded to the core as soon as the
requested word is received in the Linefill buffer
Any word in the cache line can be requested first
using a WRAP burst on the bus
24
M. S. Ramaiah University of Applied Sciences
25
M. S. Ramaiah University of Applied Sciences
26
M. S. Ramaiah University of Applied Sciences
Interrupt Controller
MPCore processors include an
integrated Interrupt Controller (IC)
Implementation of the Generic
Interrupt Controller (GIC) architecture
The IC provides:
Configurable number of external
interrupts (max 224)
Interrupt prioritization and preemption
Interrupt routing to different cores
27
M. S. Ramaiah University of Applied Sciences
28
M. S. Ramaiah University of Applied Sciences
Summary
Processor Architecture = Instruction Set + Programmers model
Most ARMs implement two instruction sets
The ARM has seven basic operating modes
The ARM instruction set architecture allows programmers and
compilation tools to reduce branching through the use of conditional
execution
Prior to architecture v6 data accesses must be appropriately aligned for
access size
MPCore processors include an integrated Interrupt Controller (IC)
https://www.youtube.com/watch?v=GLSPub4ydiM
29
M. S. Ramaiah University of Applied Sciences