Fakultät für informatik informatik 12 technische universität dortmund Specifications Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte,

Slides:



Advertisements
Ähnliche Präsentationen
Finding the Pattern You Need: The Design Pattern Intent Ontology
Advertisements

H - A - M - L - E - IC T Teachers Acting Patterns while Teaching with New Media in the Subjects German, Mathematics and Computer Science Prof. S. Blömeke,
Embedded System Hardware
P. Marwedel Informatik 12, U. Dortmund
Finite state machines & message passing: SDL
R. Zankl – Ch. Oelschlegel – M. Schüler – M. Karg – H. Obermayer R. Gottanka – F. Rösch – P. Keidler – A. Spangler th Expert Meeting Business.
Question words and word order
fakultät für informatik informatik 12 technische universität dortmund Test Peter Marwedel TU Dortmund Informatik 12 Germany 2009/01/17 Graphics: © Alexandra.
Embedded & Real-time Operating Systems
Fakultät für informatik informatik 12 technische universität dortmund Optimizations Peter Marwedel TU Dortmund Informatik 12 Germany 2009/01/17 Graphics:
fakultät für informatik informatik 12 technische universität dortmund Optimizations Peter Marwedel TU Dortmund Informatik 12 Germany 2009/01/10 Graphics:
Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Platforms Peter Marwedel TU Dortmund, Informatik 12 Germany.
Fakultät für informatik informatik 12 technische universität dortmund Optimizations Peter Marwedel TU Dortmund Informatik 12 Germany 2010/01/13 Graphics:
Fakultät für informatik informatik 12 technische universität dortmund Universität Dortmund Middleware Peter Marwedel TU Dortmund, Informatik 12 Germany.
Peter Marwedel TU Dortmund, Informatik 12
Fakultät für informatik informatik 12 technische universität dortmund Embedded System Hardware Peter Marwedel Informatik 12 TU Dortmund Germany 2011/03/09.
Fakultät für informatik informatik 12 technische universität dortmund Hardware/Software Partitioning Peter Marwedel Informatik 12 TU Dortmund Germany Chapter.
Fakult ä t f ü r informatik informatik 12 technische universit ä t dortmund Data flow models Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra.
Technische universität dortmund fakultät für informatik informatik 12 Embedded System Hardware Peter Marwedel Informatik 12 TU Dortmund Germany
Subjects and Direct Objects When to use der vs. den.
Telling Time in German Deutsch 1 Part 1 Time in German There are two ways to tell time in German. There are two ways to tell time in German. Standard.
DHBW Stuttgart, Technische Informatik, SW-Engineering, OOD April 2009 Seite 1 Christoph Riewerts Modeling in Colors – Objective: To learn and apply four.
Three minutes presentation I ArbeitsschritteW Seminar I-Prax: Inhaltserschließung visueller Medien, Spree WS 2010/2011 Giving directions.
Definite and indefinite articles nom. and acc. cases.
Laurie Clarcq The purpose of language, used in communication, is to create a picture in the mind and/or the heart of another.
die Zeiten (The Tenses) das Aktiv (Active Voice)
Sabine Dennerlein Nice to meet you! Enjoy 60 seconds of your precious time for yourself! Cornelia Renate Gottwald Your personal holistic health coach.
Institut AIFB, Universität Karlsruhe (TH) Forschungsuniversität gegründet 1825 Towards Automatic Composition of Processes based on Semantic.
Deutsche Farben German colors.
Sanjay Patil Standards Architect – SAP AG April 2008
Deutsch 1 G Stunde. Montag, der 10. September 2012 Deutsch 1 (G Stunde)Heute ist ein D - Tag Unit: Introduction to German & Germany Objectives: Introducing.
Meine Schulfächer.
Die Zukunft The future I will.
You need to use your mouse to see this presentation © Heidi Behrens.
You need to use your mouse to see this presentation © Heidi Behrens.
You need to use your mouse to see this presentation © Heidi Behrens.
You need to use your mouse to see this presentation © Heidi Behrens.
You need to use your mouse to see this presentation
Learning Target / Lernziel: 1.Hausaufgabenkontrolle (Vok 1-1) 2.Kultur 3.Forming questions Heute ist Dienstag, der 3. September 2013 Hausaufgaben GH #1,#2.
Verben Wiederholung Deutsch III Notizen.
Past Perfect Tense.
Image Processing and Analysis Introduction. How do we see things ?
Fakultät für informatik informatik 12 technische universität dortmund Memory-architecture aware compilation - Sessions Peter Marwedel TU Dortmund.
Design Patterns Ein Muster (pattern) ist eine Idee, die sich in einem praktischen Kontext als nützlich erwiesen hat und dies auch in anderen sein wird.
Personal Pronouns in the German language By Taylor Wantz ich du er es Sie wir uns ihn dich sie mich euch.
Alltagsleben Treffpunkt Deutsch Sixth Edition
PA Dutch 101 Video 16: Describing what you like. gleiche un net gleiche.
Negation is when you dont have or dont do something.
Can you tell me about your school?
Adjectiv Endungen Lite: Adjective following articles and pre-ceeding nouns. Colors and Clothes.
Future Tense. When is the future? Any time after the present…..so….any time after RIGHT NOW.
To school => zu der Schule With friends => mit den Freunden On top of the desk => auf dem Schreibtisch Through the wall => durch die Wand.
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH) Vorlesung Knowledge Discovery - Institut AIFB Tempus fugit Towards.
1 Intern | ST-IN/PRM-EU | | © Robert Bosch GmbH Alle Rechte vorbehalten, auch bzgl. jeder Verfügung, Verwertung, Reproduktion, Bearbeitung,
Plusquamperfekt The past of the past.
Fakultät für informatik informatik 12 technische universität dortmund Standard Optimization Techniques 2010/12/20 Peter Marwedel TU Dortmund, Informatik.
Fakultät für informatik informatik 12 technische universität dortmund Memory architecture description languages - Session 20 - Peter Marwedel TU Dortmund.
Launch ON Global.vi System ID object name classname Services to suscribe Observer Control Ref vi-path Service name Step 1 : Objects register to the Global.vi´s,
1 Stevens Direct Scaling Methods and the Uniqueness Problem: Empirical Evaluation of an Axiom fundamental to Interval Scale Level.
THE PERFECT TENSE IN GERMAN
Lehrstuhl für Waldbau, Technische Universität MünchenBudapest, 10./11. December 2006 WP 1 Status (TUM) Bernhard Felbermeier.
Technische Universität München 1 CADUI' June FUNDP Namur G B I The FUSE-System: an Integrated User Interface Design Environment Frank Lonczewski.
TUM in CrossGrid Role and Contribution Fakultät für Informatik der Technischen Universität München Informatik X: Rechnertechnik und Rechnerorganisation.
By Martin L. Loeffler.  The basic sentence has a subject and a verb.  The subject and verb need to be together.  The subject and verb need to agree.
I will be able to use the verb gefallen (Seite 137)
Wort des Tages Objective Students will be able to change sentences from the present tense to the present perfect and will be able to change sentences.
You need to use your mouse to see this presentation © Heidi Behrens.
Lust auf Lesen Treffpunkt Deutsch Sixth Edition. Relative Pronoun object of a preposition Recall from chapter 9 that relative clauses describe people,
You need to use your mouse to see this presentation © Heidi Behrens.
Imperfekt (Simple Past) Irregular or strong verbs
 Präsentation transkript:

fakultät für informatik informatik 12 technische universität dortmund Specifications Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte, Gesine Marwedel, /11/15

- 2 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Structure of this course New clustering 2: Specifications 3: Embedded System HW 4: Standard Software, Real- Time Operating Systems 5: Scheduling, HW/SW-Partitioning, Applications to MP- Mapping 6: Evaluation 8: Testing 7: Optimization of Embedded Systems Application Knowledge

- 3 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Motivation for considering specs Why considering specs? If something is wrong with the specs, then it will be difficult to get the design right, potentially wasting a lot of time. Why not just use standard languages like Java, C++ etc? Example demonstrating weakness time

- 4 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Consider a Simple Example The Observer pattern defines a one-to-many dependency between a subject object and any number of observer objects so that when the subject object changes state, all its observer objects are notified and updated automatically. Eric Gamman Richard Helm, Ralph Johnson, John Vlissides: Design Patterns, Addision- Wesley, 1995 © Ed Lee, Berkeley, Artemis Conference, Graz, 2007

- 5 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Example: Observer Pattern in Java public void addListener(listener) {…} public void setValue(newvalue) { myvalue=newvalue; for (int i=0; i<mylisteners.length; i++) { myListeners[i].valueChanged(newvalue) } Thanks to Mark S. Miller for the details of this example. Will this work in a multithreaded context? © Ed Lee, Berkeley, Artemis Conference, Graz, 2007

- 6 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Example: Observer Pattern with Mutual Exclusion (mutexes) public synchronized void addListener(listener) {…} public synchronized void setValue(newvalue) { myvalue=newvalue; for (int i=0; i<mylisteners.length; i++) { myListeners[i].valueChanged(newvalue) } Javasoft recommends against this. Whats wrong with it? © Ed Lee, Berkeley, Artemis Conference, Graz, 2007

- 7 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Mutexes using monitors are minefields public synchronized void addListener(listener) {…} public synchronized void setValue(newvalue) { myvalue=newvalue; for (int i=0; i<mylisteners.length; i++) { myListeners[i].valueChanged(newvalue) } valueChanged() may attempt to acquire a lock on some other object and stall. If the holder of that lock calls addListener(): deadlock! © Ed Lee, Berkeley, Artemis Conference, Graz, 2007 x calls addListener valueChanged requests lock held by x mutex

- 8 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Simple Observer Pattern Becomes not so simple public synchronized void addListener(listener) {…} public void setValue(newValue) { synchronized (this) { myValue=newValue; listeners=myListeners.clone(); } for (int i=0; i<listeners.length; i++) { listeners[i].valueChanged(newValue) } while holding lock, make a copy of listeners to avoid race conditions notify each listener outside of the synchronized block to avoid deadlock This still isnt right. Whats wrong with it? © Ed Lee, Berkeley, Artemis Conference, Graz, 2007

- 9 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Simple Observer Pattern: How to Make it Right? public synchronized void addListener(listener) {…} public void setValue(newValue) { synchronized (this) { myValue=newValue; listeners=myListeners.clone(); } for (int i=0; i<listeners.length; i++) { listeners[i].valueChanged(newValue) } Suppose two threads call setValue(). One of them will set the value last, leaving that value in the object, but listeners may be notified in the opposite order. The listeners may be alerted to the value-changes in the wrong order! © Ed Lee, Berkeley, Artemis Conference, Graz, 2007

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 What it Feels Like to Use the synchronized Keyword in Java © Ed Lee, Berkeley, Artemis Conference, Graz, 2007

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Succinct Problem Statement Threads are wildly nondeterministic. The programmers job is to prune away the nondeterminism by imposing constraints on execution order (e.g., mutexes). © Ed Lee, Berkeley, Artemis Conference, Graz, 2007

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 A stake in the ground … Nontrivial software written with threads, semaphores, and mutexes is incomprehensible to humans. © Ed Lee, Berkeley, Artemis Conference, Graz, 2007

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Problems with thread-based concurrency … threads as a concurrency model are a poor match for embedded systems. … they work well only … where best-effort scheduling policies are sufficient. Ed Lee: Absolutely Positively on Time, IEEE Computer, July, 2005

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Problems with classical CS theory and von Neumann computing (1) The lack of timing in the core abstraction is a flaw, from the perspective of embedded software, … Ed Lee: Absolutely Positively on Time, IEEE Computer, July, 2005 Timing is everything Frank Vahid, WESE 2008

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Problems with classical CS theory and von Neumann computing (2) Even the core … notion of computable is at odds with the requirements of embedded software. In this notion, useful computation terminates, but termination is undecidable. In embedded software, termination is failure, and yet to get predictable timing, subcomputations must decidably terminate. What is needed is nearly a reinvention of computer science. Ed Lee: Absolutely Positively on Time, IEEE Computer, July, 2005 Search for non-thread-based, non-von-Neumann MoCs; which are the requirements for specification techniques?

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Specification of embedded systems: Requirements for specification techniques (1) Hierarchy Humans not capable to understand systems containing more than ~5 objects. Most actual systems require more objects Hierarchy Behavioral hierarchy Examples: states, processes, procedures. Structural hierarchy Examples: processors, racks, printed circuit boards Compositional behavior Must be easy to derive behavior from behavior of subsystems Concurrency, Synchronization and communication proc

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Requirements for specification techniques (2) Timing 4 types of timing specs required, according to Burns 1990]: t ? execute 1.Measure elapsed time Check, how much time has elapsed since last call Timing behavior Essential for connecting to physical environment Additional information (periods, dependences, scenarios, use cases) welcome Also, the speed of the underlying platform must be known Far-reaching consequences for design processes!

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Requirements for specification techniques (3) Timing (2) 3.Possibility to specify timeouts Stay in a certain state a maximum time. 4.Methods for specifying deadlines Not available or in separate control file. t execute 2.Means for delaying processes t

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Specification of embedded systems (4): Support for designing reactive systems State-oriented behavior Required for reactive systems; classical automata insufficient. Event-handling (external or internal events) Exception-oriented behavior Not acceptable to describe exceptions for every state We will see, how all the arrows labeled k can be replaced by a single one.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Requirements for specification techniques (5) Presence of programming elements Executability (no algebraic specification) Support for the design of large systems ( OO) Domain-specific support Readability Portability and flexibility Termination Support for non-standard I/O devices Non-functional properties Support for the design of dependable systems Unambiguous semantics,... No obstacles for efficient implementation Adequate model of computation

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Models of computation - Definition - What does it mean, to compute? Models of computation define: Components and an execution model for computations for each component Communication model for exchange of information between components. Shared memory Message passing … C-1 C-2

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Communication Shared memory memoryComp-1Comp-2 Variables accessible to several tasks. Model is useful only for local systems.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Shared memory Potential race conditions ( inconsistent results possible) Critical sections = sections at which exclusive access to resource r (e.g. shared memory) must be guaranteed. process a {.. P(S) //obtain lock.. // critical section V(S) //release lock } process b {.. P(S) //obtain lock.. // critical section V(S) //release lock } Race-free access to shared memory protected by S possible This model may be supported by: mutual exclusion for critical sections cache coherency protocols

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Non-blocking/asynchronous message passing Sender does not have to wait until message has arrived; potential problem: buffer overflow … send () … receive () …

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Blocking/synchronous message passing rendez-vous Sender will wait until receiver has received message … send () … receive () …

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Extended rendez-vous … send () … receive () … ack … Explicit acknowledge from receiver required. Receiver can do checking before sending acknowledgement.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Components (1) Discrete event model abcabc time action a:=5 b:=7 c:=8 a:=6 a:=9 queue Von Neumann model Sequential execution, program memory etc.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Components (2) Finite state machines Differential equations

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Combined models - languages presented later in this chapter - SDL FSM+asynchronous message passing StateCharts FSM+shared memory CSP, ADA von Neumann execution+synchronous message passing …. See also Work by Ed Lee, UCB Axel Jantsch: Modeling Embedded Systems and Soc's: Concurrency and Time in Models of Computation, Morgan-Kaufman, 2004

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Models of computation considered in this course Communication/ local computations Shared memory Message passing Synchronous | Asynchronous Communicating finite state machines StateChartsSDL Data flow model Not usefulSimulinkKahn process networks, SDF Computational graphs Sequence dia- gram, Petri nets Von Neumann model C, C++, Java C, C++, Java with libraries CSP, ADA | Discrete event (DE) model VHDL, …Only experimental systems, e.g. distributed DE in Ptolemy

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Ptolemy Ptolemy (UC Berkeley) is an environment for simulating multiple models of computation. Available examples are restricted to a subset of the supported models of computation. Ptolemy simulations Newtons craddle

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Facing reality No language that meets all language requirements using compromises

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2008 Summary Non-deterministic thread-based concurrency results in problems Search for other models of computation = models of components -finite state machines (FSMs) -data flow, …. + models for communication -Shared memory -Message passing