Académique Documents
Professionnel Documents
Culture Documents
Prepared by: Professor Kurt Keutzer Computer Science 252, Spring 2000 With contributions from: Jerry Fiddler, Wind River Systems, Minxi Gao, Xiaoling Xu, UC Berkeley Shiaoje Wang, Princeton
Kurt Keutzer
U S E R
debugger
simulator
C P U
A S I C A S I C
ROM RAM
Kurt Keutzer
Lets look at current architectural evolution from the standpoint of the software developers , in particular Jerry Fiddler
Kurt Keutzer
J. Fiddler - WRS
Kurt Keutzer 4
Fundamental Principles
Computers are, and will be, everywhere The world itself is becoming more intelligent Our infrastructure will have major software content Most of our access to information will be through embedded systems Economics will inexorably drive deployment of embedded systems The Internet is one important factor in this trend Reliability is a critical issue EVERY tech and mfg. business will need to become good at embedded software
J. Fiddler - WRS
Kurt Keutzer 5
Today - Pacemakers Soon - De-Fibrillators, Insulin Dispensers We can all be the $6M Person, for a lot cheaper Speech, DNI, etc.
J. Fiddler - WRS
Kurt Keutzer 6
1989
1993
1995
1999
Embedded CPU cores are getting smaller; ~ 2mm2 for up to 400 mHz
G
Less than 5% of CPU size Faster clock, deeper pipelines, branch prediction, ... Devices that were on the board now on chip: system on a chip Adding more compute power by add-on DSPs, ... Much larger L1 / L2 caches on silicon
J. Fiddler - WRS
7
Kurt Keutzer
Microprocessor Chaos
J. Fiddler - WRS
ST 20 M32 R/D StrongARM ARM SH-DSP SH 4 MCORE 680x0 CPU32 PowerPC 80x86 MIPS 3k/4k/5k SPARC SH 1/2/3 29k RAD 6k Siemens C16x NEC V8xx PARISC i960 563xx
68000
680x0 CPU32 PowerPC 80x86 MIPS 3k/4k/5k SPARC SH 1/2/3 29k RAD 6k Siemens C16x NEC V8xx PARISC i960 563xx
1980
Kurt Keutzer
1990
1996
1998
8
A Challenging Environment
J. Fiddler - WRS
Expanding Functional Demands Of Embedded Applications
System-on-a-chip DSP
Kurt Keutzer
10
More Applications
J. Fiddler - WRS
Kurt Keutzer
11
U S E R
debugger
simulator
C P U
A S I C A S I C
ROM RAM
Kurt Keutzer
12
Outline on RTOS
Introduction VxWorks
G
General description G System G Supported processors Details G Kernel G Custom hardware support G Closely coupled multiprocessor support G Loosely coupled multiprocessor support
Kurt Keutzer
14
G G
Kurt Keutzer
15
Kernel Originally no file sys, I/O, etc. No development environment No network Non-portable, in assembly
Kurt Keutzer
16
Integrated, text-based, Unix Scalable, portable OS G Includes network, file & I/O sys, etc. Tools on target G Network required G Heavy target required for development Closed development environment
Attributes
G
Kurt Keutzer
17
Any tool - Any connection - Any target Integrated GUI, Unix & PC
Attributes
G
Tools on host
G G
G G
Kurt Keutzer
18
Java?
Much easier to create, debug & re-use code Easy for non-programmers to contribute
Kurt Keutzer
19
Application Browser / GUI Java Advanced Interconnect Advanced Networking Distributed Objects Fault Tolerance Multiprocessing File System Networking Kernel
Application X Windows WindNet Memory Management Multiprocessing File System Networking Kernel
90%*
75%*
10%*
30%*
1980
1990
1996
1998
Introduction to RTOS
Wind River Systems Inc. http://www.wrs.com VxWorks
pSOS
eCos
Kurt Keutzer
21
VxWorks
Real-Time Embedded Applications Graphics Java support Multiprocessing support POSIX Library WindNet Networking Core OS Wind Microkernel Internet support File system
VxWorks
22
Supported Processors
PowerPC 68K, CPU 32 ColdFire MCORE 80x86 and Pentium i960 ARM and Strong ARM MIPS SH
VxWorks
23
Wind microkernel
Task management
G G
multitasking, unlimited number of tasks preemptive scheduling and round-robin scheduling(static scheduling) fast, deterministic context switch 256 priority levels
G G
VxWorks
24
Wind microkernel
Fast, flexible inter-task communication
G
binary, counting and mutual exclusion semaphores with priority inheritance message queue POSIX pipes, counting semaphores, message queues, signals and scheduling control sockets shared memory
G G
G G
VxWorks
25
Wind microkernel
High scalability Incremental linking and loading of components Fast, efficient interrupt and exception handling Optimized floating-point support Dynamic memory management System clock and timing facilities
VxWorks
26
BSP
VxWorks
27
VxMP
A closely coupled multiprocessor support accessory for VxWorks. Capabilities:
G G G G G
Support up to 20 CPUs Binary and counting semaphores FIFO message queues Shared memory pools and partitions VxMP data structure is located in a shared memory area accessible to all CPUs Name service (translate symbol name to object ID) User-configurable shared memory pool size Support heterogeneous mix of CPU
G G G
VxWorks
28
VxMP
Hardware requirements:
G G
Shared memory Individual hardware read-write-modify mechanism across the shared memory bus CPU interrupt capability for best performance Supported architectures: G 680x0 and 683xx G SPARC G SPARClite G PPC6xx G MIPS G i960
G G
VxWorks
29
VxFusion
VxWorks accessory for loosely coupled configurations and standard IP networking; An extension of VxWorks message queue, distributed message queue. Features:
G G G
Media independent design; Group multicast/unicast messaging; Fault tolerant, locale-transparent operations;
App1
App2
VxFusion
Adapter Layer
Heterogeneous environment. Motorola: 68K, CPU32, PowerPC Intel x86, Pentium, Pentium Pro
Supported targets:
G G
Transport
VxWorks
30
pSOS
Debug BSPs
pSOS+ Kernel
pSOS 2.5
pSOS
31
Supported processors
PowerPC 68K ColdFire MIPS ARM and Strong ARM X86 and Pentium i960 SH M32/R m.core NEC v8xx ST20 SPARClite
pSOS
32
pSOS+ kernel
Small Real Time multi-tasking kernel; Preemptive scheduling; Support memory region for different tasks; Mutex semaphores and condition variables (priority ceiling) No interrupt handling is included
pSOS
33
pSOS
34
pSOS+m kernel
Tightly coupled or distributed processors; pSOS API + communication and coordination functions; Fully heterogeneous; Connection can be any one of shared memory, serial or parallel links, Ethernet implementations; Dynamic create/modify/delete OS object; Completely device independent
pSOS
35
eCos
ISO C Library Native Kernel C API Internal Kernel API Drivers Kernel
Device
eCos
36
Supported processors
Advanced RISC Machines ARM7 Fujitsu SPARClite Matsushita MN10300 Motorola PowerPC Toshiba TX39 Hitachi SH3 NEC VR4300 MB8683x series Intel strong ARM
eCos
37
Kernel
No definition of task, support multi-thread Interrupt and exception handling Preemptive scheduling: time-slice scheduler, multi-level queue scheduler, bitmap scheduler and priority inheritance scheduling Counters and clocks Mutex, semaphores, condition variable, message box
eCos
38
interrupt delivery context switching CPU startup and etc. platform startup timer devices I/O register access interrupt control architecture variants on-chip devices
eCos
Summary on RTOS
VxWorks
Task Y
pSOS
Y
eCos
Only Thread Preemptive Y Linux Y HAL, I/O package None
Preemptive, static Preemptive Scheduler Y Synchronization mechanism No condition variable POSIX support Scalable Custom hw support Kernel size Multiprocessor support Y Y BSP VxMP/ VxFusion (accessories) Y Y BSP 16KB PSOS+m kernel
Kurt Keutzer
40
BSP
VxWorks
41
Make the attached device work. Insulate the complexities involved in I/O handling.
Kurt Keutzer
42
Proliferation of Interfaces
New Connections
G G G G
USB 1394 IrDA Wireless JetSend Jini HTTP / HTML / XML / ??? Distributed Objects (DCOM, CORBA)
New Models
G G G G
Kurt Keutzer
43
Courtesy - Synopsys
Kurt Keutzer 44
Kurt Keutzer
45
Device Characterization
Block devices
G
Character devices
G
byte-stream devices manage local area network and wide area network interconnections
Network device
G
Kurt Keutzer
46
make itself known to the kernel initialize the interrupt handling optional: allocate the temporary memory for device driver initialize the hardware device initiation of an I/O request handles the completion of I/O operations
Front-End Processing
G
Back-End Processing
G
Kurt Keutzer
47
Commercial Resources
Aisys DriveWay 3DE
G
Motorola MPC860, MC68360, MC68302, AMD E86, Philips XA, 8C651, PIC 16/17 Hitachi H8, SH1, SH3, SH7x, HCAN
Stenkil MakeApp
G
TI DSPs
CoWare
Kurt Keutzer
48
Kurt Keutzer
49
GUI
.DWP
Code generator
.DLL
K.B.
Output files
Chip specific
Kurt Keutzer
Manipulation of K.B.database
50
K.B. Database
A specific K.B. per chip family Family of chips
G
chip G peripherals functional objects (timer, PWM counter) functions physicals (register setting, values, clock rate) actual code
Kurt Keutzer
51
DriveWay Builder
Add chip Add peripheral Create skeleton, link to other thins such as GUI Code reuse in adding a new chip in an existing family, e.g., use code in MPC 860 for MPC 821 Easy to create infrastructure but specifics has to be written
Kurt Keutzer
52
model user specification extract useful information for drivers from HDL description of the chip G MAP registers G interrupt
Kurt Keutzer
53
Commercial efficiency G e.g., easy to capture user specification from the GUI rather than using a model such as UML or state machine HDL code too low level, hard to extract information
Kurt Keutzer
54
Designer selects communication protocols & memory System synthesizes efficient device drivers and glue logic
Hardware
Device Glue Logic Driver
Software
Kurt Keutzer
55
compiled on processor
Glue Logic
Kurt Keutzer
56
U S E R
debugger
simulator
C P U
A S I C A S I C
ROM RAM
Kurt Keutzer
57
RAM RAM
S/P
DMA
Are a vs . Pro g ra m In s t ru ct io n s
1000
MIPS-4Kc
2000
ARC
3000
ARM9
4000
ARM9-Thumb
5000
Based on base 0.18 implementation plus code RAM or cache Xtensa code ~10% smaller than ARM9 Thumb, ~50% smaller than MIPS-Jade, ARM9 and ARC ARM9-Thumb has reduced performance RAM/cache density = 8KB/mm2
Kurt Keutzer
59
Compaq/Digital StrongARM
Kurt Keutzer
61
Compiler Support
BUT, few companies focused on compiler support for embedded systems:
G G G
Kurt Keutzer
62
ARM MIPS Power PC Mot family Cygnus/RedHat Manufacturer Green Hills Tartan acquired by Texas Instruments WHY???? TMS320C80 IXP1200
63
From
G G G
Kurt Keutzer
Fixed-point arithmetic MAC- Multiply-accumulate Harvard Architecture Multiple data memories Bit-reversed addressing Circular buffers Zero-overhead loops Support for MAC
Kurt Keutzer
64
Example: IXP1200
Host CPU (optional)
PCI Bus 66 Mhz 32
PCI Bus Unit SDRAM (up to 256 MB) SRAM (up to 8 MB) Boot ROM (up to 8 MB) Peripherals Ethernet MAC
Kurt Keutzer
64
StrongARM core
Microengine 1 Microengine 2 Microengine 3 Microengine 4 Microengine 5 Microengine 6
ATM, T1/E1
Another IXP1200
65
RISC engines 4 contexts/eng 24 threads total packet I/O connect IXPs G scalable less critical tasks level 2 lookups
IX Bus Interface
G G
ICache
SA Core
StrongARM
G
Hash engine
G
PCI interface
Kurt Keutzer
66
Summary
Embedded software support for microcontrollers and microprocessors is broadly available and of adequate quality
G G G G
RTOS Device drivers Compilers Debuggers Patchy support many parts lack support Quality poor lags hand coding by 20-100%
Embedded software support for special purpose processors often non-existent Still in a ``build a hardware then write the software world Alternatives?
67
Kurt Keutzer
APPLICATION CODE
DESIGNER
RETARGETABLE COMPILER
OBJECT CODE
SIMULATION MODEL
PERFORMANCE ANALYSIS
Configure Base uP
Processor Generator
uP
Software Tools
Describe new inst in TIE
Mem
Software compile
Software Generator
Application Kurt Keutzer 69
Acceptable ? Y
Correct ?
Kurt Keutzer
70
Conclusions
Full embedded software support for will be requirement for future embedded system ``platforms Companies evolving hardware and software together will have a significant competitive advantage Few examples beginning to emerge- Tensilica, ST Microelectronics
Kurt Keutzer
71