Berkeley ELENG C249A - From Models to Code - The Missing Link in Embedded Software

Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Slide 24Slide 25Slide 26Slide 27Slide 28Slide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37Slide 38Slide 39Slide 40Slide 41Slide 42Slide 43Slide 44Slide 45Slide 46Slide 47Slide 48Slide 49Slide 50Slide 51Slide 52Slide 53Slide 54Slide 55Slide 56Slide 57Slide 58Slide 59From Models to Code: The Missing Link in Embedded SoftwareTom Henzinger University of California, BerkeleyJoint work with Ben Horowitz and Christoph KirschThe History of Computer Science: Lifting the Level of AbstractionThe “assembly age”: Programming to the platformHigh-level languages: Programming to the applicationCompilation: perhaps “the” success story of computer scienceIt is feasible to abstract the platform.The History of Computer Science: Lifting the Level of AbstractionThe “assembly age”: Programming to the platformHigh-level languages: Programming to the applicationAutomatic program synthesis: No more programmingCompilation: perhaps “the” success story of computer scienceCode generation from specifications: still mostly a dreamIt is feasible to abstract the platform.It is not yet feasible to abstract algorithms.Current Practice in Control SoftwareSome manual programming to the platformSome automatic code generation from models-often inefficient -often unpredictable -difficult to reuse -difficult to verify -requires systems expertsCurrent Practice in Control SoftwareSome manual programming to the platformSome automatic code generation from modelsThe missing link: platform-independent software-often inefficient -often unpredictable -difficult to reuse -difficult to verify -requires systems expertsAdvocated Practice in Control SoftwareExecutable code for a specific platformMathematical model e.g. Simulink, HyTechPlatform-independent software e.g. Giotto-verifiable -reusable -efficiently implementableControl engineer CompilerCurrent Control Software DevelopmentMathematical Model e.g. Simulink, HyTechPlatform ConstraintsExecutable Code-hardware configuration -RTOS (scheduling algorithm) -network protocolsome automatic code generation, some manual code optimization-CONCURRENCY -ENVIRONMENT TIME-DISTRIBUTION -PLATFORM TIMECurrent Control Software DevelopmentMathematical ModelPlatform ConstraintsExecutable CodeProblems: -close correspondence between model and code is lost with code optimization-if either model or platform changes, the entire process needs to be repeatedsome automatic code generation, some manual code optimizationMathematical ModelPlatform-independent Software Model e.g. GiottoPlatform ConstraintsExecutable Code-executable by virtual machine -composable An intermediate layer that separates platform-independent from platform-dependent software issues.Advocated Control Software DevelopmentMathematical ModelPlatform-independent Software ModelPlatform ConstraintsExecutable Codee.g. What is the control equation? What is the sampling rate? e.g. Which procedure computes the control equation? Which event triggers the computation? e.g. Which CPU executes the control procedure? What priority has the execution? -still CONCURRENCY -still ENVIRONMENT TIMEAdvocated Control Software DevelopmentMathematical ModelPlatform-independent Software Model Platform ConstraintsExecutable CodePlatform-independent programming i.e. algorithms and data structuresPlatform-dependent code generation e.g. prioritiesSEPARATION OF CONCERNS !!!Advocated Control Software DevelopmentMotivation: Flight Control SoftwareETH Zurich (Kirsch, Pree, Sanvido, Schaufelberger, Wirth). Single CPU.Motivation: Flight Control SoftwareUC Berkeley (Horowitz, Liebman, Ma, Koo, Sangiovanni-Vincentelli, Sastry). Two connected CPUs.Motivation: Flight Control Software200 Hz400 Hz200 Hz1 kHzMotivation: Flight Control Software1. Concurrent periodic tasks: -sensing -control law computation -actuating 2. Multiple modes of operation: -navigational modes (autopilot, manual, etc.) -maneuver modes (taxi, takeoff, cruise, etc.) -degraded modes (sensor, actuator, CPU failures)Platform-independent Software ModelMode 1Mode 4Mode 3Mode 2Task S 400 HzTask C 200 HzTask A 1 kHzTask S 400 HzTask C 200 HzTask A’ 1 kHzTask C’ 100 HzTask A 1 kHzTask S 400 HzTask C 200 HzTask A 2 kHzTask A” 1 kHzCondition 1.2Condition 2.1Platform-independent Software ModelHost code e.g. CGlue code GiottoFunctionality.-Environment time, not platform time. -Concurrency, not distribution. Platform-independent Software ModelTiming and interaction.This kind of software is understood: Host code may (sometimes) be generated automatically.The software complexity lies in the glue code (minimize jitter!) : Giotto enables requirements-driven rather than platform-driven glue-code programming.-No time. -Sequential.1. The Giotto Programmer’s Model 2. The Giotto CompilerThe Giotto Programmer’s ModelProgramming in terms of environment time: Programmer’s fiction: -time-triggered task invocation -tasks are functions with a fixed duration -platform offers sufficient performance Implementation in terms of platform time:Compiler must maintain programmer’s fiction: -needs access to global time, no other platform requirements -tasks may finish early, but outputs cannot be observed early -tasks may be preempted and distributedGiven: 1. Units of scheduled host code (application-level tasks). e.g. control law computation 2. Units of synchronous host code (system-level drivers). e.g. device drivers3. Real-time requirements and data flow between tasks. Giotto: Glue code that calls 1. and 2. in order to realize 3.TaskInput ports Output portsTaskTask driver loads task input ports.The Giotto Programmer’s ModelTaskDriverInput


View Full Document

Berkeley ELENG C249A - From Models to Code - The Missing Link in Embedded Software

Documents in this Course
Load more
Download From Models to Code - The Missing Link in Embedded Software
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view From Models to Code - The Missing Link in Embedded Software and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view From Models to Code - The Missing Link in Embedded Software 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?