680 likes | 793 Views
Compiling ESTEREL circuits into finite states machines. BRES Yannis Stage de DEA d’Informatique 1998/1999. Esterel constructive semantics. Gives, for each statement p. , provided an initial environment E :. A new environment E’.
E N D
Compiling ESTEREL circuitsinto finite states machines BRES Yannis Stage de DEA d’Informatique 1998/1999
Esterel constructive semantics Gives, for each statement p , provided an initial environment E : A new environment E’ A completion code k (terminated, paused or trap exit level) A derivative statement p’, to be executed on next step E’ , k p p’ E
E’ , k p p’ E Circuit compilation Thus, each statement p of the language can be compiled into a circuit : E are wires indicating present signals E’ are wires indicating emitted signals k indicates which completing code wire will be on p’ is a another circuit activated by k wire
Generated circuits Directed graphs : logical gates (and, or, not, …) registers (memory elements) wires
Example of circuit abort sustain O when I
Circuits vs. automata Circuits are roughly linear while automata are exponential No automata for big circuits Up to medium-sized circuits : Automata are faster (run-time minimal) Control flow computed at compile-time Only input/test dependent stuff remain at run-time Ex : Motorola measures maximal application speed
Esterel source .strl .strl .strl strlic strlic strlic intermediate code .ic .ic .ic iclc linked code .lc lcsc circuit code .sc scssc sccausal sorted circuit code .ssc sscoc automaton code .oc Current compilation chain
scssc sccausal scoc sorted circuit code .ssc sscoc Future compilation chain Esterel source .strl .strl .strl strlic strlic strlic intermediate code .ic .ic .ic iclc linked code .lc lcsc circuit code .sc automaton code .oc
SSCOC automaton generation Circuit is seen like a set of boolean equations To be evaluated, equations must be sorted (.ssc) Sorting fails on several kind of cyclic circuits ! Code unmaintained...
SCOC automaton compilation Algorithm follows electrical current new informations (hot) propagated informations (cold)
SCOC automaton compilation Building initial state Propagating registers new informations (hot) propagated informations (cold)
SCOC automaton compilation Building initial state Propagating registers new informations (hot) propagated informations (cold)
SCOC automaton compilation Building initial state Propagating registers new informations (hot) propagated informations (cold)
SCOC automaton compilation Building initial state Propagating registers new informations (hot) propagated informations (cold)
SCOC automaton compilation Building initial state Propagating registers new informations (hot) propagated informations (cold)
SCOC automaton compilation Building initial state Propagating registers new informations (hot) propagated informations (cold)
SCOC automaton compilation Building initial state Propagating registers new informations (hot) propagated informations (cold)
SCOC automaton compilation Building initial state Propagating registers new informations (hot) propagated informations (cold)
SCOC automaton compilation Building initial state Propagating registers new informations (hot) propagated informations (cold)
SCOC automaton compilation Building initial state Propagating registers new informations (hot) propagated informations (cold)
SCOC automaton compilation Initial state built new informations (hot) propagated informations (cold)
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold)
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present Final state reached
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
SCOC automaton compilation Initial state built Building state 1 new informations (hot) propagated informations (cold) Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent State 1 reached again
Circuit saving and restoring To avoid saving the whole circuit at each step of automata building : Restoration data are stored in a stack of stacks
Circuit saving and restoring To avoid saving the whole circuit at each step of automata building : Restoration data are stored in a stack of stacks
Circuit saving and restoring To avoid saving the whole circuit at each step of automata building : Restoration data are stored in a stack of stacks
Circuit saving and restoring To avoid saving the whole circuit at each step of automata building : Restoration data are stored in a stack of stacks