Time for High-Confidence Cyber-Physical Systems

Slides:



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

Sungjun Kim Columbia University Edward A. Lee UC Berkeley
SE-292 High Performance Computing
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Leveraging Synchronized Clocks in Distributed Applications Edward A. Lee Robert S. Pepper Distinguished Professor UC Berkeley Swarm Lab Retreat January.
Time for High-Confidence Distributed Embedded Systems Edward Ashford Lee Robert S. Pepper Distinguished Professor UC Berkeley Invited keynote talk IEEE.
Lecture 1: Introduction II EEN 112: Introduction to Electrical and Computer Engineering Professor Eric Rozier, 1/16/2013.
Predictable Programming on a Precision Timed Architecture Hiren D. Patel UC Berkeley Joint work with: Ben Lickly, Isaac Liu, Edward.
PTIDES Project Overview
Overview of PTIDES Project
Timing Analysis of Embedded Software for Families of Microarchitectures Jan Reineke, UC Berkeley Edward A. Lee, UC Berkeley Representing Distributed Sense.
2/11/2010 BEARS 2010 On PTIDES Programming Model John Eidson Jeff C. Jensen Edward A. Lee Slobodan Matic Jia Zou PtidyOS.
Software Engineering for Real- Time: A Roadmap H. Kopetz. Technische Universitat Wien, Austria Presented by Wing Kit Hor.
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
Integrated Design and Analysis Tools for Software-Based Control Systems Shankar Sastry (PI) Tom Henzinger Edward Lee University of California, Berkeley.
IEEE International Symposium on Distributed Simulation and Real-Time Applications October 27, 2008 Vancouver, British Columbia, Canada Presented by An.
Vertically Integrated Analysis and Transformation for Embedded Software John Regehr University of Utah.
CS599 Software Engineering for Embedded Systems1 Software Engineering for Real-Time: A Roadmap Presentation by: Mandar Samant Raghbir Singh Banwait.
April 16, 2009 Center for Hybrid and Embedded Software Systems PtidyOS: An Operating System based on the PTIDES Programming.
Causality Interface  Declares the dependency that output events have on input events.  D is an ordered set associated with the min ( ) and plus ( ) operators.
8th Biennial Ptolemy Miniconference Berkeley, CA April 16, 2009 Precision Timed (PRET) Architecture Hiren D. Patel, Ben Lickly, Isaac Liu and Edward A.
Is Truly Real-Time Computing Becoming Unachievable? Edward A. Lee Robert S. Pepper Distinguished Professor and Chair of EECS, UC Berkeley Keynote Talk.
Chess Review May 11, 2005 Berkeley, CA Composable Code Generation for Distributed Giotto Tom Henzinger Christoph Kirsch Slobodan Matic.
OPERATING SYSTEM OVERVIEW
The Case for Precision Timed (PRET) Machines Edward A. Lee Professor, Chair of EECS UC Berkeley With thanks to Stephen Edwards, Columbia University. National.
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.
State Machines Timing Computer Bus Computer Performance Instruction Set Architectures RISC / CISC Machines.
February 21, 2008 Center for Hybrid and Embedded Software Systems Mapping A Timed Functional Specification to a Precision.
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.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 PTIDES: A Programming Model for Time- Synchronized Distributed Real-time Systems Yang.
Strategic Directions in Real- Time & Embedded Systems Aatash Patel 18 th September, 2001.
Designing Predictable and Robust Systems Tom Henzinger UC Berkeley and EPFL.
EMBEDDED SOFTWARE Team victorious Team Victorious.
1 Instant replay  The semester was split into roughly four parts. —The 1st quarter covered instruction set architectures—the connection between software.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
1 Fault Tolerance in the Nonstop Cyclone System By Scott Chan Robert Jardine Presented by Phuc Nguyen.
Tufts University School Of Engineering Tufts Wireless Laboratory TWL Direction Almir Davis 09/28/20091.
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE 498AL, University of Illinois, Urbana-Champaign 1 Basic Parallel Programming Concepts Computational.
Model-Based Embedded Real- Time Software Development Dionisio de Niz and Raj Rajkumar Real-Time and Multimedia Sys Lab Carnegie Mellon University.
I/O Computer Organization II 1 Interconnecting Components Need interconnections between – CPU, memory, I/O controllers Bus: shared communication channel.
The 14 th IEEE Real-Time and Embedded Technology and Applications Symposium, April 2008 Real-Time Distributed Discrete-Event Execution with Fault Tolerance.
1: Operating Systems Overview 1 Jerry Breecher Fall, 2004 CLARK UNIVERSITY CS215 OPERATING SYSTEMS OVERVIEW.
IMPACT OF CACHE PARTITIONING ON MULTI-TASKING REAL TIME EMBEDDED SYSTEMS Presentation by: Eric Magil Research by: Bach D. Bui, Marco Caccamo, Lui Sha,
System-level power analysis and estimation September 20, 2006 Chong-Min Kyung.
By Edward A. Lee, J.Reineke, I.Liu, H.D.Patel, S.Kim
CSCI1600: Embedded and Real Time Software Lecture 33: Worst Case Execution Time Steven Reiss, Fall 2015.
Real-Time Systems, Events, Triggers. Real-Time Systems A system that has operational deadlines from event to system response A system whose correctness.
ECE 720T5 Fall 2011 Cyber-Physical Systems Rodolfo Pellizzoni.
Real-time aspects Bernhard Weirich Real-time Systems Real-time systems need to accomplish their task s before the deadline. – Hard real-time:
Real-Time Operating System Design
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Agenda  Quick Review  Finish Introduction  Java Threads.
February 12, 2009 Center for Hybrid and Embedded Software Systems Timing-aware Exceptions for a Precision Timed (PRET)
Ptolemy Project Vision Edward A. Lee Robert S. Pepper Distinguished Professor Eighth Biennial Ptolemy Miniconference April 16, 2009 Berkeley, CA, USA.
ECE 720T5 Winter 2014 Cyber-Physical Systems Rodolfo Pellizzoni.
February 11, 2016 Center for Hybrid and Embedded Software Systems Organization Faculty Edward A. Lee, EECS Alberto Sangiovanni-Vincentelli,
February 14, 2013 Center for Hybrid and Embedded Software Systems Organization Faculty Edward A. Lee, EECS Alberto Sangiovanni-Vincentelli,
ARTEMIS SRA 2016 Trust, Security, Robustness, and Dependability Dr. Daniel Watzenig ARTEMIS Spring Event, Vienna April 13, 2016.
A Precision Timed Architecture for Predictable and Repeatable Timing
Hiren D. Patel Isaac Liu Ben Lickly Edward A. Lee
Shanna-Shaye Forbes Ben Lickly Man-Kit Leung
Timing-aware Exceptions for a Precision Timed (PRET) Target
An overview of the CHESS Center
Architectures of distributed systems Fundamental Models
Architectures of distributed systems Fundamental Models
An overview of the CHESS Center
Operating System Overview
Presentation transcript:

Time for High-Confidence Cyber-Physical Systems Edward A. Lee April 23, 2017 Time for High-Confidence Cyber-Physical Systems Key Collaborators on work shown here: Steven Edwards Jeff Jensen Sungjun Kim Isaac Liu Slobodan Matic Hiren Patel Jan Reinke Sanjit Seshia Mike Zimmer Jia Zou Edward A. Lee Robert S. Pepper Distinguished Professor UC Berkeley Invited Plenary Talk Performance Metrics for Intelligent Systems (PerMIS'12) Workshop University of Maryland March 20-22, 2012.

Edward A. Lee Cyber-Physical Systems (CPS): Orchestrating networked computational resources with physical systems April 23, 2017 Transportation (Air traffic control at SFO) Avionics Building Systems Telecommunications Automotive Instrumentation (Soleil Synchrotron) E-Corner, Siemens Factory automation Power generation and distribution Daimler-Chrysler Military systems: Courtesy of General Electric Courtesy of Doug Schmidt Courtesy of Kuka Robotics Corp.

Claim For CPS, programs do not adequately specify behavior. Corollary: Performance of program execution may not be a good metric.

A Story The Boeing 777 was Boeing’s first fly-by-wire aircraft, controlled by software. It is deployed, appears to be reliable, and is succeeding in the marketplace. Therefore, it must be a success. However… Boeing was forced to purchase and store an advance supply of the microprocessors that will run the software, sufficient to last for the estimated 50 year production run of the aircraft and another many years of maintenance. Why?

Lesson from this example: Apparently, the software does not specify the behavior that has been validated and certified! Unfortunately, this problem is very common, even with less safety-critical, certification-intensive applications. Validation is done on complete system implementations, not on software.

Structure of a Cyber-Physical System Etc… Problems that complicate analysis of system behavior: Plat Platforms’ measurements of time differ Messages from different sources interleave nondeterministically Sensors may be locked out for an indeterminate amount of time A fault in a remote component may disrupt a critical local activity Variability of execution times affects results (not just WCET) A fault in a remote component may go undetected for a long time Interrupt-driven I/O disrupts timing

A Key Challenge: Timing is not Part of Software Semantics Correct execution of a program in C, C#, Java, Haskell, OCaml, etc. has nothing to do with how long it takes to do anything. All our computation and networking abstractions are built on this premise. Programmers have to step outside the programming abstractions to specify timing behavior.

The first edition of Hennessy and Patterson (1990) revolutionized the field of computer architecture by making performance metrics the dominant criterion for design. Today, for computers, timing is merely a performance metric. It needs to be a correctness criterion.

Execution-time analysis, by itself, does not solve the problem! Our first goal is to reduce the problem so that this is the only hard part. Analyzing software for timing behavior requires: • Paths through the program (undecidable) • Detailed model of microarchitecture • Detailed model of the memory system • Complete knowledge of execution context • Many constraints on preemption/concurrency • Lots of time and effort And the result is valid only for that exact hardware and software! Fundamentally, the ISA of the processor has failed to provide an adequate abstraction. Wilhelm, et al. (2008). "The worst-case execution-time problem - overview of methods and survey of tools." ACM TECS 7(3): p1-53.

+ = PRET Part 1: PRET Machines PREcision-Timed processors = PRET Predictable, REpeatable Timing = PRET Performance with REpeatable Timing = PRET // Perform the convolution. for (int i=0; i<10; i++) { x[i] = a[i]*b[j-i]; // Notify listeners. notify(x[i]); } + = PRET Computing With time

Dual Approach Rethink the ISA Timing has to be a correctness property not a performance property. Implementation has to allow for multiple realizations and efficient realizations of the ISA Repeatable execution times Repeatable memory access times

Example of one sort of mechanism we would like: jmp_buf buf; if ( !setjmp(buf) ){ set_time r1, 500ms exception_on_expire r1, 0 // Code block deactivate_exception 0 } else { panic(); } exception_handler_0 () { longjmp(buf) tryin (500ms) { // Code block } catch { panic(); } If the code block takes longer than 500ms to run, then the panic() procedure will be invoked. But then we would like to verify that panic() is never invoked! Pseudocode showing how this might be implemented today. The result is very platform dependent.

Extending an ISA with Timing Semantics [V3] Immediate miss detection [V1] Best effort: set_time r1, 1s exception_on_expire r1, 1 // Code block deactivate_exception 1 delay_until r1 set_time r1, 1s // Code block delay_until r1 [V2] Late miss detection [V4] Exact execution: set_time r1, 1s // Code block branch_expired r1, <target> delay_until r1 set_time r1, 1s // Code block MTFD r1

To provide timing guarantees, we need implementations that deliver repeatable timing Fortunately, electronics technology delivers highly reliable and precise timing… … but the overlaying software abstractions discard it. Chip architects heavily exploit the lack of temporal semantics. // Perform the convolution. for (int i=0; i<10; i++) { x[i] = a[i]*b[j-i]; // Notify listeners. notify(x[i]); }

To deliver repeatable timing, we have to rethink the microarchitecture Challenges: Pipelining Memory hierarchy I/O (DMA, interrupts) Power management (clock and voltage scaling) On-chip communication Resource sharing (e.g. in multicore)

Our Current PRET Architecture PTArm, a soft core on a Xilinx Virtex 5 and 6 FPGA memory memory memory Hardware thread scratch pad memory Hardware thread Hardware thread Hardware thread I/O devices registers Interleaved pipeline with one set of registers per thread SRAM scratchpad shared among threads DRAM main memory, separate banks per thread

Status of the PRET project Results: PTArm implemented on Xilinx Virtex 5 FPGA. UNISIM simulator of the PTArm facilitates experimentation. DRAM controller with repeatable timing and DMA support. PRET-like utilities implemented on COTS Arm. Much still to be done: Realize MTFD, interrupt I/O, compiler toolchain, scratchpad management, etc.

A Key Next Step: Parametric PRET Architectures set_time r1, 1s // Code block MTFD r1 ISA that admits a variety of implementations: Variable clock rates and energy profiles Variable number of cycles per instruction Latency of memory access varying by address Varying sizes of memory regions … A given program may meet deadlines on only some realizations of the same parametric PRET ISA.

Realizing the MTFD instruction on a parametric PRET machine set_time r1, 1s // Code block MTFD r1 The goal is to make software that will run correctly on a variety of implementations of the ISA, and that correctness can be checked for each implementation.

PRET Publications http://chess.eecs.berkeley.edu/pret/ S. Edwards and E. A. Lee, "The Case for the Precision Timed (PRET) Machine," in the Wild and Crazy Ideas Track of DAC, June 2007. B. Lickly, I. Liu, S. Kim, H. D. Patel, S. A. Edwards and E. A. Lee, “Predictable programming on a precision timed architecture,” CASES 2008. S. Edwards, S. Kim, E. A. Lee, I. Liu, H. Patel and M. Schoeberl, “A Disruptive Computer Design Idea: Architectures with Repeatable Timing,” ICCD 2009. D. Bui, H. Patel, and E. Lee, “Deploying hard real-time control software on chip-multiprocessors,” RTCSA 2010. Bui, E. A. Lee, I. Liu, H. D. Patel and J. Reineke, “Temporal Isolation on Multiprocessing Architectures,” DAC 2011. J. Reineke, I. Liu, H. D. Patel, S. Kim, E. A. Lee, PRET DRAM Controller: Bank Privatization for Predictability and Temporal Isolation (to appear), CODES+ISSS, Taiwan, October, 2011. S. Bensalem, K. Goossens, C. M. Kirsch, R. Obermaisser, E. A. Lee, J. Sifakis, Time-Predictable and Composable Architectures for Dependable Embedded Systems, Tutorial Abstract (to appear), EMSOFT, Taiwan, October, 2011

Part 2: How to get the Source Code? The input (mostly likely C) will ideally be generated from a model, like Simulink or SCADE. The model specifies temporal behavior at a higher level than code blocks, and it specifies a concurrency model that can limit preemption points. However, Simulink and SCADE have naïve models of time.

Messages carry time stamps that define their interleaving Ptides: Programming model for distributed real-time systems, using time-stamped messages. Messages carry time stamps that define their interleaving

A CPS Problem and Potential Ptides Application: Printing Press Application aspects local (control) distributed (coordination) global (modes) Open standards (Ethernet) Synchronous, Time-Triggered IEEE 1588 time-sync protocol High-speed, high precision Speed: 1 inch/ms Precision: 0.01 inch -> Time accuracy: 10us Bosch-Rexroth Goal: Orchestrated networked resources built with sound design principles on suitable abstractions

Example – Flying Paster paper feed mechanism followed by several offset-printing rollers in turn followed by units that cut, fold, and bundle the output Source: http://offsetpressman.blogspot.com/2011/03/how-flying-paster-works.html

Source: http://offsetpressman. blogspot Flying Paster

What this needs is correct timing, not high performance. Simulation Oscilloscope traces on GPIO pins Renesas XMOS

We have demonstrated platform independent timing for programs automatically generated from model. Simulation Oscilloscope traces on GPIO pins Renesas XMOS

Ptides Publications http://chess.eecs.berkeley.edu/ptides/ Y. Zhao, J. Liu, E. A. Lee, “A Programming Model for Time-Synchronized Distributed Real-Time Systems,” RTAS 2007. T. H. Feng and E. A. Lee, “Real-Time Distributed Discrete-Event Execution with Fault Tolerance,” RTAS 2008. P. Derler, E. A. Lee, and S. Matic, “Simulation and implementation of the ptides programming model,” DS-RT 2008. J. Zou, S. Matic, E. A. Lee, T. H. Feng, and P. Derler, “Execution strategies for Ptides, a programming model for distributed embedded systems,” RTAS 2009. J. Zou, J. Auerbach, D. F. Bacon, E. A. Lee, “PTIDES on Flexible Task Graph: Real-Time Embedded System Building from Theory to Practice,” LCTES 2009. J. C. Eidson, E. A. Lee, S. Matic, S. A. Seshia and J. Zou, “Time-centric Models For Designing Embedded Cyber-physical Systems,” ACES-MB 2010. J. C. Eidson, E. A. Lee, S. Matic, S. A. Seshia, and J. Zou, Distributed Real- Time Software for Cyber-Physical Systems, To appear in Proceedings of the IEEE special issue on CPS, December, 2011.

Implications for Performance Metrics Performance metrics for computing have been oversimplified: Minimize execution time on standard benchmarks. Minimize energy or power on standard benchmarks. Ideas for revised performance metrics: Timing precision (or variability) at I/O connections. Precision and reliability of time synchronization. Minimize energy subject to meeting timing constraints. Timing variability across platform implementations. This will require new benchmarks!

Overview References: Lee. Computing needs time. CACM, 52(5):70–79, 2009 Eidson et. al, Distributed Real-Time Software for Cyber-Physical Systems, Proc. of the IEEE, January, 2012. Conclusions Today, timing behavior is a property only of realizations of software systems. Tomorrow, timing behavior will be a semantic property of programs and models. Raffaello Sanzio da Urbino – The Athens School Eh eh eh.... A little classic lecture -:)... The School represents the clash of the two views of Plato and Aristoteles about the phylosophical foundations... Plato is for the abstract... Aristoteles is for the immanent... Plato reduces everything to a general "metamodel" (the world of ideas) where the real "things" are refinements of the general metamodel. Aristoteles is for the induction process where the abstraction takes place from the real world and moves up... Ideally platform based design is the meeting of the two wolds (top down- bottom up). The school of Athens can be seen as our groups where people debate about the nature of design. Our common view seems to merge the two worlds... The models of computation crowd (e.g., you and me) who like to see things at higher levels of abstraction, the implementation crowd (e.g. Kurt) sees the need of the application focus. I believe we as a team do both and believe in the both (the vision!). Sorry for the long winded explanation... i do have a ball explaining this to people while giving talks....-:) Finally my 8 years of philosophy pay out!!!!!!!!!!!!!!! Ciao Alberto