Embedded Software: Leveraging Concurrent Models of Computation Edward A. Lee Professor, UC Berkeley Center for Hybrid and Embedded Software Systems (CHESS)

Slides:



Advertisements
Similar presentations
Programming Languages for End-User Personalization of Cyber-Physical Systems Presented by, Swathi Krishna Kilari.
Advertisements

Undoing the Task: Moving Timing Analysis back to Functional Models Marco Di Natale, Haibo Zeng Scuola Superiore S. Anna – Pisa, Italy McGill University.
Sensor Network Platforms and Tools
MotoHawk Training Model-Based Design of Embedded Systems.
Topic 2: Balance between formal and informal methods, engineering and artistry, evolution and rebuild Edward A. Lee Professor UC Berkeley Center for Hybrid.
Model for Supporting High Integrity and Fault Tolerance Brian Dobbing, Aonix Europe Ltd Chief Technical Consultant.
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
Event Driven Real-Time Programming CHESS Review University of California, Berkeley, USA May 10, 2004 Arkadeb Ghosal Joint work with Marco A. Sanvido, Christoph.
Chapter 13 Embedded Systems
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
Chess Review May 8, 2003 Berkeley, CA Classes and Inheritance in Actor- Oriented Models Stephen Neuendorffer Edward Lee UC Berkeley.
Advanced Tool Architectures Supporting Interface-Based Design
Integrated Design and Analysis Tools for Software-Based Control Systems Shankar Sastry (PI) Tom Henzinger Edward Lee University of California, Berkeley.
NSF Foundations of Hybrid and Embedded Software Systems UC Berkeley: Chess Vanderbilt University: ISIS University of Memphis: MSI A New System Science.
February 21, 2008 Center for Hybrid and Embedded Software Systems Organization Board of Directors Edward A. Lee, UC Berkeley.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 Leveraging Synchronous Language Principles for Hybrid System Models Haiyang Zheng and.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley Behavioral Types for Actor-Oriented Design Edward A. Lee.
Behavioral Types as Interface Definitions for Concurrent Components Center for Hybrid and Embedded Software Systems Edward A. Lee Professor UC Berkeley.
Building Unreliable Systems out of Reliable Components: The Real Time Story Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS CHESS: Center.
Understandable and Scalable Concurrency Christopher Brooks Programmer/Analyst, University of California, Berkeley Edward A. Lee Robert S. Pepper Distinguished.
February 11, 2010 Center for Hybrid and Embedded Software Systems Ptolemy II - Heterogeneous Concurrent Modeling and Design.
Causality Interface  Declares the dependency that output events have on input events.  D is an ordered set associated with the min ( ) and plus ( ) operators.
Chess Review October 4, 2006 Alexandria, VA Edited and presented by Advanced Tool Architectures Edward A. Lee UC Berkeley.
Are “Embedded Systems" Just Systems Made with Small Computers? Chess: Center for Hybrid and Embedded Software Systems Invited Talk Artist International.
Review of “Embedded Software” by E.A. Lee Katherine Barrow Vladimir Jakobac.
The Case for Precision Timed (PRET) Machines Edward A. Lee Professor, Chair of EECS UC Berkeley With thanks to Stephen Edwards, Columbia University. National.
Lock Inference for Systems Software John Regehr Alastair Reid University of Utah March 17, 2003.
Building Unreliable Systems out of Reliable Components: The Real Time Story Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS CHESS: Center.
Chapter 13 Embedded Systems
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 Cyber-Physical Systems: A Vision of the Future Edward A. Lee Robert S. Pepper Distinguished.
Understandable Concurrency Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS Director, CHESS: Center for Hybrid and Embedded Software Systems.
NSF Foundations of Hybrid and Embedded Software Systems UC Berkeley: Chess Vanderbilt University: ISIS University of Memphis: MSI A New System Science.
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.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley Concurrent Component Patterns, Models of Computation, and.
MoBIES Working group meeting, September 2001, Dearborn Ptolemy II The automotive challenge problems version 4.1 Johan Eker Edward Lee with thanks.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 PTIDES: A Programming Model for Time- Synchronized Distributed Real-time Systems Yang.
5 th Biennial Ptolemy Miniconference Berkeley, CA, May 9, 2003 The Component Interaction Domain: Modeling Event-Driven and Demand- Driven Applications.
Embedded Software Challenges for the Next 10 Years Chess: Center for Hybrid and Embedded Software Systems Infineon Embedded Software Days Munich, Sept.
Panel: What Comes After C++ in System-Level Specification Edward Lee UC Berkeley Forum on Design Languages Workshop on System Specification & Design Languages.
Model-Driven Development From Object-Oriented Design to Actor-Oriented Design Chess: Center for Hybrid and Embedded Software Systems Edward A. Lee Professor.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley The Ptolemy II Framework for Visual Languages Xiaojun Liu.
Embedded Software: Building the Foundations Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS CHESS: Center for Hybrid and Embedded Software.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
1 Correct and efficient implementations of synchronous models on asynchronous execution platforms Stavros Tripakis UC Berkeley and Verimag EC^2 Workshop,
Voicu Groza, 2008 SITE, HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS Hardware/Software Codesign of Embedded Systems Voicu Groza SITE Hall, Room.
EEL Software development for real-time engineering systems.
Modeling Component-based Software Systems with UML 2.0 George T. Edwards Jaiganesh Balasubramanian Arvind S. Krishna Vanderbilt University Nashville, TN.
Performance evaluation of component-based software systems Seminar of Component Engineering course Rofideh hadighi 7 Jan 2010.
C. André, J. Boucaron, A. Coadou, J. DeAntoni,
Conformance Test Experiments for Distributed Real-Time Systems Rachel Cardell-Oliver Complex Systems Group Department of Computer Science & Software Engineering.
Unified Modeling Language. Object Oriented Methods ► What are object-oriented (OO) methods?  OO methods provide a set of techniques for analyzing, decomposing,
Design Languages in 2010 Chess: Center for Hybrid and Embedded Software Systems Edward A. Lee Professor UC Berkeley Panel Position Statement Forum on Design.
Actor Networks Edward A. Lee Robert S. Pepper Distinguished Professor Chair of EECS UC Berkeley Invited Talk Workshop Foundations and Applications of Component-based.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
What’s Ahead for Embedded Software? (Wed) Gilsoo Kim
System Architecture Directions for Networked Sensors.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
The Future of Embedded Software Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS UC Berkeley ARTEMIS 2006 Annual Conference Graz, Austria.
February 14, 2013 Center for Hybrid and Embedded Software Systems Organization Faculty Edward A. Lee, EECS Alberto Sangiovanni-Vincentelli,
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
TRUST:Team for Research in Ubiquitous Secure Technologies
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Retargetable Model-Based Code Generation in Ptolemy II
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Embedded Operating Systems
Modeling Event-Based Systems in Ptolemy II EE249 Project Status Report
Presentation transcript:

Embedded Software: Leveraging Concurrent Models of Computation Edward A. Lee Professor, UC Berkeley Center for Hybrid and Embedded Software Systems (CHESS) Citris Information Days June 30 – July 1, 2004 Infineon, Munich, Germany

Lee, Berkeley 2 Are Resource Limitations the Key Defining Factor for Embedded Software? small memory small data word sizes relatively slow clocks To deal with these problems, emphasize efficiency: write software at a low level (in assembly code or C) avoid operating systems with a rich suite of services develop specialized computer architectures programmable DSPs network processors This is how embedded SW has been designed for 25 years

Lee, Berkeley 3 Why hasn’t Moore’s law changed all this in 25 years?

Lee, Berkeley 4 Hints that Embedded SW Differs Fundamentally from General Purpose SW object-oriented techniques are rarely used classes and inheritance dynamic binding processors avoid memory hierarchy virtual memory dynamically managed caches memory management is avoided allocation/de-allocation garbage collection To be fair, there are some applications: e.g. Java in cell phones, but mainly providing the services akin to general purpose software.

Lee, Berkeley 5 More Hints: Fundamentally Different Techniques Applied to Embedded SW. nesC/TinyOS developed for programming very small programmable sensor nodes called “motes” Click created to support the design of software-based network routers Simulink with Real-Time Workshop created for embedded control software and widely used in the automotive industry Lustre/SCADE created for safety-critical embedded software (e.g. avionics software) method-call models of computation actor-oriented models of computation

Lee, Berkeley 6 Standard Software Abstraction (20-th Century Computation) initial state final state sequence f : State  State Time is irrelevant All actions are ordered Alan Turing

Lee, Berkeley 7 Standard Software Abstraction: Processes or Threads suspend Infinite sequences of state transformations are called “processes” or “threads” The operating system (typically) provides: suspend/resume mutual exclusion semaphores resume

Lee, Berkeley 8 stalled for rendezvous stalled by precedence race condition Standard Software Abstraction: Concurrency via Interacting Threads Potential for race conditions, deadlock, and livelock severely compromises software reliability. These methods date back to the 1960’s (Dijkstra).

Lee, Berkeley 9 A Stake in the Ground Nontrivial concurrent programs based on processes, threads, semaphores, and mutexes are incomprehensible to humans, and should not be used in safety critical software. No amount of software engineering process is going to solve this problem. the human brain doesn’t work this way. Formal methods may help scalability? understandability? Better concurrency abstractions will help more four promising examples: nesC/TinyOS, Click, Lustre/SCADE, and Simulink.

Lee, Berkeley 10 Alternative Concurrency Models: First example: nesC and TinyOS Component 1 interface used interface provided Component 2 interface used interface provided command invoked command implemented event signaled event handled Typical usage pattern: hardware interrupt signals an event. event handler posts a task. tasks are executed when machine is idle. tasks execute atomically w.r.t. one another. tasks can invoke commands and signal events. hardware interrupts can interrupt tasks. exactly one monitor, implemented by disabling interrupts. Command implementers can invoke other commands or post tasks, but do not trigger events.

Lee, Berkeley 11 Alternative Concurrency Models: Second example: Click Implementation of Click with a visual syntax in Mescal (Keutzer, et al.) push output port push input port pull output port agnostic output port Typical usage pattern: queues have push input, pull output. schedulers have pull input, push output. thin wrappers for hardware have push output or pull input only.

Lee, Berkeley 12 Observations about nesC/TinyOS & Click Very low overhead Bounded stack sizes No (unintended) race conditions No threads or processes Access to timers Can create thin wrappers around hardware But rather specialized Unfamiliar to programmers No preemption (tasks must be decomposed)

Lee, Berkeley 13 Alternative Concurrency Models: Third example: Lustre/SCADE from Typical usage pattern: specify tasks aligned to a master “clock” and subclocks clock calculus checks for consistency and deadlock decision logic is given with hierarchical state machines. synchronous signal value state machine giving decision logic

Lee, Berkeley 14 Observations about Lustre/SCADE Very low overhead Bounded stack sizes No (unintended) race conditions No threads or processes Verifiable (finite) behavior Certified compiler (for use in avionics) But rather specialized Unfamiliar to programmers No preemption No time

Lee, Berkeley 15 The Real-Time Problem Programming languages have no time in their core semantics Temporal properties are viewed as “non-functional” Precise timing is poorly supported by hardware architectures Operating systems provide timed behavior on a best-effort basis (e.g. using priorities). Priorities are widely misused in practice

Lee, Berkeley 16 Alternative Concurrency Models: Fourth example: Simulink Typical usage pattern: model the continuous dynamics of the physical plant model the discrete-time controller code generate the discrete-time controller continuous-time signal Discrete signals semantically are piecewise constant. Discrete blocks have periodic execution with a specified “sample time.”

Lee, Berkeley 17 Observations about Simulink Bounded stack sizes Deterministic (no race conditions) Timing behavior is explicitly given Efficient code generator (for periodic discrete-time) Supports concurrent tasks No threads or processes visible to the programmer But cleverly leverages threads in an underlying O/S. But rather specialized Periodic execution of all blocks Accurate schedulability analysis is difficult

Lee, Berkeley 18 Two Distinct Component Interaction Mechanisms Actor oriented: actor name data (state) ports Input data parameters Output data What flows through an object is streams of data class name data methods call return What flows through an object is sequential control Method-call based: nesC/TinyOS Click Lustre/SCADE Simulink

Lee, Berkeley 19 Terminology Problem Of these, only nesC is recognized as a “programming language.” I will call them “platforms” A platform is a set of possible designs: the set of all nesC/TinyOS programs the set of all Click configurations the set of all SCADE designs the set of all Simulink block diagrams

Lee, Berkeley 20 Abstraction These four “platforms” offer distinct alternative abstractions (models of computation). They are highly concurrent, and very different from the traditional threads and processes. Three paintings by Piet Mondrian

Lee, Berkeley 21 How Many More (Useful) Models of Computation Are There? Here are a few actor-oriented platforms: Labview (synchronous dataflow) Modelica (continuous-time, constraint-based) CORBA event service (distributed push-pull) SPW (synchronous dataflow) OPNET (discrete events) VHDL, Verilog (discrete events) SDL (process networks) …

Lee, Berkeley 22 Many Variants – Consider Dataflow Alone: Computation graphs [Karp & Miller ] Process networks [Kahn ] Static dataflow [Dennis ] Dynamic dataflow [Arvind, 1981] K-bounded loops [Culler, 1986] Synchronous dataflow [Lee & Messerschmitt, 1986] Structured dataflow [Kodosky, 1986] PGM: Processing Graph Method [Kaplan, 1987] Synchronous languages [Lustre, Signal, 1980’s] Well-behaved dataflow [Gao, 1992] Boolean dataflow [Buck and Lee, 1993] Multidimensional SDF [Lee, 1993] Cyclo-static dataflow [Lauwereins, 1994] Integer dataflow [Buck, 1994] Bounded dynamic dataflow [Lee and Parks, 1995] Heterochronous dataflow [Girault, Lee, & Lee, 1997] … Many tools, software frameworks, and hardware architectures have been built to support one or more of these.

Lee, Berkeley 23 How to Choose a Platform: Tools Focus Is this a good tool? How easy is it to use? How well supported is it? Does it run fast? These are the Secondary Questions!

Lee, Berkeley 24 How to Choose a Platform: Abstraction Focus Is this a good way to do design? Does it express the important properties of a design? Does it support abstraction and modularity? Do the design abstractions scale? Can it compile/code generate to cost-effective solutions? Are designs built using it understandable/analyzable? These are the Primary Questions!

Lee, Berkeley 25 The Meta Question How can we objectively evaluate the alternatives?

Lee, Berkeley 26 Meta Platforms Supporting Multiple Models of Computation Ptolemy Classic and Ptolemy II (UC Berkeley) GME (Vanderbilt) Metropolis (UC Berkeley) ROOM (Rational) SystemC (Synopsys and others) To varying degrees, each of these provides an abstract semantics that gets specialized to deliver a particular model of computation. ROOM is evolving into an OMG standard (composite structures in UML 2)

Lee, Berkeley 27 Conclusion Embedded software is an immature technology Focus on “platforms” not “languages” Platforms have to: expose hardware (with thin wrappers) embrace time in the core semantics embrace concurrency in the core semantics API’s over standard SW methods won’t do Ask about the “abstractions” not the “tools” Many questions remain…