synerjy
play

synERJY An Object-oriented Synchronous Programming Language - PowerPoint PPT Presentation

synERJY An Object-oriented Synchronous Programming Language Synchrony - Ten Years After Reinhard Budde Axel Poign Karl-Heinz Sylla Overview Highlights Reactive Components Synchronous Styles Hybrid Systems


  1. synERJY An Object-oriented Synchronous Programming Language Synchrony - Ten Years After Reinhard Budde Axel Poigné Karl-Heinz Sylla

  2. Overview • Highlights • Reactive Components • Synchronous Styles • Hybrid Systems • Semantics • Programming Environment • Conclusions & Outlook page

  3. Highlights • supports object-oriented design (using a Java-like language) • integrates synchronous styles • targets micro controllers page

  4. interface to Reactive Components class Basic { environment static final time timing = 250msec; read only Sensor button = new Sensor(new SimInput()); Signal red_led = new Signal(new SimOutput()); public Basic () { active { loop { await ?button; emit red_led; next; }; }; }; public static void main (String[] args) { while (instant() == 0) {}; }; } page

  5. Reactive Compents II System Environment Signals Signal bus Components = Objects page

  6. Synchronous Styles • Imperative (Esterel - like) • Data Flow (Lustre - like) • Hierarchical State Machines (Statecharts - like) page

  7. Synchronous Styles: Imperative Style - Syntax Types Sensor , Sensor < type > type = primitive, restricted reference Signal , Signal < type > DelayedSignal , DelayedSignal <type> time Statements emit s; , emit s(v); assignment ; method_call ; if reactive = module next; await expr ; await time_expr ; cancel { } when () else when … activate { } when (); loop { }; if ( ) { } else { }; [[ || || ]] parallel page

  8. Synchronous Styles: Imperative Style - New Features Time Races Restricted to classes [[... data-op1 ...||... data-op2 ...]] (attributes and methods are private) Resolved using precedence precedence { data-op1 < data-op2; }; page

  9. New Features Continued Multiple Emittance no combinators [[... emit s(v1); ...||... emit s(v2); ...]]; Either avoid or use labels and precedence [[... l1::emit s(v1); ...||... l2::emit s(v2); ...]]; precedence { l1:: < l2:: ; }; page

  10. Synchronous Styles: Data Flow flow context sustain {| x := pre(x) + 1; |}; • handled like any other statement (can be preempted) • flow expressions with all the Lustre operator • clocks page

  11. Interrupt: Concerning Java All compiled to C ¬ Dynamic Loading (HW formats) ¬ No packages (yet ?) ¬ Exception Handling only top level ¬ No Hiding (for good software) ¬ Only one- and two-dimensional arrays (for efficiency) ¬ Semicolon “;” is a must as terminator + more integer types: int8, unint8,…, uint64, int64 + native C (constants and functions) + Parametrised Types “ List<T> ” page

  12. Hybrid Systems: Bouncing Ball x1 <= 0 / x2 = -x2 x1 = x2 x1 > 0 x2 = -g x1 = x2 Change direction x2 = -g if x1 <= 0 page

  13. Bouncing Ball II automaton { init { emit x1(height); emit x2(0.0); change of direction next state move; }; state move during {| x1 := pre(x1) + x2*dt; x2 := -c*pre(x2) -> pre(x2) - g *dt; |} when ($x1 <= 0.0) { next state move; }; }; • pre and -> are defined relative to flow context page

  14. Semantics: Signals • all Signals have a clock • Signals are present if updated • Signals may be updated using - emit Statement - flow equation: then clocks are checked • Signals that are emitted are always on base clocks • Clocks are part of a Signal type: Signal{ clock }< type > (Signal< type > = Signal{true}< type >) page

  15. Semantics: Translation Scheme (Model of 93/98) “beta” “front” preemption α β τ µ flow context synchronous s <= φ automaton r <- φ (Semantic Domain) if s { a; }; • Semantics is “compositional” ω • Realisation as denotational κ semantics in ocaml control termination page

  16. Translation Scheme Example s <= α ; s <= α ; a1 <= α ; a1 <= α ; if (a1) { $s = v1; }; if (a1) { $s = v1; }; ω <= α | CC(a1); γ <= α | CC(a1) emit s(v1); f(v2); a2 <= γ ; a2 <= α ; if (a2) { f(v2}; }; if (a2) { f(v2}; }; ω <= γ | CC(a2) ω <= α | CC(a2); page

  17. Programming Environment synERJY light HW-Formate Windows ARM CAN TTA Linux PIC Compiler synERJY MPC555 ANSII - C RT-Linux ATMEL Mac OSX DSP Simulink Simulink FPGA . . . LEGO-Lib ATMEL-Lib CAN-Lib F4-Lib page

  18. Conclusions • Language is stable / compiler reasonably mature • Usage - Teaching - Robotics Applications - Project on smart materials • Experience is somewhat annoying - people use only one style (imperative / state-machines), and - encode their standard programming style page

  19. Outlook • allow several reactive engines (several calls of instant ) • Support for Digital Signal Processing • Generate Code for DSP (more long term: FPGA) • Optimisation of the compiler with regard to different targets • Minor Points: add functional nodes, improve simulator, ... page

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend