compiling esterel into static discrete event code
play

Compiling Esterel into Static Discrete-Event Code Stephen A. - PowerPoint PPT Presentation

Compiling Esterel into Static Discrete-Event Code Stephen A. Edwards Vimal Kapadia and Michael Halas Columbia University IBM Computer Science Department Poughkeepsie New York, USA NY USA sedwards@cs.columbia.edu vimal@kapadia.us


  1. Compiling Esterel into Static Discrete-Event Code Stephen A. Edwards Vimal Kapadia and Michael Halas Columbia University IBM Computer Science Department Poughkeepsie New York, USA NY USA sedwards@cs.columbia.edu vimal@kapadia.us michael@halas.us Presented by Michael Halas SLAP 2004

  2. CEC •Compiles Esterel into very efficient C code •Minimizes runtime overhead •Compile time •Runtime

  3. An Example Modeling a shared resource every S do await I; weak abort sustain R when immediate A; emit O Input I,S ; || loop Output O,Q; pause; pause; present R then emit A end present end loop || loop present R then pause; emit Q else pause end present end loop end every

  4. Takes I , and passes to 1 await I; group two through R weak abort sustain R when immediate A; emit O || loop 2 pause; pause; Responds to R with A present R then emit A end present end loop || loop present R then pause; emit Q 3 else Makes Q delayed version of R pause end present end loop end every

  5. Takes I , and passes to 1 await I; group two through R weak abort sustain R when immediate A; emit O || loop 2 pause; pause; Responds to R with A present R then emit A end present end loop || loop present R then pause; emit Q 3 else Makes Q delayed version of R pause end present end loop end every

  6. Takes I , and passes to 1 await I; group two through R weak abort sustain R when immediate A; emit O || loop 2 pause; pause; Responds to R with A present R then emit A end present end loop || loop present R then pause; emit Q 3 else Makes Q delayed version of R pause end present end loop end every

  7. Takes I , and passes to 1 await I; group two through R weak abort sustain R when immediate A; emit O || loop 2 pause; pause; Responds to R with A present R then emit A end present end loop || loop present R then pause; emit Q 3 else Makes Q delayed version of R pause end present end loop end every

  8. The GRC Representation Developed by Potop-Butucaru

  9. Input I,S ; Control Flow Graph Output O,Q; Signal R,A in every S do await I; weak abort sustain R when immediate A; emit O || loop pause; pause; present R then emit A end present end loop || loop present R then pause; emit Q else pause end present end loop end every

  10. Input I,S ; Executes once per cycle from Output O,Q; entry to exit Signal R,A in every S do await I; weak abort sustain R when immediate A; emit O || loop pause; pause; present R then emit A end present end loop || loop present R then pause; emit Q else pause end present end loop end every

  11. Input I,S ; Output O,Q; Signal R,A in every S do await I; weak abort sustain R when immediate A; emit O || loop pause; pause; present R then emit A end present end loop || loop present R then pause; emit Q else pause end present end loop end every

  12. await I; weak abort � � � � sustain R when immediate A; emit O

  13. Clustering 1. Group the GRC nodes into clusters that can run without interruption 2. Assign levels – Partial Ordering Levels execute in order Clusters within the same level can execute in any order

  14. Clustering 1. Group the GRC nodes into clusters that can run without interruption 2. Assign levels – Partial Ordering Levels execute in order – Compile Time Clusters within the same level can execute in any order

  15. Clustering 1. Group the GRC nodes into clusters that can run without interruption 2. Assign levels – Partial Ordering Levels execute in order – Compile Time Clusters within the same level can execute in any order - Runtime

  16. every S do await I; weak abort sustain R when immediate A; emit O || loop pause; pause; present R then emit A end present end loop || loop present R then pause; emit Q else pause end present end loop end every

  17. every S do await I; weak abort sustain R when immediate A; emit O || loop pause; pause; present R then emit A end present end loop || loop present R then pause; emit Q else pause end present end loop end every

  18. every S do await I; weak abort sustain R when immediate A; emit O || loop pause; pause; present R then emit A end present end loop || loop present R then pause; emit Q else pause end present end loop end every

  19. every S do await I; weak abort sustain R when immediate A; emit O || loop pause; pause; present R then emit A end present end loop || loop present R then pause; emit Q else pause end present end loop end every

  20. Running A Cycle Level 0 Level 1 Level 2

  21. Running A Cycle Level 0 Level 1 Level 2

  22. Running A Cycle Level 0 Level 1 Level 2

  23. Running A Cycle Level 0 Level 1 Level 2

  24. Running A Cycle Level 0 Level 1 Level 2

  25. Running A Cycle Level 0 Level 1 Level 2

  26. Running A Cycle Level 0 Level 1 Level 2

  27. Running A Cycle Level 0 Level 1 Level 2

  28. Running A Cycle Level 0 Level 1 Level 2

  29. Running A Cycle Level 0 Level 1 Level 2

  30. Running A Cycle Level 0 Level 1 Level 2

  31. Running A Cycle Level 0 Level 1 Level 2

  32. Running A Cycle Linked list structure with nothing scheduled //Cluster0 goto *head1 ; C1: C2: C3: END_LEVEL1: goto *next1 ; goto *next2 ; goto *next3 ; goto *head2 ; C4: END_LEVEL2: goto *next4 ; goto *head3 ; Only have to run cluster 0 and jump to each level

  33. Schedule cluster 2 in the empty structure next2 = head1, head1 = &&C2 //Cluster0 goto *head1 ; C1: C2: C3: END_LEVEL1: goto *next1 ; goto *next2 ; goto *next3 ; goto *head2 ; C4: END_LEVEL2: goto *next4 ; goto *head3 ;

  34. Schedule cluster 2 to the empty structure next2 = head1 , head1 = &&C2 //Cluster0 goto *head1 ; C1: C2: C3: END_LEVEL1: goto *next1 ; goto *next2 ; goto *next3 ; goto *head2 ; C4: END_LEVEL2: goto *next4 ; goto *head3 ;

  35. Schedule cluster 2 to the empty structure next2 = head1, head1 = &&C2 //Cluster0 goto *head1 ; C1: C2: C3: END_LEVEL1: goto *next1 ; goto *next2 ; goto *next3 ; goto *head2 ; C4: END_LEVEL2: goto *next4 ; goto *head3 ;

  36. Experimental Results

  37. Five medium sized examples •Potop-Butucaru's grc2c •Beats us on four of the five examples •We are substantially faster on the largest example •SAXO-RT compiler •We are faster on the three largest examples

  38. •Most closely resembles SAXO-RT •Basic blocks •Sorted topologically •Executed based on run-time scheduling decisions •Two main differences: •Only schedule blocks within the current cycle •Linked list that eliminates conditional test instead of a scoreboard

  39. Time in seconds to execute 1 000 000 iterations of the generated code on a 1.7 GHz Pentium 4. 3 CEC 2.5 (switch) 2 grc2c 1.5 SAXO (fast) 1 EC 0.5 V3 0 h 0 s s t n c d u 0 i t 2 t r c a a o a t w h c C t m s i r W The height of the bars indicates the time in seconds. (Shorter is better)

  40. C/L: Clusters Per Level The higher C/L the better C/L 35 30 25 20 C/L 15 10 5 0 atds Chorus mca200 tcint Wristwatch

  41. Conclusion • Results in improved running times over an existing compiler that uses a similar technique (SAXO-RT) • Faster than the fastest-known compiler in the largest example (Potop-Butucaru's)

  42. Source and object code for the compiler described in this presentation is freely available as part of the Columbia Esterel Compiler distribution available from: http://www.cs.columbia.edu/~sedwards/cec/

Recommend


More recommend