Skip to main content

A Synchronous-Based Code Generator for Explicit Hybrid Systems Languages

  • Conference paper

Part of the Lecture Notes in Computer Science book series (LNTCS,volume 9031)


Modeling languages for hybrid systems are cornerstones of embedded systems development in which software interacts with a physical environment. Sequential code generation from such languages is important for simulation efficiency and for producing code for embedded targets. Despite being routinely used in industrial compilers, code generation is rarely, if ever, described in full detail, much less formalized. Yet formalization is an essential step in building trustable compilers for critical embedded software development.

This paper presents a novel approach for generating code from a hybrid systems modeling language. By building on top of an existing synchronous language and compiler, it reuses almost all the existing infrastructure with only a few modifications. Starting from an existing synchronous data-flow language conservatively extended with Ordinary Differential Equations (ODEs), this paper details the sequence of source-to-source transformations that ultimately yield sequential code. A generic intermediate language is introduced to represent transition functions. The versatility of this approach is exhibited by treating two classical simulation targets: code that complies with the FMI standard and code directly linked with an off-the-shelf numerical solver (Sundials CVODE).

The presented material has been implemented in the Zélus compiler and the industrial Scade Suite KCG code generator of Scade 6.


  • Hybrid System
  • Concrete Syntax
  • Intermediate Language
  • Synchronous Language
  • Language Kernel

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Examples in Zélus and the extension of Scade 6 with hybrid features are available at .


  1. Benveniste, A., Bourke, T., Caillaud, B., Pagano, B., Pouzet, M.: A type-based analysis of causality loops in hybrid systems modelers. In: Int. Conf. Hybrid Systems: Computation and Control (HSCC 2014). ACM Press, Berlin (2014)

    Google Scholar 

  2. Benveniste, A., Bourke, T., Caillaud, B., Pouzet, M.: A Hybrid Synchronous Language with Hierarchical Automata: Static Typing and Translation to Synchronous Code. In: ACM SIGPLAN/SIGBED Conf. on Embedded Software (EMSOFT 2011), Taipei, Taiwan (October 2011)

    Google Scholar 

  3. Benveniste, A., Bourke, T., Caillaud, B., Pouzet, M.: Divide and recycle: types and compilation for a hybrid synchronous language. In: ACM SIGPLAN/SIGBED Conf. on Languages, Compilers, Tools and Theory for Embedded Systems (LCTES 2011), Chicago, USA (April 2011)

    Google Scholar 

  4. Benveniste, A., Bourke, T., Caillaud, B., Pouzet, M.: Non-Standard Semantics of Hybrid Systems Modelers. Journal of Computer and System Sciences (JCSS) 78(3), 877–910 (2012), Special issue in honor of Amir Pnueli

    Google Scholar 

  5. Benveniste, A., Caspi, P., Edwards, S., Halbwachs, N., Le Guernic, P., de Simone, R.: The synchronous languages 12 years later. Proc. IEEE 91(1) (January 2003)

    Google Scholar 

  6. Biernacki, D., Colaco, J.-L., Hamon, G., Pouzet, M.: Clock-directed modular code generation of synchronous data-flow languages. In: ACM Int. Conf. Languages, Compilers and Tools for Embedded Systems (LCTES), Tucson, Arizona (June 2008)

    Google Scholar 

  7. Bourke, T., Pouzet, M.: Zélus, a Synchronous Language with ODEs. In: Int. Conf. on Hybrid Systems: Computation and Control (HSCC 2013). ACM, Philadelphia (2013)

    Google Scholar 

  8. Carloni, L., Benedetto, M.D.D., Pinto, A., Sangiovanni-Vincentelli, A.: Modeling Techniques, Programming Languages, Design Toolsets and Interchange Formats for Hybrid Systems. Technical report, IST-2001-38314 WPHS, Columbus Project (March 2004)

    Google Scholar 

  9. Caspi, P., Curic, A., Maignan, A., Sofronis, C., Tripakis, S.: Translating Discrete-Time Simulink to Lustre. ACM Trans. on Embedded Computing Systems (2005), Special Issue on Embedded Software

    Google Scholar 

  10. Colaço, J.-L., Pagano, B., Pouzet, M.: A Conservative Extension of Synchronous Data-flow with State Machines. In: ACM Int. Conf. on Embedded Software (EMSOFT 2005), Jersey city, New Jersey, USA (September 2005)

    Google Scholar 

  11. Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Efficiently computing static single assignment form and the control dependence graph. ACM Trans. Program. Lang. Syst. 13(4), 451–490 (1991)

    CrossRef  Google Scholar 

  12. Denckla, B., Mosterman, P.: Stream and state-based semantics of hierarchy in block diagrams. In: Proc. of the 17th IFAC World Congress, pp. 7955–7960 (2008)

    Google Scholar 

  13. Esterel-Technologies. Scade language reference manual. Technical report, Esterel-Technologies (2014)

    Google Scholar 

  14. Halbwachs, N., Raymond, P., Ratel, C.: Generating efficient code from data-flow programs. In: 3rd Int. Symp. on Programming Language Implementation and Logic Programming, Passau, Germany (August 1991)

    Google Scholar 

  15. Harel, D.: StateCharts: A Visual Approach to Complex Systems. Science of Computer Programming 8(3), 231–275 (1987)

    CrossRef  MATH  MathSciNet  Google Scholar 

  16. Hindmarsh, A.C., Brown, P.N., Grant, K.E., Lee, S.L., Serban, R., Shumaker, D.E., Woodward, C.S.: SUNDIALS: Suite of nonlinear and differential/algebraic equation solvers. ACM Trans. Mathematical Software 31(3), 363–396 (2005)

    CrossRef  MATH  MathSciNet  Google Scholar 

  17. Lee, E.A., Zheng, H.: Operational semantics of hybrid systems. In: Morari, M., Thiele, L. (eds.) HSCC 2005. LNCS, vol. 3414, pp. 25–53. Springer, Heidelberg (2005)

    CrossRef  Google Scholar 

  18. Lee, E.A., Zheng, H.: Leveraging synchronous language principles for heterogeneous modeling and design of embedded systems. In: Int. Conf. on Embedded Software (EMSOFT 2007), Salzburg, Austria (September/October 2007)

    Google Scholar 

  19. MODELISAR. Functional Mock-up Interface for Model Exchange v1.0 (2010)

    Google Scholar 

  20. Morel, L.: Array iterators in Lustre: From a language extension to its exploitation in validation. EURASIP Journal on Embedded Systems (2007)

    Google Scholar 

  21. Ptolemaeus, C. (ed.): System Design, Modeling, and Simulation using Ptolemy II. (2014)

    Google Scholar 

  22. Raymond, P.: Compilation efficace d’un langage déclaratif synchrone: le générateur de code Lustre-v3. PhD thesis, Institut National Polytechnique de Grenoble (1991)

    Google Scholar 

  23. Tripakis, S., Stergiou, C., Shaver, C., Lee, E.A.: A modular formal semantics for Ptolemy. Mathematical Structures in Computer Science 23(04), 834–881 (2013)

    CrossRef  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations


Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2015 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Bourke, T., Colaço, JL., Pagano, B., Pasteur, C., Pouzet, M. (2015). A Synchronous-Based Code Generator for Explicit Hybrid Systems Languages. In: Franke, B. (eds) Compiler Construction. CC 2015. Lecture Notes in Computer Science(), vol 9031. Springer, Berlin, Heidelberg.

Download citation

  • DOI:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-662-46662-9

  • Online ISBN: 978-3-662-46663-6

  • eBook Packages: Computer ScienceComputer Science (R0)