Reactive systems are computer systems that react continuously to their environment, at a speed determined by the latter. Synchronous languages have been designed to facilitate the programming of reactive systems. The main synchronous languages are Esterel, Lustre, Argos, and Signal.
Many reactive systems have to be distributed on several computing sites, for various reasons: performance increase, location of sensors and actuators, fault tolerance. The screp tool parallelizes synchronous programs, according to distribution specifications given by the user.
Screp is based on the object code parallelization method. It consists in compiling the source program into a single object program, and then parallelizing this centralized program towards as many programs as there are computing sites, so that each site only has to perform its own computations. Therefore, screp takes advantage of the existing common format SC for synchronous languages. Indeed, SC code can be obtained from the Esterel compiler. Without going into details, an SC program is a boolean synchronous circuit with a finite memory for the computations. Screp takes as input:
foo.sc
, andfoo.rep
.The distribution specifications consist in a partition of the set of inputs and outputs of the program into as many sub-sets as there are computing sites. This assigns a unique computing site to each input/output. Concretely, the distribution specification file contains a table of sites, with the same syntax as the other SC tables:
site_part : /* empty */ | 'sites:' integer site_table 'end:' ; site_table : site_table site_definition ; site_definition : integer ':' identifier '(' signal_list ')' ;
Here, signal_list
is a list of names of input and
output signals of the SC program.
A few words on local
and exception
signals. They come from Esterel programs and
are used to express special synchronization constraints:
synchronization between parallel modules, trap-exit
, and
so on. However, in the SC code, all these synchronization
constraints are directly expressed by the control structure of the
circuit: local
and exception
signals are
translated into wires by the Esterel compiler. A
consequence is that there should be no output
or
present
actions involving local
or
exception
signals. This is why screp arbitrary
decides to localize any local
or exception
signal to site 0. Note that these signals have no name, so a site's
signal_list
cannot contain local
or
exception
signals.
The communications take place through a fully-connected network of FIFO channels. Two communication primitives are used:
put(s,v,x)
instruction writes the value
x
to the queue directed towards process s
and related to variable v
; it is non blocking;v:=get(s,v)
instruction extracts the head value
from the queue originating from process s
and related to
variable v
, and assigns it to the variable
v
; it blocks if the queue is empty.Screp produces one SC program for each site specified in the distribution specification file. Each SC program contains the necessary communication actions to permit references to non local variables. For instance, the command:
screp foo.sc
produces two files foo.2.0.sc
and
foo.2.1.sc
if the file foo.rep
specifies a
distribution towards two sites. Each file produced by screp can
then be compiled by the Esterel compiler.
The following options are available:
-h | Print the help message. | ||
-version | Display the version number of screp. | ||
-info | Display all informations about screp. |
The screp tool is available for Unix architectures:
This distribution of screp contains four directories:
bin
contains the executable
screp
.man
contains the user manual.src
contains the C files
distinet.c
and trace.h
:distinet.c
contains the procedures for creating the
execution environment for distributed SC programs (procedures
for establishing the FIFO queues, as well as the put and get
procedures for exchanging data through these queues);trace.h
is used by distinet.c
for
tracing the connections.demo
contains the prog
demo.Enjoy!