Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
PROGRAMMING
Embedded System
An embedded system is a computer
system with a dedicated function within a
larger mechanical or electrical system,
often with real-time computing constraints.
digital watches and MP3 players, traffic
lights, factory controllers, and largely
complex systems like hybrid vehicles, MRI,
and avionics.
ATMs, cell phones, printers, thermostats,
calculators, and videogame consoles
Characteristics of Embedded
Computing Applications
Complex algorithms
User interface
Real time
Multirate
Manufacturing cost
Power and energy
Why Use
Microprocessors?
Microprocessors are a very efficient way to
implement digital systems.
Microprocessors make it easier to design
families of products that can be built to
provide various feature sets
microprocessors execute programs very
efficiently
Microprocessor run very fast
Multiprocessors consumes low power and
also of low cost
Challenges in Embedded
Computing System Design
Performance in Embedded
Computing
Embedded system designers have a
very clear performance goal which is
meeting the deadline by the
program
Real-time behavior of an embedded
system can be obtained by analyzing
the system at several different levels
of abstraction
Requirements
Collect an informal description from the
customers known as requirements
Refine the requirements into a specification
Requirements may be functional or
nonfunctional
Nonfunctional requirements
Performance
Cost
Physical size and weight
Power consumption
Important Requirements
Name
Purpose
Inputs
Outputs
Functions
Performance
Manufacturing cost
Power
Physical size and weight
Specification
specification is more precise description
specification must accurately reflect the
customers requirements
UML, a language for describing specifications
specification should be understandable
specification of the GPS system
Data received from the GPS satellite constellation
Map data
User interface
Operations that must be performed to satisfy
customer requests
Background actions required to keep the system
running
Architecture Design
Describing how the system implements those
functions in specification
architecture is a plan for the overall structure of
the system
design an initial architecture not biased toward
too many implementation details
block diagram
one for hardware
another for software
System Integration
components are put together and
create a working system
By building up the system in phases
and running properly chosen tests, we
can often find bugs more easily.
System integration is difficult because
it usually uncovers problems
debugging facilities for embedded
systems are usually much more limited
ARM Processors
Primarily used in many 32-bit
embedded systems
simple and powerful original design
a whole family of designs sharing
similar design principles
Common instruction set
developed by British company ARM
Holdings
Instructions
Pipelines
processing of instructions is divided into smaller
units that can be executed in parallel by pipelines
Maximum throughput
no need for an instruction to be executed by a
miniprogram called microcode as on CISC
processors
Registers
RISC machines have a large general-purpose register set
Any register can contain either data or an address
Registers act as the fast local memory store for all data
processing operations
Load-store architecture
processor operates on data held in registers
Load and store instructions transfer data between the
register bank and external memory
Memory accesses are costly time consuming
But in CISC design the data processing operations can
act on memory directly
Sample ARM
based
embedded
device
Embedded System
Hardware
ARM processor
controls the embedded device
comprises a core and the surrounding
components
include memory management and caches
Controllers
coordinate important functional blocks of the
system
Peripherals
provide all the input-output capability
Bus
to communicate between different parts of
the device
AHB bus
Multi-layer AHB
AHB-Lite
Memory
Hierarchy
Width
type
Hierarchy
the fastest memory cache is physically located
nearer the ARM processor core
slowest secondary memory is set further away
the closer memory is to the processor core, the
more it costs and the smaller its capacity
cache is placed between main memory and the
core
cache provides an overall increase in
performance but with a loss of predictable
execution time
it does not help real-time system response
Width
memory width is the number of bits the
memory returns on each access
8, 16, 32, or 64 bits
Types
Read-only memory (ROM) is the least flexible of all
memory types
to hold boot code
Peripherals
peripheral device performs input and
output functions for the chip
Each peripheral device usually
performs a single function and may
reside on-chip
All ARM peripherals are memory
mapped
the programming interface is a set of
memory-addressed registers
address of these registers is an offset from a
specific peripheral base address
Memory Controllers
Memory controllers connect different
types of memory to the processor
bus
memory controller is configured in
hardware to allow certain memory
devices to be active, on power-up
Some memory devices must be set
up by software eg. DRAM
Interrupt Controllers
Peripheral raises an interrupt to the
processor to acquire attention of
processor
interrupt controller provides a
programmable governing policy
Two types of interrupt controller
available for the ARM processor
Standard interrupt controller and
vector interrupt controller (VIC)
Embedded System
Software
Embedded system needs software to
drive it
Each software component in the
stack uses a higher level of
abstraction to separate the code
from the hardware device
Memory remapping
ARM-based embedded systems provide
memory remapping because it allows the
system to start the initialization code from
ROM at power-up
initialization code then redefines or
remaps the memory map to place RAM at
address 0x00000000
Operating System
operating system organizes the
system resources
ARM processors support over 50
operating systems
Two main categories
real-time operating systems
platform operating systems
Applications
operating system schedules
applications
An application implements a
processing task
An embedded system can have one
active application or several
applications running simultaneously
ARM processors are found in
networking, automotive, mobile and
consumer devices, mass storage,
Registers
General-purpose registers
hold either data or an
address
Identified with the letter r
prefixed to the register
number
Registers available
in user mode
Processor Modes
Determines which registers are active
and the access rights to the cpsr register
Two processor mode - privileged or nonprivileged
privileged mode allows full read-write
access to the cpsr
Non-privileged mode allows read access
to the control field in the cpsr and allows
read-write access to the condition flags
abort,
fast interrupt request,
interrupt request,
supervisor,
system,
Undefined
Banked Registers
reset,
interrupt request,
fast interrupt request,
software interrupt,
data abort,
prefetch abort
undefined instruction.
Changing
mode on an
exception.
Processor Mode
Interrupt Masks
to stop specific interrupt requests
from interrupting the processor
two interrupt request levels
Interrupt request (IRQ) and
fast interrupt request (FIQ)
Condition Flags
hardware only sets Q flag sticky
J bit reflects the state of the core
Most ARM instructions can be
executed conditionally
When bit is a binary 1, capital letter
used
When bit is a binary 0, small letter
used
CPSR
Conditional Execution
It controls whether or not the core
will execute an instruction
Prior to execution, the processor
compares the condition attribute
If condition matched, then the
instruction is executed;
otherwise the instruction is ignored
Condition mnemonics
Pipeline
pipeline is the mechanism a RISC processor
uses to execute instructions
Pipeline speeds up execution
Pipeline Executing
Characteristics
ARM pipeline process an instruction as
it passes through the execute stage
Core Extensions
components placed next to the ARM
core
improve performance, manage
resources, and provide extra
functionality
Harvard-style cores
separate caches for data and
instruction
cache provides an overall increase in
performance
But less predictable is the execution
time
Memory Management
Provides method to help organize various
memory devices
Protect the system from applications
accessing hardware without permission
Three
different
types
of
memory
management hardware
no extensions providing no protection
memory protection unit (MPU) providing limited
protection
memory management unit (MMU) providing full
protection
Coprocessors
Coprocessors can be attached to the
ARM processor
extends the processing features of a
core by extending the instruction set
Group of dedicated ARM instructions to
access coprocessor
ARM processor uses coprocessor 15
registers to control the cache, TCMs,
and memory management
Architecture Revisions
ARM
processor
implementation
executes a specific instruction set
architecture
code written to execute on an earlier
architecture revision will also execute
on a later revision of the architecture
Nomenclature
ARM7 Family
ARM7 core has a Von Neumannstyle
architecture
three-stage pipeline and executes
the architecture ARMv4T instruction
set
very good performance-to-power
ratio
Eg. ARM7TDMI, ARM7TDMI-S,
ARM720T,
ARM9 Family
five-stage pipeline
Harvard architecture,
ARM920T includes a separate D + I cache
and an MMU
embedded trace macrocell (ETM) allows a
developer to trace instruction and data
execution in real time on the processor
ARM946E-S includes TCM, cache, and an
MPU
ARM926EJ-S synthesizable processor with
Jazelle technology
ARM10 Family
six-stage pipeline
supports an optional vector floatingpoint (VFP) unit
VFP significantly increases floatingpoint performance
ARM1020E is the first processor to
use an ARM10E core
ARM1026EJ-S has both MPU and MMU
ARM11 Family
ARM1136J-S implementation
executes ARMv6 architecture
instructions
eight-stage pipeline with separate
load-store and arithmetic pipelines
single instruction multiple data
(SIMD) extensions for fast media
processing
StrongARM, Xscale, SC100 are other
flavours of ARM core