Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Embedded Systems Course Wrap-Up. Introduction to Embedded Systems List of Lectures Hardware-Software Interfaces Operating principles Scientific.

Similar presentations


Presentation on theme: "Introduction to Embedded Systems Course Wrap-Up. Introduction to Embedded Systems List of Lectures Hardware-Software Interfaces Operating principles Scientific."— Presentation transcript:

1 Introduction to Embedded Systems Course Wrap-Up

2 Introduction to Embedded Systems List of Lectures Hardware-Software Interfaces Operating principles Scientific and application-level abstractions

3 Introduction to Embedded Systems Hardware-Software Interfaces Lecture 1: Introduction to Embedded Systems Lecture 2: ARM Assembly Language and C Lecture 3: ARM Exception Handling and SWIs Lecture 4: ARM Monitor, Program Loading and Initialization Lecture 5: Code Optimization and Profiling Lecture 6: Memory, I/O and Bus Architectures Lecture 7: The X-Board Lecture 8: Timers and Interrupts Lecture 9: Interrupts and Serial Communications Lecture 10: Buffering

4 Introduction to Embedded Systems Operating Principles of Embedded Systems Lecture 11: DMA and Introduction to Process Scheduling Lecture 12: Concurrency Lecture 13: Memory Management & Virtual Memory Lecture 14: Traditional OS Processes & Scheduling Lecture 15: More on Deadlocks

5 Introduction to Embedded Systems Lecture 16-18: –Resource Management in (Embedded) Real-Time Systems –Analysis of Independent Real-Time Periodic Tasks –Real-Time Synchronization Protocols Lecture 19: Analog-to-Digital Conversion Lecture 20: Feedback Controllers (PID Control) Lecture 21: Basics of Signal Processing and Filters Lecture 22: Embedded Middleware Lecture 23: Real-Time Operating Systems Designing Practical Real-Time Applications

6 Introduction to Embedded Systems Lecture 1: Introduction to Embedded Systems What is an embedded system? –More than just a computer ­­ it's a system What makes embedded systems different? –Many sets of constraints on designs –Four general types: General-Purpose, Control, Signal Processing, Communications What embedded system designers need to know ? –Multi­objective: cost, dependability, performance, etc. –Multi­discipline: hardware, software, electromechanical, etc. –Life cycle: specification, design, prototyping, deployment, support, retirement CPU Cache Memory I/OMMI D/AA/D Microcontroller Sensors Actuator Auxiliary Systems (power, cooling) Diagnostic tools External Environment Electro-mechanical backup and safety

7 Introduction to Embedded Systems Lecture 2: ARM Assembly Language and C The ARM Programmer’s Model Introduction to ARM Assembly Language Assembly Code from C Programs Dealing With Structures Interfacing C Code with ARM Assembly ARM libraries and armsd Handouts: –ARM Reference Manuals –Copy of lecture slides –Additional recitations pc lr sp SP before address 0x90 0x8c 0x88 0x84 0x80 0x7c 0x78 0x74 0x70 0x6c 0x68 0x64 0x60 0x5c 0x58 0x54 0x50 ip fp v7 v6 v5 v4 v3 v2 v1 a4 a3 a2 a1 SP after

8 Introduction to Embedded Systems Lecture 3: ARM Exception Handling and SWIs Software Interrupts (SWIs) –What is an SWI? –What happens on an SWI? –Vectoring SWIs –What happens on SWI completion? –What do SWIs do? –A Full SWI Handler –A C_SWI_Handler (written in C) Loading Software Interrrupt Vectors

9 Introduction to Embedded Systems Lecture 4: ARM Monitor, Program Loading and Initialization The ARM Debug Monitor Loading programs The ARM Image Format (AIF) What happens on program startup? header text segment initialized data zero’ed In-memory layout debug info

10 Introduction to Embedded Systems Lecture 5: Code Optimization and Profiling Profiling Amdahl’s Law The 80/20 rule Profiling in the ARM environment Name cum% self% desc% calls main 96.4% 0.16% 95.88% 0 qsort 0.44% 0.75% 1 _printf 0.00% 0.00% 3 clock 0.00% 0.00% 6 _sprintf 0.34% 3.56% 1000 randomise 0.12% 0.69% 1 hell_sort 1.59% 3.43% 1 insert_sort 19.91% 59.44% 1 ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ ­­­­­­­­­­­ main 19.91% 59.44% 1 insert_sort 79.35%19.91% 59.44% 1 strcmp 59.44% 0.00% ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ qs_string_compare 3.17% 0.00% shell_sort 3.43% 0.00% insert_sort 59.44% 0.00% strcmp 66.05% 66.05% 0.00%

11 Introduction to Embedded Systems Lecture 5: Code Optimization Improving program performance Standard compiler optimizations –common sub-expression elimination –dead-code elimination –induction variables Aggressive compiler optimizations –in-lining of functions –loop unrolling Architectural code optimizations Address Register Register Bank Mem Addr RegisterWrite Data Register Read Data/ Instr Reg RAM Addr Incrementer Barrel Shifter 32-bit ALU Dout[31:0] Data[31:0] ALU Bus B Bus A Bus Incrementer Bus

12 Introduction to Embedded Systems Lecture 6: Memory, I/O and Bus Architectures CPU Device 1Device 2Device 3 Bus The many levels of computer systems The CPU-Memory Interface The Memory Subsystem and Technologies –SRAM –DRAM CPU-Bus-I/O –I/O Register Basics Bus Protocols –Synchronous bus protocol –Asynchronous bus protocol –Bus arbitration

13 Introduction to Embedded Systems Lecture 7: The X-Board The lab Big-Endian Evaluation Board XScale processor Xilinx FPGA The X-Board and accessories 7-Segment LED Serial ports

14 Introduction to Embedded Systems Lecture 8: Timers and Interrupts ÷ x1206 I/O Control Clock Divider Counter Register Reloa d on Zero Countdown Register Interrupt to Processor System Clock Timers –What is a timer? –A peek inside the timers –C structs for the timer –Using the timer Interrupt vs. polled I/O –Polling example –Interrupt example IRQ and FIQ

15 Introduction to Embedded Systems Lecture 9: Interrupts and Serial Communications Interrupts (con’t) –interrupt handlers –nested interrupts –interrupt timing and metrics –Interrupts on the ARM 7500 Evaluation Board –installing and writing interrupt handlers Serial Communications –Data communications and modulation –Asynchronous protocols –Serial port and bit transmission –Serial I/O from device drivers PARALLEL SERIAL

16 Introduction to Embedded Systems Lecture 10: Buffering and DMA (Direct Memory Access) Concurrency between I/O and processing activities Buffering –dealing with nested interrupts –critical sections and masking interrupts DMA (Direct Memory Access) –Programmed I/O vs DMA –double buffering Data Buffer 1 Data Buffer 2 Producer Consumer Active transfer Alternate transfer Active transfer Alternate transfer

17 Introduction to Embedded Systems Lecture 11: Processes and Process Scheduling Waiting for Event Delayed Dormant Ready Running Interrupted task deleted interrupted task create/delete task create/delete task deleted context switch delay expired event occurred wait for event delay task for n ticks OS “Scheduling” –Foreground/Background systems –Processes Context Switching Process State Ready list Process Scheduling algorithms –FCFS scheduling –Shortest-Job-First Scheduling –Priority Scheduling –Multi-Level Round-Robin Scheduling

18 Introduction to Embedded Systems Lecture 12: Memory Management (Overlays/VM) How do programs run in memory? –What happens on “overflows”? –Memory Overlays Static overlays and dynamic overlays Problems with overlays Virtual Memory (VM) –How does VM work? –Virtual address to physical address mappings –Page faults –VM Schemes page tables virtual pages and physical page frames page table entries interactions with the rest of the system two-level page tables Virtual Address page directory page table page frame data

19 Introduction to Embedded Systems Lecture 13: Concurrency Critical sections –the atomicity requirement Techniques to enforce critical sections –Solution 1: too hard-wired –Solution 2: does not work! –Solution 3: deadlock! –Solution 4: starvation! –Solution 5: Dekker’s algorithm –Semaphores: good… Implementing Semaphores –test-and-set instructions –ARM instructions

20 Introduction to Embedded Systems Lecture 14: More on Synchronization and Deadlocks Types of Synchronization Deadlocks –necessary conditions for deadlocks –dealing with deadlocks Some classical synchronization problems –producer/consumer problems –reader/writer problems –the “dining philosophers” problem P1:: P(s1)... V(s2) P2:: P(s2)... V(s1) P2:: P(s1)... V(s1) P1:: P(s1)... V(s1) Barrier Synchronization Mutex

21 Introduction to Embedded Systems Lecture 15: Traditional OS Processes and Scheduling Dispatching Unix as an example of a traditional general-purpose OS –Unix processes and threads Unix Scheduling if (PID == 0) { /* this is the child process; * add your code here for a small fee */ } else { children[current_child] = PID; current_child++; /* this is the rest of the parent *process; continue your code here * E.g.: wait for your child process to * come back. */ }

22 Introduction to Embedded Systems Lecture 16: Resource Management Introduction to Real-Time Systems Basic terms: –timing correctness and predictability –schedulability –hard and soft real-time systems –examples: single-rate feedback control systems multi-rate control systems hierarchical control systems

23 Introduction to Embedded Systems Lecture 17: Analyzing Independent Periodic Tasks Key concepts in real-time computing. –How to analyze the schedulability of independent periodic tasks. –Dealing with transient overload –Handling context-switching overhead

24 Introduction to Embedded Systems Lecture 18: Real-Time Synchronization Protocols Synchronization in real-time systems –Priority inversion –Unbounded priority inversion –Protocols to bound priority inversion basic priority inheritance protocol priority ceiling protocol Dealing with Aperiodic tasks –sporadic servers Solving our example problem completely –early deadlines –average response time

25 Introduction to Embedded Systems Lecture 19: A/D Conversion/RT Periodic Tasks Analog to Digital Conversion –single-ended inputs –differential inputs Digital to Analog Conversion –Voltage ranges and conversion between representations Periodic tasks –Rate-Monotonic Scheduling –Drift and jitter –Timing problems in “traditional” implementations –POSIX timers and clocks –POSIX interval structures –Putting it all together

26 Introduction to Embedded Systems Lecture 20: Feedback (PID) Controllers Feedback control –stability –instability –marginal stability Feedback controllers –proportional control (P) –proportional + derivative control (PD) –proportional + derivative + integral control (PID) Simulation diagram concepts

27 Introduction to Embedded Systems Lecture 21: Basics of Signal Processing Source of deterministic errors and random noises Basics of signal spectrum –Nyquist sampling –Fourier transform Basic filters –what you can do and when you should ask for help

28 Introduction to Embedded Systems Lecture 22: Embedded Middleware Requirements –Limited resources: Smaller footprint (requires less code-bloat) –Real-time support (available in Real-Time CORBA specification) Full CORBA implementation: 150 Kbytes – 5 Mbytes! What are your options? –Minimal CORBA: Throw out some of the heavyweight CORBA mechanisms (~ KB) –IIOP Engine: Use a library that keeps only the IIOP protocol part (~ 15 KB) –CORBA Gateways: TCP bridge from the embedded processors to a CORBA gateway that talks to the rest of the world

29 Introduction to Embedded Systems Quizzes Totally 5 in number The lowest quiz grade will be dropped and not considered

30 Introduction to Embedded Systems Lab Projects Lab 1: Programming in assembly language and writing system calls –Using a processor emulator Lab 2: Programming physical I/O Devices with interrupts –Plus writing application programs that make system calls Lab 3: Programming an inter-active real-time game –Managing a user-interface and display –Communications with a host Lab 4: Using tools to analyze embedded real-time systems –Profiling and analytically modeling real-time applications Lab 5: Writing your own embedded OS –Creating, deleting your own tasks, managing concurrency, etc.

31 Introduction to Embedded Systems Topics Covered Memory Management Basic Concurrency Processes and CPU Scheduling Mutual Exclusion Deadlocks A/D, D/A and Periodic Tasks Real-Time Resource Management Independent Periodic Tasks Task Synchronization Handling Aperiodic Events Basics of Signal Processing and Filters Basics of PID Control Embedded Middleware Real-Time Operating Systems What are embedded systems? Calling conventions, C/asm Interfacing System Calls (SWIs) Program Monitor and Loading Code Optimization I/O Basics The 349 X-Board Serial Communications Interrupts, DMA and Device Drivers We covered a wide spectrum.

32 Introduction to Embedded Systems More Food For Thought The key to embedded systems of the future: –Productive programming environment and tools –Small compact size –Neat ideas (using wireless networks like BlueTooth?) From within your car How would you like to change the world? The professor’s research group does all system software aspects of –Real-Time Linux, Real-Time Java, Networking, Wireless Networks, Multimedia + Some theory to make sure that our foundations and concepts are on a solid foundation –Dependable middleware (CORBA, Java, DCOM,.NET), adaptive embedded systems, scalable enterprise systems

33 Introduction to Embedded Systems Final Exam Schedule for the final exam –Open book, open notes Several problem sets already posted to help you for the mid-term and previous quizzes Please make sure to revise

34 Introduction to Embedded Systems And Finally …. Thank you for your patience with the challenging aspects of this course –You lived to tell the story! Congratulations for surviving a(nother) semester!


Download ppt "Introduction to Embedded Systems Course Wrap-Up. Introduction to Embedded Systems List of Lectures Hardware-Software Interfaces Operating principles Scientific."

Similar presentations


Ads by Google