Presentation is loading. Please wait.

Presentation is loading. Please wait.

“Software” Esterel Execution (work in progress) Dumitru POTOP-BUTUCARU Ecole des Mines de Paris

Similar presentations


Presentation on theme: "“Software” Esterel Execution (work in progress) Dumitru POTOP-BUTUCARU Ecole des Mines de Paris"— Presentation transcript:

1 “Software” Esterel Execution (work in progress) Dumitru POTOP-BUTUCARU Ecole des Mines de Paris tyshbe@math.tau.ac.il

2 loop emit S ; pause end

3 »loop emit S ; pause end Start

4 loop »emit S ; pause end Start

5 loop emit S ; »pause end Start

6 loop emit S ; pause end Start

7 »loop emit S ; pause end Resume

8 loop emit S ; »pause end Resume

9 loop »emit S ; pause end Resume

10 loop emit S ; »pause end Resume

11 loop emit S ; pause end Resume

12 Overview Building an Intermediate Representation Giving it a (proper) meaning, based on existing semantics Some interesting classes of programs Simulation and tentative optimization

13 What Esterel Esterel v5 (with data) In this paper, examples without data

14 signal S  in emit S ; pause || present S then pause end

15 signal S  in emit S ; pause 1 || 3 present S then pause 2 end

16 Organizing Actions in a Graph »signal S  in emit S ; pause 1 || 3 present S then pause 2 end · start

17 Organizing Actions in a Graph signal S  in »emit S ; pause 1 || 3 »present S then pause 2 end   fork start enter 3 · ·

18 Organizing Actions in a Graph signal S + in emit S ; »pause 1 || 3 »present S then pause 2 end   fork S start enter 3 · ·

19 Organizing Actions in a Graph signal S + in emit S ; »pause 1 || 3 present S then »pause 2 end   fork S S start F T enter 3 · ·

20 Organizing Actions in a Graph signal S + in emit S ; pause 1 || 3 present S then »pause 2 end  p fork S S enter 1 start F T enter 3 · ·

21 Organizing Actions in a Graph signal S + in emit S ; pause 1 || 3 present S then pause 2 end p p fork S S enter 1 enter 2 start F T enter 3 · ·

22 Organizing Actions in a Graph signal S in emit S ; pause 1 || 3 present S then pause 2 end fork S S enter 1 enter 2 pause(1) term(2) pause(2) pause start F T enter 3 pause · join

23 Organizing Actions in a Graph »signal S in emit S ; pause 1 || 3 present S then pause 2 end term fork active 2 exit 1 exit 2 term(1) inactive(2) term(2) resume active 1 inactive(1) T T F F exit 3 term · fork S S enter 1 enter 2 pause(1) term(2) pause(2) pause start F T enter 3 pause join

24 Organizing Actions in a Graph signal S - in emit S ; »pause 1 || 3 present S then »pause 2 end   term fork active 2 exit 1 exit 2 term(1) inactive(2) term(2) resume active 1 inactive(1) T T F F exit 3 term · · F fork S S enter 1 enter 2 pause(1) term(2) pause(2) pause start F T enter 3 pause join

25 Organizing Actions in a Graph signal S - in emit S ; pause 1 || 3 present S then »pause 2 end t  term fork active 2 exit 1 exit 2 term(1) inactive(2) term(2) resume active 1 inactive(1) T T F F exit 3 term · · F fork S S enter 1 enter 2 pause(1) term(2) pause(2) pause start F T enter 3 pause join

26 Organizing Actions in a Graph signal S - in emit S ; pause 1 || 3 present S then pause 2 end t t term fork active 2 exit 1 exit 2 term(1) inactive(2) term(2) resume active 1 inactive(1) T T F F exit 3 term · · F fork S S enter 1 enter 2 pause(1) term(2) pause(2) pause start F T enter 3 pause join

27 Organizing Actions in a Graph signal S in emit S ; pause 1 || 3 present S then pause 2 end term fork active 2 exit 1 exit 2 term(1) inactive(2) term(2) resume active 1 inactive(1) T T F F exit 3 term · fork S S enter 1 enter 2 pause(1) term(2) pause(2) pause start F T enter 3 pause join

28 Intermediate format Vertices – represent computation –test –fork –join (parallel branch termination synchronizing) –emit –state/memory update action Edges – control flow and signal dependencies S S

29 State representation issues no state encoding decision yet intuitive semantics: –one boolean variable per pause and composed statement –all false, in the beginning –enter sets it to 1, exit sets it to 0 several possible encoding techniques optimization issues

30 Semantics 1.SOS rules (using Cannot auxiliary functions) - dynamic 2.CCFG-like semantics on the intermediate graph 3.Translation to Constructive Circuits – fine grained, static

31 SOS rules p’p’’ k, E’ E p’p 0, E’ E p’;qp;·qp;·q , E’ E k   {  } – completion code E:  S v  {0,1,  } – input event E’ – emitted signal or  p’, p’’ are terms over statement p

32 SOS rules signal S  in p’ endsignal S - in p’ end ,, E S  Cannot(p’) signal S  in p’ endsignal S + in p’’ end ,, E p’p’’ E  (S,  ) ,S,S CONSTRUCTIVE

33 CCFG-based semantics goal is sequential code generation graph interpreted as a classical flowchart limited class of programs related to intermediate representation of Stephen Edwards and of the CNET group graph acyclicity required lesser grain static

34 CCFG-based semantics signal S ,  in p’ endsignal S - in p’ end ,, E signal S ,  in p’ endsignal S ,+ in p’’ end ,, E p’p’’ E  (S,  ) ,S,S S  Cannot ’ (p’) signal S , + in p’ endsignal S + in p’ end ,, E S  Cannot ’ (p’)

35 S  Cannot(p’) CCFG view –all the signal emission statements have been ruled out by executed tests Constructive view –all the signal emission statements have been ruled out by either: executed tests not yet executed tests for which the test condition is already computed so that we can prune one of the test branches.

36 Acyclicity Can be defined on both intermediate graph and associated circuit Simple (cheap) correctness criteria for big programs Basis of static scheduling Problem: graph acyclicity is not the same as circuit acyclicity –what is a compilable program

37 Acyclicity discrepancy signal S in [ nothing || present I then nothing else present S then pause else pause end end present ]; emit S end signal fork S S I F T F T term(1) term(2) pause(2) term pause start

38 Acyclicity discrepancy signal S in [ nothing || present I then nothing else present S then pause else pause end end present ]; emit S end signal fork S S I F T F T term(1) term(2) pause(2) term pause start

39 Acyclicity discrepancy signal S in [ nothing || present I then nothing else present S then pause else pause end end present ]; emit S end signal S F T F T term pause start

40 Acyclicity discrepancy Possible solutions: –splitting the synchronizers with problems, and so borrow some expressive power from circuit semantics –duplicate cycle code based on the trigger or the problem test (improve the CCFG model)

41 acyclic circuit Compilable Program Classes acyclic CCFG

42 acyclic circuit Compilable Program Classes acyclic CCFG

43 Static analysis Graph arc removal in the circuit Results hold in CCFG, if the result is acyclic Problem: causality Some particular simplifications proved, like erasing dependencies based on state incompatibility

44 Static analysis What I would like to do fork S S I F T F T term(1) term(2) pause(2) term pause start ·

45 Static analysis What I would like to do fork S S I F T F T term(1) term(2) pause(2) term pause start ·

46 Static analysis What I would like to do fork S S I F T F T term(1) term(2) pause(2) term pause start ·

47 acyclic after simplif. acyclic circuit Compilable Program Classes acyclic CCFG

48 correct programs acyclic after simplif. Compilable Program Classes acyclic circuit acyclic CCFG

49 Cyclic specifications Proving correctness – not my goal Execution (Simulation)

50 Cyclic specifications 3-valued simulation Resynthesis of cyclic parts

51 3-valued simulation expensive, if applied to the entire circuit (Esterel simulation compiler) can be restricted to the nodes/arcs in SCCs, and maybe more doesn’t need expensive analysis at compile time doesn’t prove correctness knowledge about correctness can improve simulation (loop unrolling, no error handling code)

52 Implementation in progress…

53

54 The Esterel Langu p || q p ; q pause loop p end signal S in p end emit S present S then p else q end suspend p when S exit T trap T in p end

55 term Execution signal S in emit S ; pause || present S then pause end join fork S S update state update state pause(1) term(2) pause(2) pause start join fork active 1 update state update state term(1) inactive(2) term(2) resume active 2 inactive(1) T F T T F F update state update state term pause

56 Giving it a (proper) meaning Dynamic SOS rules (Gerard Berry, Can/Must predicates) Direct Concurrent Control-Flow Graph Execution? Translation to Constructive Circuits –nodes are increasing constructive functions and they can be evaluated several times, in order to obtain partial results (finer grain). –A signal is present once it has been emitted (weak synchronization, possible cycles) –Berry’s circuit translation (with non-essential changes)

57 Direct Concurrent Control-Flow Graph Execution –nodes are atomic operations that map Boolean inputs into Boolean outputs exactly once in an instant –all signal emission statements are either executed or tested out before signal tests (strong synchronization, acyclicity required) –related to Stephen Edwards’ and CNET’s compilers (?)

58 Klaus.Schneider@ira.uka.de Concurrent Control-Flow Graph –good for sequential execution –restricts the class of accepted programs Constructive Circuit –good for circuit generation –implements the exact semantics of Esterel (proof in work)

59 Static analysis Graph arc removal in the circuit Results hold in CCFG, if the result is acyclic Basic idea: precompute Cannot –for signal arcs coming to a test: may be refined to use some form of synchronization –for control arcs Generalizes existing techniques, like graph coloring


Download ppt "“Software” Esterel Execution (work in progress) Dumitru POTOP-BUTUCARU Ecole des Mines de Paris"

Similar presentations


Ads by Google