Clock-directed modular code generation for synchronous data-flow languages

The compilation of synchronous block diagrams into sequential imperative code has been addressed in the early eighties and can now be considered as folklore. However, separate, or modular, code generation, though largely used in existing compilers and particularly in industrial ones, has never been precisely described or entirely formalized. Such a formalization is now fundamental in the long-term goal to develop a mathematically certified compiler for a synchronous language as well as in simplifying existing implementations. This article presents in full detail the modular compilation of synchronous block diagrams into sequential code. We consider a first-order functional language reminiscent of LUSTRE, which it extends with a general n-ary merge operator, a reset construct, and a richer notion of clocks. The clocks are used to express activation of computations in the program and are specifically taken into account during the compilation process to produce efficient imperative code. We introduce a generic machine-based intermediate language to represent transition functions, and we present a concise clock-directed translation from the source to this intermediate language. We address the target code generation phase by describing a translation from the intermediate language to JAVA and C.

[1]  A. Girault A Survey of Automatic Distribution Method for Synchronous Programs , 2005 .

[2]  Nicolas Halbwachs,et al.  Generating Efficient Code From Data-Flow Programs , 1991, PLILP.

[3]  Nicolas Halbwachs,et al.  LUSTRE: a declarative language for real-time programming , 1987, POPL '87.

[4]  Marc Pouzet,et al.  Type-Based Initialisation Analysis of a Synchronous Data-Flow Language , 2002, Electron. Notes Theor. Comput. Sci..

[5]  Paul Le Guernic,et al.  Code generation in the SACRES project , 1999 .

[6]  Paul Le Guernic,et al.  Implementation of the data-flow synchronous language SIGNAL , 1995, PLDI '95.

[7]  Nicolas Halbwachs,et al.  A TUTORIAL OF LUSTRE , 2007 .

[8]  Xavier Leroy,et al.  Formal Verification of a C Compiler Front-End , 2006, FM.

[9]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[10]  Marc Pouzet,et al.  A conservative extension of synchronous data-flow with state machines , 2005, EMSOFT.

[11]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[12]  Nicolas Halbwachs,et al.  LUSTRE: A declarative language for programming synchronous systems* , 1987 .

[13]  Stephen A. Edwards,et al.  The synchronous languages 12 years later , 2003, Proc. IEEE.

[14]  Florence Maraninchi,et al.  Mode-Automata: a new domain-specific construct for the development of safe critical systems , 2003, Sci. Comput. Program..

[15]  Georges Gonthier Sémantiques et modèles d'exécution des langages réactifs synchrones : application à Esterel , 1988 .

[16]  Marc Pouzet,et al.  A Co-iterative Characterization of Synchronous Stream Functions , 1998, CMCS.

[17]  Marc Pouzet,et al.  Clocks as First Class Abstract Types , 2003, EMSOFT.