ABSTRACT
Explicit hybrid systems modelers like Simulink/Stateflow allow for programming both discrete- and continuous-time behaviors with complex interactions between them. A key issue in their compilation is the static detection of algebraic or causality loops. Such loops can cause simulations to deadlock and prevent the generation of statically scheduled code.
This paper addresses this issue for a hybrid modeling language that combines synchronous data-flow equations with Ordinary Differential Equations (ODEs). We introduce the operator last(x) for the left-limit of a signal x. This operator is used to break causality loops and permits a uniform treatment of discrete and continuous state variables. The semantics relies on non-standard analysis, defining an execution as a sequence of infinitesimally small steps. A signal is deemed causally correct when it can be computed sequentially and only changes infinitesimally outside of announced discrete events like zero-crossings. The causality analysis takes the form of a type system that expresses dependences between signals. In well-typed programs, signals are provably continuous during integration provided that imported external functions are also continuous.
The effectiveness of this system is illustrated with several examples written in Zélus, a Lustre-like synchronous language extended with hierarchical automata and ODEs.
- T. Amagbegnon, L. Besnard, and P. Le Guernic. Implementation of the data-flow synchronous language Signal. In Programming Languages Design and Implementation (PLDI), pages 163--173. ACM, 1995. Google ScholarDigital Library
- K. Bauer and K. Schneider. From synchronous programs to symbolic representations of hybrid systems. In HSCC, pages 41--50, 2010. Google ScholarDigital Library
- A. Benveniste, T. Bourke, B. Caillaud, and M. Pouzet. Divide and recycle: types and compilation for a hybrid synchronous language. In LCTES, Chicago, USA, Apr. 2011. ACM. Google ScholarDigital Library
- A. Benveniste, T. Bourke, B. Caillaud, and M. Pouzet. Non-Standard Semantics of Hybrid Systems Modelers. Journal of Computer and System Sciences (JCSS), 78(3):877--910, May 2012. Google ScholarDigital Library
- G. Berry. The constructive semantics of pure Esterel. 1999.Google Scholar
- T. Bourke and M. Pouzet. Zélus, a Synchronous Language with ODEs. In HSCC, Philadelphia, USA, April 8-11 2013. ACM. Google ScholarDigital Library
- L. Carloni, R. Passerone, A. Pinto, and A. Sangiovanni-Vincentelli. Languages and tools for hybrid systems design. Foundations & Trends in Electronic Design Automation, vol. 1, 2006. Google ScholarDigital Library
- G. Dahlquist and Å. Björck. Numerical Methods in Scientific Computing: Volume 1. SIAM, 2008. Google ScholarDigital Library
- B. Denckla and P. Mosterman. Stream- and state-based semantics of hierarchy in block diagrams. In 17th IFAC World Congress, pages 7955--7960, South Korea, 2008.Google ScholarCross Ref
- J. Eker, J. W. Janneck, E. A. Lee, J. Liu, X. Liu, J. Ludvig, S. Neuendorffer, S. Sachs, and Y. Xiong. Taming heterogeneity - the Ptolemy approach. Proc. IEEE, 91(1):127--144, Jan. 2003.Google Scholar
- L. Gérard, A. Guatto, C. Pasteur, and M. Pouzet. A Modular Memory Optimization for Synchronous Data-Flow Languages. Application to Arrays in a Lustre Compiler. In LCTES, Beijing, June 12--13 2012.Google Scholar
- N. Halbwachs, P. Caspi, P. Raymond, and D. Pilaud. The synchronous dataflow programming language lustre. Proceedings of the IEEE, 79(9):1305--1320, September 1991.Google ScholarCross Ref
- N. Halbwachs, P. Raymond, and C. Ratel. Generating efficient code from data-flow programs. In PLILP, LNCS, Passau (Germany), August 1991.Google Scholar
- G. Kahn. The semantics of a simple language for parallel programming. In IFIP 74 Congress. North Holland, Amsterdam, 1974.Google Scholar
- E. A. Lee and H. Zheng. Operational semantics of hybrid systems. In HSCC, Zurich, Switzerland, Mar. 2005. Google ScholarDigital Library
- E. A. Lee and H. Zheng. Leveraging synchronous language principles for heterogeneous modeling and design of embedded systems. In EMSOFT, 2007. Google ScholarDigital Library
- T. Lindstrom. An invitation to non standard analysis. In N. Cutland, editor, Nonstandard analysis and its applications. Cambridge Univ. Press, 1988.Google Scholar
- O. Maler, Z. Manna, and A. Pnueli. From Timed to Hybrid Systems. In Real-Time: Theory in Practice, volume 600 of LNCS, pages 447--484. Springer, 1992. Google ScholarDigital Library
- The Mathworks, Natick, MA, U.S.A. Simulink 7 - Reference, 7.6 edition, Sept. 2010.Google Scholar
- The Mathworks, Natick, MA, U.S.A. Simulink 7 - User's Guide, 7.5 edition, Mar. 2010.Google Scholar
- B. C. Pierce. Types and Programming Languages. MIT Press, 2002. Google ScholarDigital Library
- M. Pouzet. Lucid Synchrone, version 3. Tutorial and reference manual. Université Paris-Sud, LRI, Apr. 2006.Google Scholar
- M. Pouzet and P. Raymond. Modular Static Scheduling of Synchronous Data-flow Networks: An efficient symbolic representation. In EMSOFT, Grenoble, France, Oct. 2009. ACM. Google ScholarDigital Library
Index Terms
- A type-based analysis of causality loops in hybrid systems modelers
Recommendations
Divide and recycle: types and compilation for a hybrid synchronous language
LCTES '10Hybrid modelers such as Simulink have become corner stones of embedded systems development. They allow both discrete controllers and their continuous environments to be expressed in a single language. Despite the availability of such tools, there remain ...
Divide and recycle: types and compilation for a hybrid synchronous language
LCTES '11: Proceedings of the 2011 SIGPLAN/SIGBED conference on Languages, compilers and tools for embedded systemsHybrid modelers such as Simulink have become corner stones of embedded systems development. They allow both discrete controllers and their continuous environments to be expressed in a single language. Despite the availability of such tools, there remain ...
A hybrid synchronous language with hierarchical automata: static typing and translation to synchronous code
EMSOFT '11: Proceedings of the ninth ACM international conference on Embedded softwareHybrid modeling tools like Simulink have evolved from simulation platforms into development platforms on which testing, verification and code generation are also performed. It is critical to ensure that the results of simulation, compilation and ...
Comments