Simulink2Lustre and Stateflow2Lustre ==================================== Version 0.01b DISCLAIMER !!!!!!!!!! This software is provided "as is" and the authors make no guarantees whatsoever for its use for any particular purpose. All enquiries concerning this software should be addressed to: "Christos Sofronis" "Norman Scaife" !!!!!!!!!!!!!!!!! END OF DISCLAIMER Description ----------- This directory contains a bytecode release of the Simulink2Lustre and Stateflow2Lustre tools developed at VERIMAG. Simulink2Lustre (s2l) is a Java-based translator from Matlab Simulink model files into equivalent Lustre programs. Stateflow2Lustre (sf2lus) is a separate utility written in Objective Caml which extracts and translates only the Stateflow components of Matlab Simulink/Stateflow model files. Additionally, a script (ss2lus) is provided which links these two utilities allowing models with both Simulink and Stateflow to generate Lustre code. Note that both tools are partial in that there are Simulink and/or Stateflow features which are not supported. Requirements ------------ Common: - A UNIX/Linux system environment. This mostly includes the shell sh and utilities such as make, sed, awk and perl. An ANSI C compiler is also required for compiling C code generated by the Lustre tools. It is possible to run both tools on Windows but there are no plans for any Windows-based releases. - A version of Matlab with Simulink (and optionally Stateflow). Available from: http://www.mathworks.com/ s2l works with Releases 12 and 13, sf2lus works with Releases 13 and 14. s2l will be upgraded to Release 14, sf2lus will not be downgraded to Release 12. - A Lustre compiler. Available from: http://www.esterel-technologies.com/v3/ or: http://www-verimag.imag.fr/SYNCHRONE/tools.html s2l and sf2lus can both generate output for Reluc (by Esterel Technologies Inc.) and for the academic Lustre V4 toolset from VERIMAG. Not all features of both tools are supported by both of the output languages. Simulink2Lustre: - A suitable Java Runtime Environment > 1.4.0 Available from: http://java.sun.com/ The software has been tested on 1.4.0 and 1.4.1 but should work on later versions of Java. Stateflow2Lustre: - The Objective Caml runtime environment >= 3.08.0 Available from: http://pauillac.inria.fr/ocaml/ The sf2lus program makes use of features new to 3.08.0 and so will not work with previous versions of Ocaml. Only the "ocamlrun" runtime program is required. - (Optionally) The Graphviz package. Available from: http://www.research.att.com/sw/tools/graphviz This is required by the display_graph utility which allows the internal data structure used by sf2lus to be displayed in graphical form. Only the "dot" program is needed. Installation ------------ This distribution is provided as an "in situ" tarball. Simply uncompress and untar the archive into a suitable directory, say, $SS2LUSHOME. Then add the subdirectories to the usual environment variables: setenv SS2LUSHOME if ( ! $?PATH ) setenv PATH "." setenv PATH $SS2LUSHOME/bin:$PATH if ( ! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH "." setenv LD_LIBRARY_PATH $SS2LUSHOME/lib:$LD_LIBRARY_PATH if ( ! $?CFLAGS ) setenv CFLAGS "" setenv CFLAGS "$CFLAGS -I$SS2LUSHOME/include" if ( ! $?LDFLAGS ) setenv LDFLAGS "" setenv LDFLAGS "$LDFLAGS -L$SS2LUSHOME/lib" if ( ! $?CLASSPATH ) setenv CLASSPATH "." setenv CLASSPATH ${CLASSPATH}:$SS2LUSHOME/classes if ( ! $?MANPATH ) setenv MANPATH "." setenv MANPATH $SS2LUSHOME/man:$MANPATH if ( ! $?INFOPATH ) setenv INFOPATH "." setenv INFOPATH $SS2LUSHOME/info:$INFOPATH Depending on which shell you use. Not all of these are required as yet. The PATH and the SS2LUSHOME variables have to be set, however. Here are some command lines to get started: % cd $SS2LUSHOME/examples % s2l s2l/discrete_filter.mdl -o s2l/discrete_filter.lus % sf2lus sf2lus/Stopwatch2.mdl -o sf2lus/Stopwatch2.lus % ss2lus ss2lus/SetReset_r13.mdl -mp Currently only the Matlab Revision 13 files work with ss2lus. Limitations ----------- Simulink2Lustre: - Supported options in .mdl models (check in the "Simulation parameters" box under "Simulation" menu, once you have opened a .mdl file): o The "solver" option must be set to "fixed-step, discrete" o The "mode" option must be set to "auto" o The "boolean logic signals" ("advanced" menu) flag must be set to on o The "algebraic loop" flag ("diagnostics" menu) must be set to "error" - Inputs cannot have inherited sample times unless the --monoperiodic|-mp option is passed to s2l during translation. Stateflow2Lustre: - Much of the support is partial. Some supported features also cause complexity problems either in the sf2lus translator or in compilation of the resulting output. See the published papers and the user manuals for more information. Documentation ------------- Further information is available from the user manuals included in the docs directory in this distribution. Futher academic papers and technical reports are as follows: [1] N. Scaife, C. Sofronis, P. Caspi, S. Tripakis, and F. Maraninchi. Defining and translating a ``safe'' subset of Simulink/Stateflow into Lustre. Technical Report TR-2004-16, Laboratoire VERIMAG, Centre Equation, 2, avenue de Vignate, 38610 GIERES, France, 2004. [2] N. Scaife, C. Sofronis, P. Caspi, S. Tripakis, and F. Maraninchi. Defining and translating a ``safe'' subset of Simulink/Stateflow into Lustre. In Proc. EMSOFT 2004, Pisa, Italy, Sep 2004. Springer. [3] P. Caspi, A. Curic, A. Maignan, C. Sofronis, and S. Tripakis. Translating discrete-time simulink to lustre. In R. Alur and I. Lee, editors, EMSOFT'03, Lecture Notes in Computer Science. Springer Verlag, 2003. These are available from VERIMAG's website, or from the ss2lus project website. ================== End of file README $Id: README.in,v 1.3 2004/12/08 15:06:51 scaife Exp $