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.
2.3. CONTROLLING CODE GENERATION 17<br />
module Cyclic1:<br />
output X, Y;<br />
present X then emit Y end;<br />
pause;<br />
present Y then emit X end<br />
end module<br />
module Cyclic2:<br />
input I;<br />
output X, Y;<br />
present I then<br />
present X then emit Y end<br />
else<br />
present Y then emit X end<br />
end present<br />
end module<br />
In both programs, there is a static instantaneous dependency from X to Y<br />
due to “present X then emit Y” and a reverse static instantaneous dependency<br />
from Y to X due to “present Y then emit X”. In Cyclic1, because<br />
of the “pause” statement, the potential cycle is not an actual cycle since the<br />
dependencies are not active at the same instant. In Cyclic2, the potential<br />
cycle is not an actual cycle since the first dependency is meaningful only if<br />
I is present while the second dependency is meaningful only if I is absent.<br />
(Try esterel -cycles to visualize the static cycles). <strong>The</strong>se facts cannot be<br />
discovered by simple equation sorting. <strong>The</strong>y require the much more elaborate<br />
constructive causality analysis performed by the sccausal processor<br />
when option -causal is set. Beware: the -causal option can be expensive<br />
in compiling time and space. More details on code generation from cyclic<br />
programs can be found in Chapter 8.<br />
<strong>The</strong> -L target language definition option can be used to change the target<br />
language. <strong>The</strong> L letter is followed by a language name. For example,<br />
esterel -Ldebug foo.strl<br />
esterel -causal -Ldebug cycle.strl<br />
generate a readable code using sscdebug instead of sscc. For Pure <strong>Esterel</strong><br />
programs, one can use the -Lblif option to generate a blif hardware<br />
circuit:<br />
esterel -Lblif foo.strl