Deployment of Sensing Devices on Critical Infrastructure

Download Report

Transcript Deployment of Sensing Devices on Critical Infrastructure

Introduction to Embedded Systems
Rabie A. Ramadan
[email protected]
http://www.rabieramadan.org/classes/2014/e
mbedded/
1
Welcome Back
2
Class Organization




Attendance is very important
Assignments
Projects
Quizzes
3
Textbooks
Text
T. Noergaard, Embedded Systems Architecture: A Comprehensive Guide
for Engineers and Programmers, Elsevier, 2005
4
Project

Projects
• Team work ( 4 persons)
• Grading
• Demonstration
• Reports


We will design a simple robot based on
Arduino
Supplementary readings
About this course

Grading
• 20% Lab + Quizzes , 15% homework, 15% exam ,
50% project

Academic Dishonesty
About this course

Things you should already know
• Digital logic design
• Number representation
• 2’s complement (int and fp)
• Binary arithmetic
• add, subtract, shift, multiply, division,
• Combinational logic
• and, or, xor, nand, nor, mux, …
• Sequential logic
• Flip-flops, registers
• Read/draw a schematic
About this course
• Things you should have already known
• Basic computer organization
• Instruction execution
• Simple assembly programming
• Processor/memory/buses
• Programming
• C/C++
• Compilation and debugging
Topics







The principles of embedded system design and its
challenges
Embedded hardware architecture
Embedded software development
Hardware/software interfacing and debugging
Processes and operating systems
Advanced design techniques
Other topics such as (low power design and real-time
computing) may be covered
Things you will learn

What is the embedded system and how to
design such systems

Practical skills and experiences
• Commercial design softwares
• Quartus II, Nios II IDE
• Commercial hardware evaluation board
• Arduino
Kit
Embedded System Design

When we talk about the computing
system
• PC
• Laptop
• Workstation
• Mainframe
• Super Computers …

In fact, computing systems are
everywhere …
Computing systems are everywhere
…wake up …
…have breakfast …
…set home safety system …
Examples In Your Daily Life (cont’)
…get into your car …
A late model car can have as many as 65+ processors for engine
control, A/C control, cruise control, audio, etc
More than 30% of the cost of a car is now in electronics
90% of all innovations will be based on electronic systems
Examples In Your Daily Life (cont’)
…on your way to your University (if any )…
Examples In Your Daily Life (cont’)
…in your office …
Examples In Your Daily Life (cont’)
…back home …
Several hundred processors can be involved in the course
of one day for one person !
Other Examples
• Mission critical controls
• Nuclear plant control, aircraft navigation, military
equipment
• Medical equipment
• Communications
• Toys, etc
We can say:
Embedded systems have been deeply ingrained in our life !
What ??

What is the embedded system?
• Embedded System
• Processor based
• General processors
• Micro controllers
• Digital signal processing (DSP)
• A subsystem
• With special purpose
• Not a general programming computer
Major components
Memory
ASIC/FPGA
Sensors
Software
A/D
Input
D/A
Output
Keyboards,
Actuators
Processor(s)
Mouse,
Other Hardware
Displays,
Clock circuit, timer, etc
Interconnections
Auxiliary Systems (power, cooling,…)
Switches, etc
Example: Digital Camera
Processor
Some common characteristics

Application specific

Tightly-constrained

Reactive and real-time
• Executes a single program, repeatedly
• Low cost, low power, small, fast, etc.
• Continually reacts to changes in the system’s
•
environment
Timing is as important as the correctness
Why Processors ?




Flexibility
Easy to upgrade
Easy to build complex system behavior
Maintainability
Design Challenges

Moore’s Law

Design Cost
Stringent Time-to-market
Design requirements (constraints)


• Productivity Gap
Moore’s Law
The transistor density of
semiconductor chips would double
roughly every 18 months.
--by Gordon Moore,1965
(co-founder of Intel)
Image courtesy of Intel Corporation
300
1400
250
1200
200
Transistor
Power
1000
800
150
600
100
400
50
200
0
0
2001 2003 2005 2007 2009 2011 2013 2015 2017
Year
Source: S. Borkar, Thousand Core Chips – A Technology Perspective, DAC, 2007
Power (Watt)
Transistor Size (Billion)
Power Consumption Challenges
Productivity Gap
The gap between the availability of the IC
technology (increasing computing power) and
the application of the IC technology.
Design Challenges (cont’d)

Moore’s Law

Design cost
• Productivity Gap
• Reduce non-recurring engineering (NRE) cost
• A superior human engineer may outperform the CAD tools
in designing simple embedded systems but not for systems
with hundred millions to billions gates


Stringent time-to-market
Design requirements (constraints)
Design Cost

Total cost = NRE cost + Unit cost *
Unit #
• NRE (Non-recurring engineering cost)
cost
•
one time monetary cost for the products
• Unit cost
•
the monetary cost of manufacturing each
copy of the system, excluding NRE cost
• Ex: 1000 Units, NRE cost $5,000,000,
unit cost $1000
• Cost/product = (5000000+1000*1000)/1000 =
6000$
Design Challenges (cont’d)

Moore’s Law

Design cost
• Productivity Gap
• Reduce non-recurring engineering (NRE)
cost


Stringent time-to-market
Design requirements (constraints)
Time-to-market
Revenues ($)
• Time required to develop a
product to the point it can
be sold to customers
• Market window
– Period during which the
product would have highest
sales
Time (months)
• Delays can be costly
– Each week delay translates to
1% loss in relative
performance
Design Challenges (cont’d)

Moore’s Law

Design cost
• Productivity Gap
• Reduce non-recurring engineering (NRE)
cost


Stringent time-to-market
Design requirements (constraints)
Design Requirements (Constraints)







Functionality
Timing
Power consumption
Cost
Size & Weight
Safety & Reliability
•
Low cost reliability with minimal redundancy
Others: component acquisition, upgrades, compatibility, etc.
The General Design Flow
requirements



component
design
system
integration
•
•
specification
architecture
In the past:
Hardware and software design
technologies were very different
Recent maturation of synthesis
enables a unified view of
hardware and software
Hardware/software “codesign”
High abstraction level design
Embedded Systems Design




The big-bang model, in which there is essentially no
planning or processes in place before and during the
development of a system.
The code-and-fix model, in which product requirements are
defined but no formal processes are in place before the start
of development.
The waterfall model, in which there is a process for
developing a system in steps, where results of one step flow
into the next step.
The spiral model, in which there is a process for developing
a system in steps, and throughout the various steps,
feedback is obtained and incorporated back into the process.
1970’s
Layout
Transistor
1980’s
Transistor
Gate
1990’s
MUX
ALU
Reg
Gates
ALUs,MUXes, Regs
1990’s-2000s’
MUX
MEM
A/D
D/A
ALU
Reg
ALUs,MUXes, Regs
FPGA
uP
ASIC
Proc,FPGA,ASICs
Software Design





Instruction Set Architecture
Assembly Programming (Compiler, Linker)
VHDL, C programming
Embedded C, Hardware C, …
Graphical Language, behavioral synthesis
…
Abstraction

Conceptual interpretation of a system
Abstraction
Level
System
Complexity
System Level
Structural
Register Transfer
(RT) Level
Behavioural
Y-chart
Algorithms,processes
Processors,ASICs,memory
Logical Level
ALU,Reg,MUX
RT Specifications
Boolean Eqn.
Circuit Level
Differential Eqn.
Gates,Flip-Flops
Transistors
Layout
Cells, wiring
Macro-cells,chips
Physical
Boards,SOCs
State-of-the-Art Design

Address the complex system at high
abstraction levels
• Explore all degrees of design freedom
• Making some critical decisions at an early
•

design phrase
Reducing production cost, design cost, and
development time
Emphasize on design use
IP Reuse

IP (Intellectual Property)
•
A family of components that can perform
certain clusters of functions
•
•

Hard IP, e.g. layout, netlist
Soft IP, e.g. RTOS, device driver, libraries
Reuse
•
•
•
Not something new
Reduce Non-recurring Engineering (NRE)
cost
Reduce development time
What Is an Embedded System?

Embedded systems are more limited in hardware
and/or software functionality than a personal computer
(PC).
• Hardware
• limitations in processing performance, power
consumption, memory, hardware functionality
• software,
• limitations relative to a PC—fewer applications, scaleddown applications, no operating system (OS) or a
limited OS, or less abstraction-level code.
What Is an Embedded System?

An embedded system is designed to perform a
dedicated function.
• Most embedded devices are primarily designed for one
specific function.
• However, we now see devices such as personal data
assistant (PDA)/cell phone hybrids, which are embedded
systems designed to be able to do a variety of primary
functions.
What Is an Embedded System?

An embedded system is a computer system with higher
quality and reliability requirements than other types of
computer systems.
• if a car’s engine controller crashes while driving on
•
a busy freeway or a critical medical device
malfunctions during surgery, very serious
problems result.
there are also embedded devices, such as TVs,
games, and cell phones, in which a malfunction is
an inconvenience but not usually a life-threatening
situation
The Embedded Systems Model

The system and application software layers contain all of
the software located on and being processed by the
embedded system.
Processor Basics
Processors




Processor designed for a variety of computation tasks
Carefully designed since higher NRE cost is acceptable
•
•
•
NRE: Non-recurring engineering
Can yield good performance, size and power
manufacturer spreads NRE over large numbers of units
•
Motorola sold half a billion 68HC05 microcontrollers in 1996 alone
Low NRE cost, short time-to-market/prototype, high flexibility
•
User just writes software; no processor design
Different processor types
Processor Types
Processor
Clock speed
Intel PIII
1GHz
IBM
PowerPC
750X
MIPS
R5000
StrongARM
SA-110
550 MHz
Intel
8051
Motorola
68HC811
250 MHz
233 MHz
12 MHz
3 MHz
TI C5416
160 MHz
Lucent
DSP32C
80 MHz
Periph.
2x16 K
L1, 256K
L2, MMX
2x32 K
L1, 256K
L2
2x32 K
2 way set assoc.
None
4K ROM, 128 RAM,
32 I/O, Timer, UART
4K ROM, 192 RAM,
32 I/O, Timer, WDT,
SPI
128K, SRAM, 3 T1
Ports, DMA, 13
ADC, 9 DAC
16K Inst., 2K Data,
Serial Ports, DMA
Bus Width
MIPS
General Purpose Processors
32
~900
Power
Trans.
Price
97W
~7M
$900
32/64
~1300
5W
~7M
$900
32/64
NA
NA
3.6M
NA
32
268
1W
2.1M
NA
8
Microcontroller
~1
~0.2W
~10K
$7
8
~.5
~0.1W
~10K
$5
Digital Signal Processors
16/32
~600
NA
NA
$34
32
NA
NA
$75
40
Sources: Intel, Motorola, MIPS, ARM, TI, and IBM Website/Datasheet; Embedded Systems Programming, Nov. 1998
The Von Neumann Model (Architecture)

The system passes all of
its I/O through
the arithmetic logic.

It uses von Neumann
execution cycle
(also called the fetchdecode-execute cycle)
The Von Neumann Model (Cont.)

A cycle could be as follows:
1.
The control unit fetches the next program
instruction from the memory, using the program
counter to determine where the instruction is
located.
2.
The instruction is decoded into a language the
ALU can understand.
3.
Any data operands required to execute the
instruction are fetched from memory and placed
into registers within the CPU.
4.
The ALU executes the instruction and places the
results in registers or memory.
Instruction Processing
Von Neumann execution cycle
Fetch instruction from memory
Decode instruction
Evaluate address
Fetch operands from memory
Execute operation
Store result
The Modified Von Neumann Model

The data bus:
Moves data from main memory
to the CPU registers (and vice versa).

The address bus:
Holds the address of the data that
the data bus is currently accessing.

The control bus:
Carries the necessary control signals that specify how the
information transfer is to take place.
Did we
gain
something
?
CPU

Register Set

ALU

Control Unit (CU)
Register Set

Fast memory locations
• General Purpose
• Can be assigned by the programmer
• Special Purpose
• Used only for specific functions
•
Ex. PC to hold the address of instruction to be executed
Register Set


Memory Access Registers
• Memory Data Register (MDR)
• Memory Address Register (MAR)
Instruction Fetching Registers
• Program Counter (PC)
• Instruction Register (IR)
•

To hold the fetched instruction
Condition Registers/Flags
• Maintain status information.
•
special program status word (PSW) register.
Special-Purpose Address Registers

Index Register
• The address of the operand is obtained by adding
a constant to the content of a register.

Stack Pointer
• Push and Pop operations
• Implemented in 80x86
Stack
DATAPATH

Data Section of the CPU
Performs certain operations on the data
Local Bus

System Bus


• Holds the data internally between registers
• Holds external data
• Move data between registers and memory
One-bus Organization



Simplest organization
Slow – needs 2 cycles for two operand operations
Two registers are needed to save the I/p data
Two-bus Organization


Faster than one-bus
•
Two operands can be fetched at the same cycle
One register (A) might be needed for the o/p data
Two-bus Organization



One bus for the I/P (in-bus)
One bus for the O/P
Additional register is needed to save one of the operands
•
•
In-bus  moves the data into registers
Out-bus  moves the data out of registers
Three-Bus Organization


Two buses are used for moving the data out of the registers (out
buses)
One-bus as destination – move the data to the registers
Fetch instructions

The contents of the PC are loaded into the MAR.

The value in the PC is incremented. (This operation can be
done in parallel with a memory access.)

As a result of a memory read operation, the instruction is
loaded into the MDR.

The contents of the MDR are loaded into the IR.
Fetch Example – One-bus Organization
Reads the
instruction from the
memory
IR takes the
instruction
data
Group Activity

Show the same fetch on three-bus
organizations?
Fetch Example – Three-bus
Organization
t0
t1
t2
MAR  PC
MDR  Mem[MAR]; PC  PC + 4
IR
 MDR
Addressing modes
1. Immediate addressing
op
rs
rt
Immediate
The operand is constant within the instruction itself
2. Register addressing
op
rs
rt
rd
...
funct
Registers
Register
Operand is a register
3. Base addressing
op
rs
rt
Memory
Address
+
Register
Byte
Halfword
Word
The operand is at the memory location whose address is the sum of a
register and a constant in the instruction
4. PC-relative addressing
op
rs
rt
Memory
Address
PC
+
Word
The address is the sum of the Pc and constant in the instruction
Jump Address
is 26 bits (inst)
concatenated
with upper PC
bits
5. Pseudodirect addressing
op
Address
PC
Memory
Word
69