BCS402-MODULE1-PPT
BCS402-MODULE1-PPT
• ARM was established as a joint venture between Acorn, Apple and VLSI in
November 1990.
• You probably own one yourself and may not even realize it!
• ARM cores are widely used in mobile phones, handheld devices, and a many other
everyday portable consumer devices.
• The first ARM prototype name ARM1 was designed in 1985 and continues to
improve through constant technical innovation leading to ARM2, ARM3, ARM4,
ARM5, ARM6, ARM7, ARM8, ARM9… ARM Cortex.
• Approximately one billion ARM processors had been shipped worldwide by the end
of 2001.
• Now, ARM sales is 7 times more than the worlds population.
• The ARM core is not a single core, but a whole family of designs sharing similar
design principles and a common instruction set.
• Example, ARM7TDMI is one of the most successful ARM core widely used in
majority of the devices.
• It provides up to 120 Dhrystone MIPS, high code density and low power
consumption, making it ideal for mobile embedded devices.
• ARM grant license of core to different silicon vendors like ATMEL, NXP,
Cirrus logic etc.. These companies make IC’S.
• Examples are: LPC2148 from NXP,AT91RM9200 from ATMEL.
• ARM processors can be used in any domain
• Mainly ARM processors are used in Handheld devices, Robotics,
Automation, Consumer Electronics.
• ARM processors are available for almost every domain.
ARM Based Products
Instructions:
• RISC is a design philosophy aims to provide few simple but powerful
instructions that execute within a single clock cycle.
• Traditional complex instruction set computer (CISC) relies more on the hardware
(processor) for instruction functionality, as CISC instructions are more
complicated.
Pipelining
• Registers act as the fast local memory store for all data processing
operations.
• Separate load and store instructions transfer data between the register bank
and external memory.
• In contrast, with a CISC design the data processing operations can act on
memory directly.
• These RICS design rules allow a RISC processor to be simpler, and thus the
core can operate at higher clock frequencies.
• In contrast, traditional CISC processors are more complex and operate at lower
clock frequencies.
• Over the course of two decades, however, the distinction between RISC and
CISC has blurred as CISC processors have implemented more RISC concepts.
RISC : Reduced Instruction Set
Computing
• Lesser number of fixed length instructions.
• Fewer addressing modes.
• Increased pipelining and increased execution speed.
• Orthogonal instruction set(Allows each instruction to operate on
any register and use any addressing mode).
• Operations are performed on registers only. Memory operations are
load and store. (Load StoreArchitecture).
• Delayed Branches
• Has control over both the ALU and the barrel shifter in every data pre-processing
instructions.
• The ARM instruction set differs from pure RISC definition in several ways that
make the ARM instruction set suitable for embedded applications.
• Thumb state (16 bit- instruction set) – improves the code density by 30% to 35%
over 32-bit fixed length instructions
Embedded System Hardware
Lines represent –
Busses connecting the
devices
Peripherals
Bus
• Supports communicate between different parts of the device. AHB, APB
ARM Bus Technology
• Embedded devices use an on-chip bus that is internal to the chip and that allows
different peripheral devices to be interconnected with an ARM core.
• There are two different classes of devices attached to the ARM on chip bus.
• - A bus master: a logical device capable of initiating a data transfer
• with another device across the same bus. The ARM processor core is the bus
master.
• - Bus slaves: logical devices capable only of responding to a transfer
request from a bus master device. All peripherals are bus slaves
• On chip ARM bus has two architecture levels.
• Physical level covers the electrical characteristics and bus width (16, 32, or 64 bits).
• Protocol level covers the logical rules that govern the
communication between the processor and a peripheral.
• ARM is primarily a design company. It does not/rarely implements the
electrical characteristics of the bus, but it specifies the bus protocol.
AMBA Bus Protocol
• The original AHB, was allowing a single bus master to be active on the bus at any
time, the Multi-layerAHB bus allows multiple active bus masters.
• AHB-Lite is a subset of the AHB bus and it is limited to a single bus master.
• AHB-Lite was developed for designs that do not require the full features
• of the standardAHB bus.
Memory
• An embedded system requires some form of memory to store and execute
code.
• The memory should be fast, large and inexpensive.
• Unfortunately it is impossible to meet all the 3 requirements.
• The common solution is to have the memory hierarchy.
Memory Width
• The memory width is the number of bits the memory returns on each access
which is typically 8, 16, 32, or 64 bits.
• The memory width has a direct effect on the overall performance of the system.
• If you have a system using 32-bit ARM instructions and 16-bit-wide memory chips,
then the processor will have to make two memory fetches per instruction.
• This reduces the system performance, but the benefit is that 16-bit
memory is less expensive.
• The initialization code is the first code executed on the board when the device
is powered on.
• It sets up the minimum parts of the board before handing control over to the
operating system.
• Boot code is present inside the ROM and is responsible for loading the OS to the
RAM.
• The initialization code handles 3 administrative tasks prior to handing control
over to an operating system image.
• These administrative tasks can be grouped into three phases:
• initial hardware configuration,
• diagnostics, and
• booting.
Initial Hardware Configuration:
• Although the device comes up in a standard configuration, this initial hardware
configuration normally requires modification to satisfy the requirements of the
booted image.
• For example, the memory system normally requires reorganization of the memory
map, as shown in below Example
Diagnostics
• Diagnostics is a program embedded in the initialization code.
• Once booted, the system hands over control by modifying the program
counter to point into the start of the OS image.
• The Initialization process prepares the hardware for an Operating system to take
control.
• ARM Processor supports over 50 operating systems.
• Operating system can be divided into two main categories.
• Real Time Operating System – RTOS
• Platform Operating System –POS
• RTOS used in embedded devices and they don’t use the secondary storage and POS
used in the general purpose computer systems and they use secondary storage
• RTOS is classified into.
• Hard Real Time Operating System – Used in hard real time applications
which requires the guaranteed response time.
• Soft Real Time Operating System – Used in soft real time applications
which does not require guaranteedresponse time and
the performance
• gracefully reduces when the time overruns
Applications
• ARM processors are found in numerous domains, including networking,
automotive, mobile and consumer devices, mass storage, and imaging devices.
• For example, the ARM processor is found in networking applications like home
gateways, modems for high-speed Internet communication, and
• 802.11 wireless communication.
• The mobile device domain is the largest application area for ARM
processors because of mobile phones.
• ARM processors are also found in mass storage devices domains such as hard
drives, products such as inkjet printers
ARM7TDMI Processor
• The ARM family offers high performance for very low power consumption, and
small size.
• The processor mode determines which registers are active and the access rights to the
cpsr register itself.
• Each processor mode is either
• privileged or
• non privileged
• A privileged mode allows full read-write access to the cpsr.
• Conversely, a non-privileged mode only allows read access to the control
field in the cpsr but still allows read-write access to the condition flags.
• There are seven processor modes in total:
- six privileged modes
(abort, fast interrupt request, interrupt request,
supervisor, system, and undefined)
- one non privileged mode (User).
• Abort Mode: The processor enters abort mode when there is a failed attempt to
access memory.
• Fast interrupt and interrupt request modes: Correspond to the two interrupt levels
available on the ARM processor.
• Supervisor mode: is the mode that an operating system kernel operates in.
• System mode: is a special version of user mode that allows full read-write access to
the cpsr.
• Undefined mode: is used when the processor encounters an instruction that is
undefined or not supported by the implementation.
• User mode: is used for programs and applications.
Banked Registers
• There are 37 registers in the register
file. Of those, 20 registers are hidden
registers and are called as banked
registers indicated in shade.
• They are available only when the
processor is in a particular mode.
• Changing mode on an interrupt
State and Instruction Sets
• Jazelle executes 8-bit instructions and is a hybrid mix of software and hardware
designed to speed up the execution of Java byte-codes.
• Interrupt masks are used to stop interrupt requests from interrupting the
processor.
• There are two interrupt request levels available on the ARM processor core
- interrupt request (IRQ) and
- fast interrupt request (FIQ).
• The cpsr has two interrupt mask bits, 7 and 6 (or I and F), which control the
masking of IRQ and FIQ, respectively.
• The I bit masks IRQ when set to binary 1, and similarly the F bit masks FIQ when
set to binary 1.
Condition Flags
• Condition flags are updated by comparisons and the result of ALU operations that
specify the S instruction suffix.
• For example, if a SUBS subtract instruction results in a register value of zero, then
the Z flag in the cpsr is set.
• In this book we use a notation that presents the cpsr data in a more human readable
form.
• When a bit is a binary 1 we use a capital letter;
• when a bit is a binary 0, we use a lowercase letter.
• For the condition flags a capital letter shows that the flag has been set.
• For interrupts a capital letter shows that an interrupt is
disabled.
Conditional Execution
• Prior to execution, the processor compares the condition attribute with the condition
flags in the cpsr.
• If they match, then the instruction is executed; otherwise the instruction is ignored.
Condition mnemonics
Pipeline
•The MSR instruction is used to enable IRQ interrupts, which only occurs
once the MSR instruction completes the execute stage of the pipeline.
•Once the AND instruction enters the execute stage of the pipeline, IRQ
interrupts are enabled
• In the execute stage, the pc always points to the address of the instruction plus 8
bytes.
• In other words, the pc always points to the address of the instruction being
executed plus two instructions ahead.
Exceptions, Interrupts, and the Vector Table
• They improve performance, manage resources, and provide extra functionality and
are designed to provide flexibility in handling particular applications.
• It is usually necessary to have a method to help organize these devices and protect
the system from applications trying to make inappropriate accesses to hardware.
• More than one coprocessor can be added to the ARM core via the coprocessor
interface.