Esterel (programming language)

from Wikipedia, the free encyclopedia

Esterel is a synchronous imperative programming language , the origin of which can be traced back to the beginning of the 80s and the collaboration of several scientists (including Gérard Berry ).

origin

Esterel emerged from the dissatisfaction of two researchers, Jean-Paul Marmorat and Jean-Paul Rigault, when developing a robotics car. They recognized the need for special statements on dealing with time, especially time delays and preemption (withdrawal of "components"), and found that the repetition of a signal should count as a separate unit of time. After a few important developments, Esterel v3 was created in 1987–1988. However, this made larger programs more difficult because there was often an explosion of states. As a temporary solution, utility programs have been developed to avoid this. In 1992 the Esterel v4 compiler came , which basically eliminated the problem of the state explosion . Further developments have now led to the current Esterel v5 compiler. Esterel has been sold commercially since the 1990s e.g. Currently with Esterel Studio , developed by the French company Esterel-Technologies. Esterel can be either a hardware - software -combination or as pure hardware solution be implemented.

semantics

Since a time that can be determined at any time does not exist or Esterel is based on multi-form time , the time is determined by events, with the lowest time unit representing a tick or instant. It only reacts to sensors or signals. As a result, any units can be used, e.g. B. minutes, meters, degrees. The frequency with which a signal is received determines the actual value, e.g. B. 100 meters. Sensors are used to receive values, signals can be sent and received. Signals are divided into pure (without value) and value-based (with value).

Esterel programs cannot run themselves and require a host language from which data types can be imported . Esterel does not have any complex data types of its own (only simple integers) and, in contrast to Luster, is better suited for control-intensive systems than for data-intensive ones. Signals are usually preferable to variables because querying a variable value requires lines of code and thus runtime , whereas signals do not. Another special feature are combined signals . Signal values ​​that are sent at the same time can be added by the receiver. This leads to a saving in command runtime, which would otherwise increase with every further query.

Modules , internal operations (engl. Nested operations), and the exception handling (engl. Exceptions) represent another important component is Esterel. Modules are placed anywhere. Inner operations can be nested according to priorities, with the outermost nesting having the highest priority. In connection with exceptions, you get process flows that can be interrupted at any time. If exceptions occur in several nested program sections, only the outermost exception is executed. Broadcasting is also essential, as it is the main communication between the processes. Neither the receiver nor the sender need to know who is sending or receiving a signal. This is not decided until the runtime and without any loss of efficiency. External tasks can also be executed from the host language.

The following module, based on AVERAGE, illustrates the advantage of being able to continuously interrupt ongoing processes:

  module COUNTER:
  input INCREMENT_COUNTER(integer), DONT_COUNT(integer);
  output COUNTER_VALUE;
  var COUNTER_VALUE:=0 : integer in
     abort
        every immediate INCREMENT_COUNTER do
           COUNTER_VALUE  := COUNTER_VALUE + 1;
              emit COUNTER_VALUE
                 end
     when 1 DONT_COUNT
  end module

COUNTER_VALUE is initialized with 0 at the beginning. Each time INCREMENT_COUNTER is received, COUNTER_VALUE is increased by 1 and the new counter value is sent with emit. If, on the other hand, the module receives a DONT_COUNT signal in addition to INCREMENT_COUNTER at the same time, an exception is executed with abort and the inner code section is ignored.

optimization

The Esterel compiler is very efficient. Trying to minimize existing code by hand turns out to be unnecessary. The compiler translates every program into an equivalent, sequential (linear) automaton , which only increases the compilation time.

verification

The verification is simplified by the deterministic automaton. A tool used for verification would be Verification AUTO .

Compilation

Esterel code can be compiled either as a complete machine or as several communicating partial machines. Both options have advantages. A whole machine takes up more space, but saves time. Several sub-machines save memory space through the form as modules, but the time required is increased by more communication effort. If you modify the program code by removing a module, this usually has no or hardly any effect on other modules. However, the compilation time is reduced. C code can be generated, which is integrated into the host language. Translation into OC format is also possible. Commercial programs also generate VHDL etc.

simulation

The Esterel v5 compiler starts a simulation using the -simul option . The input is made via the terminal. Existing graphics-based applications simplify the input and reading of output values. Similarly Trace options are used. Generated C code (integrated in the host language) can be executed. However, it must be noted that different resolutions of the time units apply to operating systems ( System V : 1s, BSD 4.3: 1 / 60s), which means that time-critical simulations are hardly possible.

Web links

Individual evidence

  1. G. Berry. Programming a digital watch in esterel v3. Technical Report 1032, ENSMP and INRIA, 1991 , p. 18