0% found this document useful (0 votes)
14 views51 pages

Lesson-3:: Advanced Processor Architectures and Memory Organisation

The document discusses the ARM architecture, highlighting its 32-bit core that supports 16 and 8-bit data types, and its combination of RISC and CISC features for efficient processing. It details various ARM microprocessor versions, their instruction sets, and memory architectures, emphasizing the advantages of ARM's Thumb mode for reduced memory usage while maintaining performance. Additionally, it covers advanced technologies like Jazelle for Java execution and Intelligent Energy Manager for optimizing performance and energy consumption.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views51 pages

Lesson-3:: Advanced Processor Architectures and Memory Organisation

The document discusses the ARM architecture, highlighting its 32-bit core that supports 16 and 8-bit data types, and its combination of RISC and CISC features for efficient processing. It details various ARM microprocessor versions, their instruction sets, and memory architectures, emphasizing the advantages of ARM's Thumb mode for reduced memory usage while maintaining performance. Additionally, it covers advanced technologies like Jazelle for Java execution and Intelligent Energy Manager for optimizing performance and energy consumption.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

ADVANCED PROCESSOR ARCHITECTURES

AND MEMORY ORGANISATION –


Lesson-3: ARM

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 1
Raj Kamal, Publs.: McGraw-Hill Education
1. ARM ARCHITECTURE

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 2
Raj Kamal, Publs.: McGraw-Hill Education
The ARM architecture processors
popular in Devices and Mobile systems

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 3
Raj Kamal, Publs.: McGraw-Hill Education
ARM Features
 32-bit architecture but supports 16 bit
or 8 bit data types also.
 Programmable as little endian or big
endian data alignment in memory.

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 4
Raj Kamal, Publs.: McGraw-Hill Education
ARM Features
 Advantage of using a CISC in terms of
functionality, along with the advantage
of an RISC in terms of faster program
implementation as well as reduced code
lengths.

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 5
Raj Kamal, Publs.: McGraw-Hill Education
ARM7, ARM9 and ARM 11 microprocessors
 ARM processor has an RISC core for
processing
 Combination of RISC and CISC
features─ ARM supports to a complex
addressing modes based instruction set

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 6
Raj Kamal, Publs.: McGraw-Hill Education
In-built compilation unit

 Compiles the CISC instructions into


RISC formats, which are then
implemented by the RISC core of the
processor.
 Internally the implementation for many
instructions is like in an RISC (without
the micro-programmed unit)

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 7
Raj Kamal, Publs.: McGraw-Hill Education
Jazelle technology

 Faster Java codes execution

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 8
Raj Kamal, Publs.: McGraw-Hill Education
ARM Thumb 16-bit instructions
 Thumb Set designed for 16-bit word
lengths and instructions, which
internally executes by same 32-bit
core.
 Instruction fetch of 2 bytes in Thumb
mode in place of 4 bytes in ARM
mod.

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 9
Raj Kamal, Publs.: McGraw-Hill Education
ARM Thumb 16-bit instructions
 Data alignment at steps of 2 bytes in
Thumb mode in place of 4 bytes ARM
mode
 Memory savings up to 35%, over the
equivalent 32-bit code, while retaining
all the benefits of a 32-bit system (such
as access to a full 32-bit address
space).
 Enables 32-bit performance at the
8/16-bit system cost in terms of
memory needs.
Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",
2015 10
Raj Kamal, Publs.: McGraw-Hill Education
Thumb and 32-bit ARM modes
 Switch from one mode to another
 No overheads (in terms of time and
memory) in moving between Thumb
and the normal ARM state of the
codes. Two states are compatible on a
normal basis.
 Gives code designer complete control
over performance and code-size
optimisation
Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",
2015 11
Raj Kamal, Publs.: McGraw-Hill Education
ARM7 versions
 ARM7TDMI® (Integer Core)
 ARM7TDMI-S™, (Synthesisable
version of ARM7TDMI)
 ARM7EJ-S™ (Synthesisable core with
DSP and Jazelle technology)

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 12
Raj Kamal, Publs.: McGraw-Hill Education
ARM7 versions
 ARM720T™ (cached processor
macrocell , 8K Cached Core with
Memory Management Unit (MMU)
supporting operating systems1
including Windows CE, Palm OS,
Symbian OS and Linux)
 130 MIPS using Dhrystone 2.1
benchmark in typical 0.13µm process

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 13
Raj Kamal, Publs.: McGraw-Hill Education
ARM9 versions
 ARM920T (Dual 16k caches with MMU support
multiple OSs.
 ARM922T (Dual 8k caches for applications
support multiple OSs1.
 ARM940T™ (Dual 4k caches for embedded
control applications running a RTOS)
 32-bit RISC processor core Super scaling 5-stage
integer pipeline. 8-entry write buffers to avoid
blocking the processor on external memory writes
 Achieves 1.1 MIPS/MHz, 300 MIPS (Dhrystone
2.1) in a typical 0.13µm process

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 14
Raj Kamal, Publs.: McGraw-Hill Education
ARM11 versions
 Families with ARMv6 instruction set architecture
that includes the Thumb® extensions for code
density, Jazelle™ technology for Java™
acceleration, ARM DSP extensions, and SIMD
media processing extensions. MMU) supporting
operating systems1 and palm OS
 32-bit RISC processor core with 8-stage integer
pipeline, static and dynamic branch prediction,
and separate load-store and arithmetic pipelines to
maximize instruction throughput
 Targets a performance range of Dhrystone MIPS
400 to 1200
Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",
2015 15
Raj Kamal, Publs.: McGraw-Hill Education
Memory Architecture
• ARM7 has Princeton memory
architecture.
• ARM9 processor has Harvard
architecture

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 16
Raj Kamal, Publs.: McGraw-Hill Education
Faster implementation and Reduced code
lengths
 Due to the instant availability of the
register word to the execution-unit.
 Reduced code lengths─ Most
instructions use registers as operands.
 Few bits in the instruction specify a
register as operand. 8, 16 or 32 bits
specify a memory address as operand
and the displacement bits in the
2015
instruction.
Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",
17
Raj Kamal, Publs.: McGraw-Hill Education
ARM registers
 R0 to R15.
 R15 also function as program
counter.
 R14 function as link register.
 R13 may be used as stack pointer
 CPSR (current program status
register)
 SPSR (saved program status register).
Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",
2015 18
Raj Kamal, Publs.: McGraw-Hill Education
32-bit bus
ARM Architecture

Barrel
IR
Shifter
r0 ID ALU,
to
r15
Execution
CPSR unit
SPSR
Hardwired
32-bit r15 circuits for
functions each
as PC instruction
Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",
2015 19
Raj Kamal, Publs.: McGraw-Hill Education
ARM Codes
 ARM Codes─ Forward compatible with higher
versions.
 ARM7 codes ─ Forward compatible with
ARM9, ARM9E and ARM10 processors as well
as Intel XScale micro-architecture.
 ARM9E and ARM 10 families use a Vector
Floating Point (VFP) ARM coprocessor, which
adds full floating point operands.
 VFP also provides fast development in SoC
design when using tools like MatLab®.
 Applications are in image processing (scaling),
2D and 3D transformations, font generation and
digital filters.

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 20
Raj Kamal, Publs.: McGraw-Hill Education
ARM Intelligent Energy Manager (IEM)
technology
 Advanced algorithms to optimally
balance processor workload and energy
consumption.
 Maximizes system responsiveness.
 IEM works with the operating system
and mobile OS.
 Application running on a mobile phone
dynamically adjusts the required CPU
2015 performance level.
Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",
Raj Kamal, Publs.: McGraw-Hill Education
21
ARM processors AHB (AMBA Advanced
High Performance Bus) interface

 AMBA an established open source


specification for on-chip interconnects.
 AMBA serves as a framework for SoC
designs and development of the IP
library.
 AHB support in all new ARM cores.

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 22
Raj Kamal, Publs.: McGraw-Hill Education
AHB
 Provides a high-performance and fully
synchronous back plane. (Back plane means
additional set of controllers, which can access
another common bus, which is distinct from
system bus in a multilevel buses in the system.)
 Multi-layer AHB in version ARM926EJ-S and all
members of the ARM10 family represents a
significant advancement. It reduces access
latencies and increases the bandwidth available to
multi-master systems

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 23
Raj Kamal, Publs.: McGraw-Hill Education
3- stage pipeline in ARM7
Successive Clock Intervals
Stages
Fetch I1 I2 I3 I4 I5 I6

Decode
Read I1 I2 I3 I4 I5
Operands

Execute
Write I1 I2 I3 I4
back

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 24
Raj Kamal, Publs.: McGraw-Hill Education
Pipeline and Latch

Decode Execute In,


Fetched an In and and mem-ory
Latch Latch inputs I and
instruction In read n
operands address and
Write Result
In

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 25
Raj Kamal, Publs.: McGraw-Hill Education
5- stage pipeline in ARM 9
Successive Clock Intervals
Stages
Fetch I1 I2 I3 I4 I5 I6

Decode I1 I2 I3 I4 I5
Read I1 I2 I3 I4
Operands
Execute I1 I2 I3

Write I1 I2
back
Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",
2015 26
Raj Kamal, Publs.: McGraw-Hill Education
Super scaling in ARM

Stages Pipeline1 Pipeline 2

Fetch I3 I’3
Decode
Read I2 I’2
Operands

Execute
Write I1 I’1
back
Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",
2015 27
Raj Kamal, Publs.: McGraw-Hill Education
2. ARM Instruction Set

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 28
Raj Kamal, Publs.: McGraw-Hill Education
Features

• Two Instruction Sets─ 16-bit Thumb


and 32-bit ARM mode instructions
• Operations on 8-bit or 16-bit or 32-bit
data types
• Data alignment in memory: Two byte
words in Thumb set and Four in 32-bit
ARM mode

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 29
Raj Kamal, Publs.: McGraw-Hill Education
ARM7 instruction set: Data Transfer
Instructions
 Register-load a byte (LDRB).
 Register- byte store (STRB).
 Register Half Word store (STRH). [A
word in ARM is of 32 bits].
 Register-load Half Word as such or
signed (LDRH or LDRSH).

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 30
Raj Kamal, Publs.: McGraw-Hill Education
ARM7 instruction set: Data Transfer
Instructions
 Instructions for transfer between the
register-memories. The memory
address is as per a register used as
index or index-relative or post auto-
index addressing mode.
 Register-load a word (LDR)

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 31
Raj Kamal, Publs.: McGraw-Hill Education
ARM7 instruction set: Data Transfer
Instructions
 Register-word stores a word (STR).
 Set a memory address into a register
(ADR). Address is of 12 bits.
[Alternative for 16 bits address setting
in a register is using any register or r15
in an arithmetic operation].

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 32
Raj Kamal, Publs.: McGraw-Hill Education
Word transfer between registers:

 Move (MOV).
 Move after Negating (MVR).

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 33
Raj Kamal, Publs.: McGraw-Hill Education
Load or move or store instruction
conditionally implementation

 Conditions─ signed number LT, GT ,


LE, EQ, NE (not equal), VS (overflow),
VC (no overflow), GE
 Conditions─ unsigned number HI
(higher), LS (lower), PL (plus, nor
Negative), MI (minus), CC (carry bit
reset), and CS (carry bit set).
 Example: MOVLT r3, #10.
Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",
2015 34
Raj Kamal, Publs.: McGraw-Hill Education
Load or move or store instruction
conditionally implementation

 Immediate operand 10 to r3 provided a


previous instruction for comparison
showed the first source as less than the
second.

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 35
Raj Kamal, Publs.: McGraw-Hill Education
Bit Transfer or Manipulation Instructions

 Register- bits Logical Left Shift


(LSL).
 Register- bits Logical Left arithmetic
Shift (ASL).
 Register- bits Logical Right Shift
(LSR).
 Register- bits Logical Right
arithmetic Shift (ASR).

2015
Register- bits Rotate Right (ROR).
Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",
36
Raj Kamal, Publs.: McGraw-Hill Education
Arithmetical Instructions
• Three operands from the registers.
• One source may however, be by immediate operand
addressing in addition and subtraction .
 Add without carry two words and the result is in the
third operand (ADD).
 Add with carry two words and the result is in the
third operand (ADC).
 Subtract without carry two words and the result is in
the third operand (SUB). [Carry bit used as borrow.]
 Subtract with carry two words and the result is in
the third operand (SBC).

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 37
Raj Kamal, Publs.: McGraw-Hill Education
Arithmetical Instructions

 Subtract reverse (second source with the first)


without carry two words and the result is in the third
operand (RSB). [Carry bit used as borrow.]
 Subtract reverse with carry two words and the result
is in the third operand (RSC).
 Multiply two different registers and the result is in
the destined register (MUL).
 Multiply two source registers and add the result with
the third source register and accumulate the new
result in a destined register. (MLA).

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 38
Raj Kamal, Publs.: McGraw-Hill Education
Logic Instructions
 Bit wise OR two words and the result
is in the third operand. (ORR).
 Bit wise AND two words and the
result is in the third operand. (AND).
 Bit wise Exclusive OR two words
and the result is in the third operand.
(EOR).

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 39
Raj Kamal, Publs.: McGraw-Hill Education
Logic Instructions
 Clear a Bit (BIC). [There is one
source for the bits; a second source
for the mask and the result is at the
third operand.]

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 40
Raj Kamal, Publs.: McGraw-Hill Education
Arithmetical or logical instruction conditional
implementation
 Example, SUBGE r1, r3, r5. The
operand from r3 is subtracted from r5
if the GE condition resulted earlier (N
and V status bits equal on comparison
of two signed numbers).
 Conditions can be the results of a
comparison or test

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 41
Raj Kamal, Publs.: McGraw-Hill Education
Compare and Test Instructions

 The result destines to CPSR, which


stores the four condition bits, N, V, C,
and Z.
 Bit wise Test two words (TST).
 Bit wise Negated Test between two
words (TEQ).

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 42
Raj Kamal, Publs.: McGraw-Hill Education
Compare and Test Instructions

 Compare two words and the result is at


the CPSR condition bits (CMP).
 Compare two negative words and the
result is at the CPSR condition bits
(CMN).

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 43
Raj Kamal, Publs.: McGraw-Hill Education
Program-Flow Control Instructions
 Branching (B) or Branch conditional
operations.
 Branch to an address relative to PC
word in r15 (B) 'B #1A8' means add
in PC 1A8 and change the program
flow.

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 44
Raj Kamal, Publs.: McGraw-Hill Education
Program-Flow Control Instructions
 'BGE #100' means that if a GE
condition resulted on a compare 0
test, add in PC 1A8.
 Similar instructions for different
conditions of the processor status
flags

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 45
Raj Kamal, Publs.: McGraw-Hill Education
Software Interrupt instruction
 SWI has 8-bit opcode and remaining bits
are not used by processor
 Give single vector address of the ISR for
SWI.
 Remaining bits in SWI backtracked by
programmer to compute ISR and ISR
parameter pointers

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 46
Raj Kamal, Publs.: McGraw-Hill Education
Software Interrupt instruction
 Remaining bits in SWI backtracked by
programmer to compute ISR and ISR
parameter pointers
 This feature permits handling large
number of SWIs required in the OS and
application functions or threads or tasks

Chapter-4 L04: "Embedded Systems - Architecture, Programming and Design",


2015 47
Raj Kamal, Publs.: McGraw-Hill Education
Summary
We learnt
• ARM Architecture
• 32- address bus and 64-bit data bus
• Programmability as Little endian or
Big endian
• Princeton Memory in ARM7 and
Harvard in ARM9

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 48
Raj Kamal, Publs.: McGraw-Hill Education
Summary

We learnt
• 16 Registers with R15 as Program
counter
• 16-bit Thumb set for 16-bit
instructions to reduce external memory
requirement

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 49
Raj Kamal, Publs.: McGraw-Hill Education
Summary

We learnt
• 3 stage pipeline in ARM7 and 5 in
ARM9

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 50
Raj Kamal, Publs.: McGraw-Hill Education
End of Lesson 3 of Chapter 4
on
ARM Architecture and Instructions

Chapter-4 L03: "Embedded Systems - Architecture, Programming and Design",


2015 51
Raj Kamal, Publs.: McGraw-Hill Education

You might also like