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

compiling esterel into static discrete event code
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Compiling Esterel into Static Discrete-Event Code

Vimal Kapadia and Michael Halas IBM Poughkeepsie NY USA vimal@kapadia.us michael@halas.us Stephen A. Edwards Columbia University Computer Science Department New York, USA sedwards@cs.columbia.edu

Presented by

Michael Halas

SLAP 2004

slide-2
SLIDE 2
  • Compiles Esterel into very efficient C code
  • Minimizes runtime overhead
  • Compile time
  • Runtime

CEC

slide-3
SLIDE 3

Input I,S ; Output O,Q;

An Example Modeling a shared resource

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

slide-4
SLIDE 4

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

Takes I, and passes to group two through R Responds to R with A Makes Q delayed version of R 2 1 3

slide-5
SLIDE 5

Takes I, and passes to group two through R Responds to R with A Makes Q delayed version of R 2 1 3

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

slide-6
SLIDE 6

Takes I, and passes to group two through R Responds to R with A Makes Q delayed version of R 2 1 3

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

slide-7
SLIDE 7

Takes I, and passes to group two through R Responds to R with A Makes Q delayed version of R 2 1 3

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

slide-8
SLIDE 8

The GRC Representation

Developed by Potop-Butucaru

slide-9
SLIDE 9

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

Control Flow Graph

slide-10
SLIDE 10

Executes once per cycle from entry to exit

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

slide-11
SLIDE 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

slide-12
SLIDE 12

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

slide-13
SLIDE 13
  • 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

Clustering

slide-14
SLIDE 14
  • 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

Clustering

slide-15
SLIDE 15
  • 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

Clustering

slide-16
SLIDE 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

slide-17
SLIDE 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

slide-18
SLIDE 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

slide-19
SLIDE 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

slide-20
SLIDE 20

Level 0 Level 1 Level 2

Running A Cycle

slide-21
SLIDE 21

Level 0 Level 1 Level 2

Running A Cycle

slide-22
SLIDE 22

Level 0 Level 1 Level 2

Running A Cycle

slide-23
SLIDE 23

Level 0 Level 1 Level 2

Running A Cycle

slide-24
SLIDE 24

Level 0 Level 1 Level 2

Running A Cycle

slide-25
SLIDE 25

Level 0 Level 1 Level 2

Running A Cycle

slide-26
SLIDE 26

Level 0 Level 1 Level 2

Running A Cycle

slide-27
SLIDE 27

Level 0 Level 1 Level 2

Running A Cycle

slide-28
SLIDE 28

Level 0 Level 1 Level 2

Running A Cycle

slide-29
SLIDE 29

Level 0 Level 1 Level 2

Running A Cycle

slide-30
SLIDE 30

Level 0 Level 1 Level 2

Running A Cycle

slide-31
SLIDE 31

Level 0 Level 1 Level 2

Running A Cycle

slide-32
SLIDE 32

//Cluster0 goto *head1 ; C1: goto *next1 ; C2: goto *next2 ; C3: goto *next3 ; C4: goto *next4 ; END_LEVEL2: goto *head3 ; END_LEVEL1: goto *head2 ;

Linked list structure with nothing scheduled

Running A Cycle

Only have to run cluster 0 and jump to each level

slide-33
SLIDE 33

Schedule cluster 2 in the empty structure

next2 = head1, head1 = &&C2

//Cluster0 goto *head1 ; C1: goto *next1 ; C2: goto *next2 ; C3: goto *next3 ; C4: goto *next4 ; END_LEVEL2: goto *head3 ; END_LEVEL1: goto *head2 ;

slide-34
SLIDE 34

//Cluster0 goto *head1 ; C1: goto *next1 ; C2: goto *next2 ; C3: goto *next3 ; C4: goto *next4 ; END_LEVEL2: goto *head3 ; END_LEVEL1: goto *head2 ;

Schedule cluster 2 to the empty structure

next2 = head1, head1 = &&C2

slide-35
SLIDE 35

//Cluster0 goto *head1 ; C1: goto *next1 ; C2: goto *next2 ; C3: goto *next3 ; C4: goto *next4 ; END_LEVEL2: goto *head3 ; END_LEVEL1: goto *head2 ;

Schedule cluster 2 to the empty structure

next2 = head1, head1 = &&C2

slide-36
SLIDE 36

Experimental Results

slide-37
SLIDE 37
  • 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

Five medium sized examples

slide-38
SLIDE 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

slide-39
SLIDE 39

0.5 1 1.5 2 2.5 3 a t d s C h

  • r

u s m c a 2 t c i n t W r i s t w a t c h CEC (switch) grc2c SAXO (fast) EC V3

Time in seconds to execute 1 000 000 iterations of the generated code on a 1.7 GHz Pentium 4.

The height of the bars indicates the time in seconds. (Shorter is better)

slide-40
SLIDE 40

C/L: Clusters Per Level

The higher C/L the better

C/L 5 10 15 20 25 30 35 atds Chorus mca200 tcint Wristwatch C/L

slide-41
SLIDE 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)

slide-42
SLIDE 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/