The Esterel v5 21 System Manual - Courses
The Esterel v5 21 System Manual - Courses
The Esterel v5 21 System Manual - Courses
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
1.3. CODE GENERATION OPTIONS 7<br />
1.3.1 Sorted Circuit Code<br />
<strong>The</strong> default is to generate a sorted circuit code, i.e. a sorted sequence of<br />
Boolean equations that implements the behavior of the <strong>Esterel</strong> program.<br />
With no option, this sequence is printed out in C. This is what you got<br />
by executing the previous command “esterel foo.strl”. This default<br />
mode only applies to statically acyclic programs, as described in the <strong>Esterel</strong><br />
language primer [2]. Sorted circuit code can also be generated for cyclic constructive<br />
programs [2, 1] using the -causal option of the <strong>Esterel</strong> command,<br />
as in<br />
esterel -causal prog.strl<br />
For programs that do have static cycles, the -causal option invokes a compiling<br />
algorithm based on Binary Decision Diagrams (BDDs), which can use<br />
a large and somewhat unpredictable amount of space and time, see [7].<br />
1.3.2 Interpreted Unsorted Circuit Code<br />
One can also generate an unsorted circuit code using option -I:<br />
esterel -I -simul foo.strl<br />
<strong>The</strong> -I option has important advantages and drawbacks studied in Section<br />
2.3.2. As we mentioned before, it provides better source code debugging<br />
information. When running the xes simulation for code compiled with<br />
option -I, a C interpreter interprets the circuit equations. <strong>The</strong> statements<br />
executed in the current reaction appear on a green background in the sourcecode<br />
window. This visualizes the exact execution path. We recommend to<br />
use option -I when building a simulator with the -simul option.<br />
1.3.3 Automaton Code<br />
A third possibility for software code generation is to generate an automatonbased<br />
code. This can be done in two ways. First, one can use the -A option:<br />
esterel -A [-simul] foo.strl<br />
<strong>The</strong> generated foo.c file is fully interchangeable with the previous ones, but<br />
the circuit is replaced by an explicit finite-state machine transition table.<br />
Another way to build automata is to use the former <strong>Esterel</strong> v3 technology<br />
which is still available in <strong>Esterel</strong> <strong>v5</strong> [3]:<br />
esterel -v3 [-simul] foo.strl