Download presentation
Presentation is loading. Please wait.
Published byCalvin Webb Modified over 9 years ago
1
Compiling ESTEREL circuits into finite states machines BRES Yannis Stage de DEA d’Informatique 1998/1999
2
Esterel constructive semantics Gives, for each statement p p E A new environment E’ E’ A completion code k (terminated, paused or trap exit level) k, A derivative statement p’, to be executed on next step p’, provided an initial environment E :
3
Circuit compilation p E E’k, p’ 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
4
Generated circuits Directed graphs : logical gates (and, or, not, …) registers (memory elements) wires
5
Example of circuit abort sustain O when I
6
Circuits vs. automata Circuits are roughly linear while automata are exponential No automata for big circuits Up to medium-sized circuits : Only input/test dependent stuff remain at run-time Automata are faster (run-time minimal) Ex : Motorola measures maximal application speed Control flow computed at compile-time
7
Current compilation chain strlic iclclcscsscoc.strl Esterel source.ic intermediate code.lc linked code.sc circuit code.oc automaton code.ssc sorted circuit code scsscsccausal
8
Future compilation chain strlic iclc lcsc.strl Esterel source.ic intermediate code.lc linked code.sc circuit code.oc automaton code sscoc.ssc sorted circuit code scsscsccausal scoc
9
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...
10
SCOC automaton compilation Algorithm follows electrical current new informations (hot) propagated informations (cold)
11
SCOC automaton compilation new informations (hot) propagated informations (cold) Building initial state Propagating registers
12
SCOC automaton compilation new informations (hot) propagated informations (cold) Building initial state Propagating registers
13
SCOC automaton compilation new informations (hot) propagated informations (cold) Building initial state Propagating registers
14
SCOC automaton compilation new informations (hot) propagated informations (cold) Building initial state Propagating registers
15
SCOC automaton compilation new informations (hot) propagated informations (cold) Building initial state Propagating registers
16
SCOC automaton compilation new informations (hot) propagated informations (cold) Building initial state Propagating registers
17
SCOC automaton compilation new informations (hot) propagated informations (cold) Building initial state Propagating registers
18
SCOC automaton compilation new informations (hot) propagated informations (cold) Building initial state Propagating registers
19
SCOC automaton compilation new informations (hot) propagated informations (cold) Building initial state Propagating registers
20
SCOC automaton compilation new informations (hot) propagated informations (cold) Building initial state Propagating registers
21
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built
22
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1
23
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values
24
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers
25
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers
26
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers
27
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers
28
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I
29
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present
30
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present
31
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present
32
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present
33
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present
34
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present
35
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present
36
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present
37
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Final state reached Building branch where I is present
38
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
39
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
40
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
41
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
42
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
43
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
44
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
45
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 Loading registers values Propagating registers Forking on input signal I Building branch where I is present Building branch where I is absent
46
SCOC automaton compilation new informations (hot) propagated informations (cold) Initial state built Building state 1 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
47
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
48
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
49
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
50
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
51
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
52
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
53
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
54
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
55
Signal relations processing Stored in a directed graph Example : 3 2 2 1 1 # 4 # 5 :present absent absent present :present present :absent absent
56
Signal relations processing Stored in a directed graph Example : 3 2 2 1 1 # 4 # 5 :present absent absent present :present present :absent absent
57
Signal relations processing Stored in a directed graph Example : 3 2 2 1 1 # 4 # 5 :present absent absent present :present present :absent absent
58
Signal relations processing Stored in a directed graph Example : 3 2 2 1 1 # 4 # 5 :present absent absent present :present present :absent absent
59
Signal relations processing Stored in a directed graph Example : 3 2 2 1 1 # 4 # 5 :present absent absent present :present present :absent absent
60
Signal relations processing Stored in a directed graph Example : 3 2 2 1 1 # 4 # 5 :present absent absent present :present present :absent absent
61
Signal relations processing Stored in a directed graph Example : 3 2 2 1 1 # 4 # 5 :present absent absent present :present present :absent absent
62
Signal relations processing Stored in a directed graph Example : 3 2 2 1 1 # 4 # 5 :present absent absent present :present present :absent absent
63
Smart circuit evaluation Circuit evaluation algorithm stops as soon as all required nets are stabilized : Registers (determine next state) K0/K1 (determine whether automaton has terminated) Output signals Action nets (side-effects operating on values)
64
Input partitionning After registers propagation : Inputs reachable from required nets will be processed first Other inputs will probably not be processed at all Depending on current state, parts of the circuit are disabled
65
Input sorting Example : bus arbiter Set of cells requesting the access to a data bus Cells have rotating priorities
66
Input sorting Inputs are sorted upon the number of reachable registers This turns transitions from full trees (2 n -sized) to combs (n-sized):
67
DAG sharing present A emit A' end present || present B emit B' end present Goals : Saving memory Emphazing semantic aspects
68
Performance comparison
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.