Principles and Pragmatics for Embedded Systems John Regehr University of Utah.

Slides:



Advertisements
Similar presentations
© 2004 Wayne Wolf Topics Task-level partitioning. Hardware/software partitioning.  Bus-based systems.
Advertisements

Undoing the Task: Moving Timing Analysis back to Functional Models Marco Di Natale, Haibo Zeng Scuola Superiore S. Anna – Pisa, Italy McGill University.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
Automatic Verification of Component-Based Real-Time CORBA Applications Gabor Madl Sherif Abdelwahed
Eliminating Stack Overflow by Abstract Interpretation John Regehr Alastair Reid Kirk Webb University of Utah.
Static Analysis of Embedded C Code John Regehr University of Utah Joint work with Nathan Cooprider.
Vertically Integrated Analysis and Transformation for Embedded Software John Regehr University of Utah.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Embedded Systems John Regehr CS 5460, Dec 04. Embedded Systems  Account for >99% of new microprocessors  Consumer electronics  Vehicle control systems.
1 Efficient Memory Safety for TinyOS Nathan Cooprider Will Archer Eric Eide David Gay † John Regehr University of Utah School of Computing † Intel Research.
Scheduling for Embedded Real-Time Systems Amit Mahajan and Haibo.
Chess Review May 11, 2005 Berkeley, CA Composable Code Generation for Distributed Giotto Tom Henzinger Christoph Kirsch Slobodan Matic.
1 of 14 1/15 Schedulability Analysis and Optimization for the Synthesis of Multi-Cluster Distributed Embedded Systems Paul Pop, Petru Eles, Zebo Peng Embedded.
CS 267 Spring 2008 Horst Simon UC Berkeley May 15, 2008 Code Generation Framework for Process Network Models onto Parallel Platforms Man-Kit Leung, Isaac.
Embedded and Real Time Systems Lecture #4 David Andrews
Lock Inference for Systems Software John Regehr Alastair Reid University of Utah March 17, 2003.
Active Messages: a Mechanism for Integrated Communication and Computation von Eicken et. al. Brian Kazian CS258 Spring 2008.
Ritu Varma Roshanak Roshandel Manu Prasanna
1 Efficient Memory Safety for TinyOS 2.1 Yang Chen Nathan Cooprider Will Archer Eric Eide David Gay † John Regehr University of Utah School of Computing.
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
© Andy Wellings, 2003 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
1 of 14 1 Analysis and Synthesis of Communication-Intensive Heterogeneous Real-Time Systems Paul Pop Computer and Information Science Dept. Linköpings.
February 21, 2008 Center for Hybrid and Embedded Software Systems Mapping A Timed Functional Specification to a Precision.
1 of 14 1/15 Design Optimization of Multi-Cluster Embedded Systems for Real-Time Applications Paul Pop, Petru Eles, Zebo Peng, Viaceslav Izosimov Embedded.
Courseware Basics of Real-Time Scheduling Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens Plads, Building.
SEC PI Meeting Annapolis, May 8-9, 2001 Component-Based Design of Embedded Control Systems Edward A. Lee & Jie Liu UC Berkeley with thanks to the entire.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
Verifying Distributed Real-time Properties of Embedded Systems via Graph Transformations and Model Checking Gabor Madl
Strategic Directions in Real- Time & Embedded Systems Aatash Patel 18 th September, 2001.
Designing Predictable and Robust Systems Tom Henzinger UC Berkeley and EPFL.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
CprE 458/558: Real-Time Systems
Evolving Real-Time Systems using Hierarchical Scheduling and Concurrency Analysis John Regehr Alastair Reid Kirk Webb Michael Parker Jay Lepreau School.
BRASS Analysis of QuasiStatic Scheduling Techniques in a Virtualized Reconfigurable Machine Yury Markovskiy, Eylon Caspi, Randy Huang, Joseph Yeh, Michael.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 1.
SEC(R) 2008 Intel® Concurrent Collections for C++ - a model for parallel programming Nikolay Kurtov Software and Services.
The Design of an EDF- Scheduled Resource-Sharing Open Environment Nathan Fisher Wayne State University Marko Bertogna Scuola Superiore Santa’Anna of Pisa.
Parallel Programming Models Jihad El-Sana These slides are based on the book: Introduction to Parallel Computing, Blaise Barney, Lawrence Livermore National.
1 Efficient Type and Memory Safety for Tiny Embedded Systems John Regehr Nathan Cooprider Will Archer Eric Eide University of Utah School of Computing.
Mesos A Platform for Fine-Grained Resource Sharing in the Data Center Benjamin Hindman, Andy Konwinski, Matei Zaharia, Ali Ghodsi, Anthony Joseph, Randy.
Scheduling policies for real- time embedded systems.
Real-Time Operating Systems for Embedded Computing 李姿宜 R ,06,10.
XOberon CS Fall 2002 Dr. Abzug Jeremy Bruker Jeremy Carbaugh Jeff Hensley Drew Stockdreher.
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
XOberon Operating System CLAUDIA MARIN CS 550 Fall 2005.
Issues Autonomic operation (fault tolerance) Minimize interference to applications Hardware support for new operating systems Resource management (global.
OPERATING SYSTEM SUPPORT DISTRIBUTED SYSTEMS CHAPTER 6 Lawrence Heyman July 8, 2002.
Group 3: Architectural Design for Enhancing Programmability Dean Tullsen, Josep Torrellas, Luis Ceze, Mark Hill, Onur Mutlu, Sampath Kannan, Sarita Adve,
1 VERTAF: An Object-Oriented Application Framework for Embedded Real-Time Systems Pao-Ann Hsiung*, Trong-Yen Lee, Win-Bin See, Jih-Ming Fu, and Sao-Jie.
Actor Oriented Programming with CAL -designing embedded system components Johan Eker Department of Automatic Control, Lund University Chris Chang, Jörn.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
A Binary Agent Technology for COTS Software Integrity Anant Agarwal Richard Schooler InCert Software.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
1 of 14 1/15 Schedulability-Driven Frame Packing for Multi-Cluster Distributed Embedded Systems Paul Pop, Petru Eles, Zebo Peng Embedded Systems Lab (ESLAB)
Scheduling Messages with Deadlines in Multi-hop Real- time Sensor Networks Wei Song.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
VEST Tool Base Libraries SW OS Middleware Aspects Domain Code HW Infrastructures Product Library Composition Dependency Checks Analysis Configuration Tool.
Euro-Par, HASTE: An Adaptive Middleware for Supporting Time-Critical Event Handling in Distributed Environments ICAC 2008 Conference June 2 nd,
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
Layers Architecture Pattern Source: Pattern-Oriented Software Architecture, Vol. 1, Buschmann, et al.
Embedded System Design and Development Introduction to Embedded System.
Real-Time Operating Systems RTOS For Embedded systems.
 Operating system.  Functions and components of OS.  Types of OS.  Process and a program.  Real time operating system (RTOS).
Sub-fields of computer science. Sub-fields of computer science.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Lazy Preemption to Enable Path-Based Analysis of Interrupt-Driven Code
Hierarchical Architecture
An Introduction to Software Architecture
Modeling Event-Based Systems in Ptolemy II EE249 Project Status Report
Presentation transcript:

Principles and Pragmatics for Embedded Systems John Regehr University of Utah

Hierarchical Loadable Schedulers Theme: Appropriate, checkable abstractions for systems software Secure, large- scale embedded systems? Composable Execution Environments

Embedded Systems  Account for ~100% of new microprocessors  Consumer electronics  Vehicle control systems  Medical equipment  Smart dust

Embedded Software Goals Memory Lock Time Safe Efficient Reusable Easy to develop Functionally correct Minimal Memory use CPU use Power use Composable Late binding Debuggable Testable Problem specific

Analyses Time Safety Stack Size Race Detection Lock Inference … Optimizations Thread Minimization Robust Scheduling Lock Elimination Inlining … Binding CEE – Composable Execution Environments Infrastructure and metadata ErrorComposed System

Why CEE?  Systems are in the real world  Hard to reach  Safety critical  Time is money  Space is money  Reuse is critical  Within a product line  Between generations of products

Embedded Platforms RAM 1 B1 KB1 MB1 GB 4- and 8-bit 16-bit 32- and 64-bit No OS Real-Time OS (RTOS) GPOS CPU Type OS Type

CEE Main Ideas  Composition of restricted execution environments  Global analyses and optimizations  Late binding of requirements to implementations

Execution Environment  Set of  Idioms and abstractions for structuring software  Rules for sequencing actions  Rules for sharing information  Examples  Low-level: Cyclic executive, interrupts, threads, event loop  High-level: Dataflow graph, time triggered system, hierarchical state machines

Bad News  Environments have rules  Interacting environments have rules  Getting these right is a serious problem  Rules not usually checked

Good News  Diversity can be exploited  To create efficient systems  To match design problems  Constrained environments are easier to analyze, debug, and understand

Execution Environments  Embedded systems contain multiple execution environments  CEE exploits the benefits of multiple environments while mitigating the problems  Local analyses  Global analyses

Other Frameworks for Embedded Software  Cadena – Hatcliff et al., Kansas State  Koala – Van Ommering, Philips  MetaH – Vestal, Honeywell  nesC – Gay et al., Intel & Berkeley  Ptolemy II – Lee et al., Berkeley  Vest – Stankovic et al., Virginia

Motivation and Introduction Concurrency Analysis Real-Time Analysis Summary and Conclusion

Concurrency  Embedded systems are fundamentally concurrent  Interrupt-driven  Response-time requirements  Concurrency is hard  Especially when using components  Especially when components span multiple execution environments

Task Scheduler Logic (TSL)  First-order logic with extra relations and axioms  Formalizes locking concerns across execution environments

TSL Capabilities  Find races and other errors  Generate mapping from each critical section in a system to an appropriate lock  Lock inference

Why Infer Locks?  Locking rules are hard to learn, hard to get right  Sometimes no lock is needed  Components can be agnostic with respect to execution environments  Global side effects can be managed

TSL Prerequisites  Visible critical sections and resources  Safe approximation of call graph  TSL specifications for schedulers

Using TSL  Developers connect components as usual  No direct contact with TSL  Run TSL analysis at build time  Success – Return assignment of lock implementations to critical sections  Used to generate code  Failure – Return list of preemption relations that cause races

TSL Concepts  Tasks – units of computation  Asymmetric preemption  A « B means “B may preempt A”  Schedulers  S ◄ B means “S schedules B”  Locks  S  L means “S provides L”  A « L B means “B may preempt A while A holds L”

Resources and Races  Resources  A → L R means “A holds L while accessing R”  Race (A, B, R) = A → L1 R  B → L2 R  A  B  A « L1  L2 B

Specifying Schedulers  Non-preemptive  Generic preemptive  Priority S AB  (A « B)   (B « A) S (t, t 0, …, t n ) =  i. t◄t i

Specifying Schedulers  Non-preemptive  Generic preemptive  Priority S AB (A « B)  (B « A) S (t, t 0, …, t n, L) =  i. t◄t i   i,j. t i «  t j   l  L. t  l

Specifying Schedulers  Non-preemptive  Generic preemptive  Priority S AB  (A « B)  (B « A) S (t, t 0, …, t n, L) =  i. t◄t i   i,j. i<j  t i «  t j   l  L. t  l H L

INT IRQ Event Timer Network E1E2E3 H L

INT IRQ Timer Network Event1 E1 E2 E3 Event2 THREAD H H L L

Applying TSL  Applied to embedded monitoring system with web interface  116 components  1059 functions  5 tasks  2 kinds of locks + null lock

TSL Summary  Contributions  Reasoning about concurrency across execution environments  Automated lock inference  In ACP4IS 2003  Future work: Optimal lock inference  Minimize run-time overhead  Maximize chances of meeting real- time deadlines

Motivation and Introduction Concurrency Analysis Real-Time Analysis Summary and Conclusion

Real-Time Constraints  Examples  Deploy multiple airbags no more than 5 ms after collision  Compute flap position 100 times per second

Real-Time Analysis  Output  Success:  Static guarantee that deadlines will be met  A schedule (priority assignment)  Failure:  List of tasks not guaranteed to meet deadlines  Tasks with hard-wired priorities do not compose well

Previous Example INT IRQ Timer Network Event1 E1 E2 E3 Event2 THREAD H L H L

An Improvement INT IRQ Timer Network E1 E2E3 V-Sched HL

Virtual Schedulers  Start with collection of real-time tasks  Insert only enough preemption to permit deadlines to be met  Support mutually non-preemptible collections of tasks  Existing real-time theory not good enough

Background  Preemption threshold scheduling (Saksena and Wang 2000)  Supports mixing preemptive and non-preemptive scheduling  But only as a back-end optimization  My work: make mixed preemption first- class

New Abstractions  Task clusters  Embed non- preemptive EEs in a system  Task barriers  Respect architectural constraints

Scheduling Algorithm 1  Target is standard RTOS – no support for preemption thresholds  Three-level algorithm  Outer: iterate over partitions created by task barriers  Middle: iterate over clusters within a partition  Inner: iterate over tasks within a cluster  Requires O(n 2 ) priority assignments to be tested

Scheduling Algorithm 2  Target is RTOS that supports preemption thresholds  More degrees of freedom  Known optimal algorithms test O(n!) priority assignments  Use hill-climbing algorithm that attempts to minimize maximum lateness over all tasks  Works well in practice

Avionics Application  Avionics task set from Tindell et al. (1994) with 17 tasks and two locks  Both locks can be eliminated using task clusters  Only 5 threads are needed

Ping / Pong App on Motes versioncodedataPin-IntInt-TaskTask-Task Default5022 B232 B11.3 μs22.5 μs16.0 μs CEE6094 B448 B11.3 μs46.7 μs45.2 μs

Real-Time Summary  Contributions: Task clusters and task barriers  Better abstractions to protect developers from multithreading  Permit embedding of non-preemptive execution environments  In RTSS 2002

Motivation and Introduction Concurrency Analysis Real-Time Analysis Summary and Conclusion

Status and Ongoing Work  Tools exist  Checker for task scheduler logic  SPAK – real-time analysis  Stacktool – bound stack depth  Flatten – parameterizable inlining  Prototype CEE implementations  Large systems: PCs with Knit + OSKit  Small systems: Motes

Summary  CEE is a new framework for embedded software  Exploits qualities of the domain  Supports late binding  Basis for pluggable analyses and optimizations  Effective compromise between principles and pragmatics  NSF Embedded and Hybrid Systems 2002–2005

Hierarchical Loadable Schedulers Theme: Appropriate, checkable abstractions for systems software Secure, large- scale embedded systems? Composable Execution Environments

Thanks to…  Alastair Reid, Jay Lepreau, Eric Eide, and Kirk Webb

More info and papers here: