Download presentation
Presentation is loading. Please wait.
1
Einsterel: A Compiled Event-Driven Simulator for Esterel
2
Main contribution: - Scheduling of events at run time. This can give a substantial performance advantage.
3
It worked! A subset of Esterel was successfully implemented. Einsterel can simulate Esterel code over 2.5 times faster than Berry’s v5 compiler. Furthermore it is at least some percentage faster for all test benches ran. nothing emit S present S then p else q end loop p end pause suspend p when S p || q p ; q await S Boolean Logic: (and, or, not) Do nothing Make S present this instant Run p is S is present, q otherwise Run p. Restart it when it terminates Stop here; resume in the next instant Run p in this instant, but only in later instants when S is absent Run p and q concurrently; terminate when both do. Run p, wait for it to terminate, then run q pause until the next cycle in which S is present Performs specified logic function Einsterel’s implemented statements
4
EinGraph struct EinNode { int numFanIns ; int numFanOuts ; int level ; int *fanIns ; int *fanOuts ; void *pFunc ; } ; Figure 1: EinNode The event graph for Einsterel is referred to as EinGraph. It consists of array of EinNode’s
5
Example 1 present A then emit B ; end;
6
Building EinGraph ESUIF is used as front end to parse Esterel into SUIF. Einsterel’s graph building code is built off of ESUIF’s pass on the SUIF to generate Esterel. Essentially, instead of outputting Esterel, it creates EinNodes and puts them in an array. At the end of this pass the the EinNodes are fully constructed with the exception of their level.
7
Levelizing EinGraph changed=1; while someone’s level has changed changed=0; for every node for every fanout of this node FixLevel(parents_level*); Figure 2: Levelizing Algorithm * - Exceptions exist. highest_level_seen = parents_level for each fanin if fanin_level > highest level_seen highest_level_seen = fanin_level endfor if highest_level_seen >= my_level my_level = highest_level_seen + 1 changed=1; Figure 3: FixLevel(parents_level)
8
Example 1 (revisited) Present AB present A then emit B ; end;
9
Event Wheel Structure numScheduled[level]++; wheel[level][numScheduled[level]]=nodeNumber; inWheel[nodeNumber] = 1; Figure 5: Inserting a node to the wheel numScheduled[level]--; inWheel[nodeNumber] = 0; Figure 6: Deleting a node from the wheel Figure 4
10
Scheduling and Running for each level in the wheel while there are nodes scheduled in this level then for each node in this level delete it from the wheel goto (its evaluation code) and set eval if (eval != last cycle’s eval) then schedule it’s unscheduled fan-outs Figure 7: Basic simulation algorithm
11
Figure 8 : Running a sample program cycle-by-cycle
12
Synthesizing C The Target C code is divided into two main sections. 1. Initializing EinGraph This changes for each Esterel input program. EinGraph is looped over and written out. 2. Simulation code Same for every program, simply written out.
13
Results Three trends: Performance gap increases as 1.The number of cycles increases 2.The parallelism in the Esterel program increases 3.The number of driven inputs decreases
14
Future Work Implementing the full Esterel language. Decreasing Compile time. Increase performance with compile-time optimizations Detection of instantaneous loops and illegal cycles
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.