30.07.2013 Views

The Esterel v5 21 System Manual - Courses

The Esterel v5 21 System Manual - Courses

The Esterel v5 21 System Manual - Courses

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3<br />

<strong>The</strong> <strong>Esterel</strong> to C Interface<br />

3.1 Introduction<br />

<strong>The</strong> <strong>Esterel</strong> <strong>v5</strong> system generates a C code file from a source <strong>Esterel</strong> program.<br />

<strong>The</strong> C code can be generated either for direct execution, which is the default,<br />

or for interactive simulation if <strong>Esterel</strong> is called with the -simul option.<br />

<strong>The</strong> main object in the generated code is the reaction function, which<br />

inherits the name of the compiled <strong>Esterel</strong> module. Inputs and outputs are<br />

performed using auxiliary input and output functions whose names are automatically<br />

computed from the module and signal names. <strong>The</strong> run-time<br />

interface is purely procedural. No assumption is made on the operating<br />

system that supports the execution. <strong>The</strong> decisions of when an input event<br />

occurs and when signals should be considered as simultaneous are left to<br />

the user. This makes it possible to execute the generated code in arbitrary<br />

execution environments.<br />

<strong>The</strong> run-time interface is independent on the code generation style: the<br />

sorted equation code generated by the default option or by the -causal<br />

option, the unsorted equation code generated by the -I option, and the<br />

automaton code generated by the -A, -v3, and -S options have exactly the<br />

same interface.<br />

<strong>The</strong> generated C code may require some auxiliary code to define the<br />

types, constants, functions, procedures, and tasks used in the module’s body.<br />

This auxiliary code is called the data-handling code. Some master code is<br />

also needed to realize the execution interface with the outside world, i.e.<br />

detect input events, call the reaction function, and perform output actions.<br />

We start in Section 3.2 by an overview of the data handling and execution<br />

interface. In Section 3.3, we present the details of the data-handling<br />

31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!