Module 5 ARM Basic
Module 5 ARM Basic
ECE3004
Dr. M Suresh
School of Electrical & Electronics Engineering
Module5: ARM Microcontroller
VIT BHOPAL UNIVERSITY
3. ARM7TDMI features
4. Register set
5. Operational Mode
6. ARM Core Data Flow Model
7. Pipelining: ARM 3 stage Pipeline, ARM 5
stage Pipeline
8. Pipeline Hazards
Necessity of RISC Processor
3. ARM7TDMI features
4. Register set
5. Operational Mode
6. ARM Core Data Flow Model
7. Pipelining: ARM 3 stage Pipeline, ARM 5
stage Pipeline
8. Pipeline Hazards
ARM Processor Fundamentals
WIC: Wakeup
Interrupt
Controller
NVIC: Nested
Vector Interrupt
Controller
ETM:
Embedded
Trace Macrocell
DAP: Debug
and Access Port
ARM Processor Fundamentals
1. Multiprocessing Systems: ARM processors are designed to be used in cases of multiprocessing
systems where more than one processor is used to process information. The First AMP processor
introduced by the name of ARMv6K could support 4 CPUs along with its hardware.
VIT BHOPAL UNIVERSITY
2. Tightly Coupled Memory: The memory of ARM processors is tightly coupled. This has a very fast
response time. It has low latency (quick response) that can also be used in cases of cache memory
being unpredictable.
3. Memory Management: ARM processor has a management section. This includes Memory
Management Unit and Memory Protection Unit. These management systems become very important
in managing memory efficiently.
4. Thumb-2 Technology: Thumb-2 Technology was introduced in 2003 and was used to create
variable-length instruction sets. It extends the 16-bit instructions of initial Thumb technology to 32-bit
instructions. It has better performance than previously used Thumb technology.
5. One-Cycle Execution Time: ARM processor is optimized for each instruction on the CPU. Each
instruction is of a fixed length that allows time for fetching future instructions before executing the
present instructions. ARM has CPI (Clock Per Instruction) of one cycle.
6. Pipelining: Processing of instructions is done in parallel using pipelines. Instructions are broken
down and decoded in one pipeline stage. The channel advances one step at a time to increase
throughput (rate of processing).
7. A large number of Registers: A large number of registers are used in ARM processors to prevent
large amounts of memory interactions. Records contain data and addresses. These act as a local
memory store for all operations.
ARM Processor Advantages
3. ARM7TDMI features
4. Register set
5. Operational Mode
6. ARM Core Data Flow Model
7. Pipelining: ARM 3 stage Pipeline, ARM 5
stage Pipeline
8. Pipeline Hazards
VIT BHOPAL UNIVERSITY ARM7TDMI Features
1. Necessity of RISC Processor
2. ARM processor fundamentals
VIT BHOPAL UNIVERSITY
3. ARM7TDMI features
4. Register set
5. Operational Mode
6. ARM Core Data Flow Model
7. Pipelining: ARM 3 stage Pipeline, ARM 5
stage Pipeline
8. Pipeline Hazards
Register Set
Register count:
R0 to R15 : 16
CPSR : 1 [Current Processor Status Register]
SPSR : 5 [Saved Processor Status Register]
LR : 5 [Link Register]
SP : 5 [Stack Pointer]
R8 to R12 in FIQ :5
Register Set
general
VIT BHOPAL UNIVERSITY
purpose and
special purpose
[total 37
registers]
When mode is changed from one mode to other: let us say USER
VIT BHOPAL UNIVERSITY
to FIQ: then
1. CPSR [current] is loaded into SPSR [saved]
2. PC is loaded into LR
SP (Stack Pointer)
• The stack pointer, often known as the SP
register, is located in register r13.
• Each exception mode has its own version
of r13, pointing to a stack specialised to
that mode.
• Temporary values are stored in the stack.
Register Set: LR
register r15.
• The Program Counter is automatically incremented by the size of
the instruction executed. This size is always 4 bytes in ARM state
and 2 bytes in THUMB mode. When a branch instruction is being
executed, the PC holds the destination address.
• It’s used to determine which instruction will be executed next.
• The PC is referred to as an instruction pointer because it stores
the address of the next instruction
When a branch instruction is being executed, the PC holds the
destination address. During execution, PC stores the address of the
current instruction plus 8 (two ARM instructions) in ARM state, and
the current instruction plus 4 (two Thumb instructions) in Thumb(v1)
state. This is different from x86 where PC always points to the next
instruction to be executed.
Register Set: CPSR
3. ARM7TDMI features
4. Register set
5. Operational Mode
6. ARM Core Data Flow Model
7. Pipelining: ARM 3 stage Pipeline, ARM 5
stage Pipeline
8. Pipeline Hazards
VIT BHOPAL UNIVERSITY ARM Operating Modes
VIT BHOPAL UNIVERSITY ARM Operating Modes
https://www.youtube.com/watch?v=Usjax7H0xuA
VIT BHOPAL UNIVERSITY ARM Operating Modes
VIT BHOPAL UNIVERSITY ARM Operating Modes
1. Necessity of RISC Processor
2. ARM processor fundamentals
VIT BHOPAL UNIVERSITY
3. ARM7TDMI features
4. Register set
5. Operational Mode
6. ARM Core Data Flow Model
7. Pipelining: ARM 3 stage Pipeline, ARM 5
stage Pipeline
8. Pipeline Hazards
ARM Core Dataflow Model
1. 32 bit processor implemented
either Von Neumann or Harvard
VIT BHOPAL UNIVERSITY
architecture
https://www.youtube.com/watch?v=lZMLdyIiIZs
1. Necessity of RISC Processor
2. ARM processor fundamentals
VIT BHOPAL UNIVERSITY
3. ARM7TDMI features
4. Register set
5. Operational Mode
6. ARM Core Data Flow Model
7. Pipelining: ARM 3 stage Pipeline, ARM 5
stage Pipeline
8. Pipeline Hazards
https://www.youtube.com/watch?v=HFNJ967S7cg
VIT BHOPAL UNIVERSITY ARM7 uses 3 stage pipeline
VIT BHOPAL UNIVERSITY 3 stage pipeline
VIT BHOPAL UNIVERSITY 5 stage pipeline
VIT BHOPAL UNIVERSITY
1. Necessity of RISC Processor
2. ARM processor fundamentals
VIT BHOPAL UNIVERSITY
3. ARM7TDMI features
4. Register set
5. Operational Mode
6. ARM Core Data Flow Model
7. Pipelining: ARM 3 stage Pipeline, ARM 5
stage Pipeline
8. Pipeline Hazards
https://www.youtube.com/watch?v=HFNJ967S7cg
VIT BHOPAL UNIVERSITY Pipeline Hazards
VIT BHOPAL UNIVERSITY Pipeline Hazards: Data Hazards
For example:
ADD R1, — , — ;
SUB — , R1, — ;
Pipeline Hazards: Data Hazards
2. Write after Write (WAW): Output dependency is
sometimes known as WAW. These hazards arise when
VIT BHOPAL UNIVERSITY
ADD R1, — , — ;
SUB R1, — , — ;
Pipeline Hazards: Data Hazards
3. Write after Read (WAR): Anti-dependency is often
known as WAR. These hazards arise when an
VIT BHOPAL UNIVERSITY
ADD — , R1, — ;
SUB R1, — , — ;
Pipeline Hazards: Data Hazards
4. Read after Read (RAR): Read after Read (RAR): When
two instructions read from the same register, RAR
VIT BHOPAL UNIVERSITY
occurs.
For example:
ADD — , R1, — ;
SUB — , R1, — ;
Handling Data Hazards
Just an example
VIT BHOPAL UNIVERSITY
https://www.youtube.com/watch?v=OTvi_NCQw2Y
VIT BHOPAL UNIVERSITY Pipeline Hazards: Control Hazards
VIT BHOPAL UNIVERSITY Handling Control Hazards
• Stall
• Pipeline hardware resource
• Replicate resources
VIT BHOPAL UNIVERSITY