“Towards Qualifiable Code Generation from a Clocked Synchronous Subset of Modelica”

Authors: Bernhard Thiele, Alois Knoll and Peter Fritzson,
Affiliation: Linköping University and Technische Universität München
Reference: 2015, Vol 36, No 1, pp. 23-52.

Keywords: Modelica, Automatic Code Generation, Model-Based Development, Safety-Relevant Systems

Abstract: So far no qualifiable automatic code generators (ACGs) are available for Modelica. Hence, digital control applications can be modeled and simulated in Modelica, but require tedious additional efforts (e.g., manual reprogramming) to produce qualifiable target system production code. In order to more fully leverage the potential of a model-based development (MBD) process in Modelica, a qualifiable automatic code generator is needed. Typical Modelica code generation is a fairly complex process which imposes a huge development burden to any efforts of tool qualification. This work aims at mapping a Modelica subset for digital control function development to a well-understood synchronous data-flow kernel language. This kernel language allows to resort to established compilation techniques for data-flow languages which are understood enough to be accepted by certification authorities. The mapping is established by providing a translational semantics from the Modelica subset to the synchronous data-flow kernel language. However, this translation turned out to be more intricate than initially expected and has given rise to several interesting issues that require suitable design decisions regarding the mapping and the language subset.

PDF PDF (1088 Kb)        DOI: 10.4173/mic.2015.1.3

DOI forward links to this article:
[1] Simon Foster, Bernhard Thiele, Ana Cavalcanti and Jim Woodcock (2017), doi:10.1007/978-3-319-52228-9_3
References:
[1] Benveniste, A., Edwards, S.A., Halbwachs, N., LeGuernic, P., and de Simone, R. (2003). The synchronous languages 12 years later, In Proceedings of the IEEE, volume 91 (1). pages 64--83. doi:10.1109/JPROC.2002.805826
[2] Biernacki, D., Colaco, J.-L., Hamon, G., and Pouzet, M. (2008). Clock-directed modular code generation for synchronous data-flow languages, SIGPLAN Not.. 43(7):121--130. doi:10.1145/1379023.1375674
[3] Boussinot, F. and DeSimone, R. (1991). The ESTEREL language, Proceedings of the IEEE. 79(9):1293--1304. doi:10.1109/5.97299
[4] Broman, D. (2010). Meta-Languages and Semantics for Equation-Based Modeling and Simulation, Ph.D. thesis, Linköping University, PELAB - Programming Environment Laboratory, The Institute of Technology.
[5] Broy, M., Krcmar, H., Zimmermann, J., and Kirstan, S. (2011). Einfluss des Software-Designs auf die Wirtschaftlichkeit von Software-Entwicklungen, ATZelektronik. 02:34--37.
[6] Caspi, P., Curic, A., Maignan, A., Sofronis, C., Tripakis, S., and Niebert, P. (2003). From Simulink to SCADE/Lustre to TTA: a layered approach for distributed embedded applications, In Proceedings of the 2003 ACM SIGPLAN conference on Language, compiler, and tool for embedded systems, LCTES '03. ACM, New York, NY, USA, pages 153--162. doi:10.1145/780732.780754
[7] Caspi, P., Pilaud, D., Halbwachs, N., and Plaice, J.A. (1987). Lustre: a declarative language for real-time programming, In Proceedings of the 14th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, POPL '87. ACM, New York, NY, USA, pages 178--188. doi:10.1145/41625.41641
[8] Colaco, J.-L., Pagano, B., and Pouzet, M. (2005). A conservative extension of synchronous data-flow with state machines, In Proceedings of the 5th ACM International Conference on Embedded Software, EMSOFT '05. ACM, New York, NY, USA, pages 173--182. doi:10.1145/1086228.1086261
[9] Colaco, J.-L. and Pouzet, M. (2003). Clocks as First Class Abstract Types, In R.Alur and I.Lee, editors, Embedded Software, volume 2855 of Lecture Notes in Computer Science, pages 134--155. Springer Berlin Heidelberg. doi:10.1007/978-3-540-45212-6_10
[10] Ebert, C. and Jones, C. (2009). Embedded software: Facts, figures, and future, Computer. 42:42--52. doi:10.1109/MC.2009.118
[11] Elmqvist, H., Otter, M., and Mattsson, S.E. (2012). Fundamentals of Synchronous Control in Modelica, In M.Otter and D.Zimmer, editors, 9th Int. Modelica Conference. Munich, Germany. doi:10.3384/ecp1207615
[12] Frank, S., Grabmuller, M., Hofstedt, P., Kleeblatt, D., Pepper, P., Mai, P.R., and Schneider, S.-A. (2008). Safety of Compilers and Translation Techniques -- Status quo of Technology and Science, In Automotive – Safety & Security. 2008.
[13] Fritzson, P. (2014). Principles of Object Oriented Modeling and Simulation with Modelica 3, 3: A Cyber-Physical Approach. Wiley IEEE Press.
[14] Fritzson, P., Pop, A., Broman, D., and Aronsson, P. (2009). Formal Semantics Based Translator Generation and Tool Development in Practice, In Software Engineering Conference. ASWEC '09. Australian. pages 256--266. doi:10.1109/ASWEC.2009.46
[15] Hamon, G. and Pouzet, M. (2000). Modular Resetting of Synchronous Data-flow Programs, In ACM International conference on Principles of Declarative Programming (PPDP'00). Montreal, Canada. doi:10.1145/351268.351300
[16] Harel, D. (1987). Statecharts: a visual formalism for complex systems, Science of Computer Programming. 8(3):231--274. doi:10.1016/0167-6423(87)90035-9
[17] Hatcliff, J., Wassyng, A., Kelly, T., Comar, C., and Jones, P. (2014). Certifiably Safe Software-Dependent Systems: Challenges and Directions, In Proceedings of the on Future of Software Engineering, FOSE 2014. ACM, Hyderabad, India. doi:10.1145/2593882.2593895
[18] ISO 26262-8:2011. (2011). Road vehicles -- Functional safety -- Part 8: Supporting processes, International Organization for Standardization.
[19] Åkesson, J., Ekman, T., and Hedin, G. (2010). Implementation of a Modelica compiler using JastAdd attribute grammars, Science of Computer Programming. 75(1–2):21--38. Special Issue on ETAPS 2006 and 2007 Workshops on Language Descriptions, Tools, and Applications (LDTA ’06 and ’07). doi:10.1016/j.scico.2009.07.003
[20] Kågedal, D. and Fritzson, P. (1998). Generating a Modelica compiler from natural semantics specifications, In Proceedings of the 1998 Summer Computer Simulation Conference (SCSC'98). 1998.
[21] LeGuernic, P., Gautier, T., LeBorgne, M., and LeMaire, C. (1991). Programming real-time applications with SIGNAL, Proceedings of the IEEE. 79(9):1321--1336. doi:10.1109/5.97301
[22] Lublinerman, R., Szegedy, C., and Tripakis, S. (2009). Modular code generation from synchronous block diagrams: Modularity vs, code size. In ACM SIGPLAN Notices, volume44. ACM, pages 78--89. doi:10.1145/1594834.1480893
[23] Modelica Association. (2012). Modelica---A Unified Object-Oriented Language for Systems Modeling v3, 3. Standard Specification. Available at http://www.modelica.org/.
[24] Odersky, M., Spoon, L., and Venners, B. (2010). Programming in Scala, Artima Press, second edition.
[25] Otter, M., Thiele, B., and Elmqvist, H. (2012). A Library for Synchronous Control Systems in Modelica, In M.Otter and D.Zimmer, editors, 9th Int. Modelica Conference. Munich, Germany. doi:10.3384/ecp1207627
[26] Sauvage, S. and Bouali, A. (2006). Development Approaches in Software Development, In Embedded Real Time Software (ERTS). Toulouse, France.
[27] Schneider, S.-A., Lovric, T., and Mai, P.R. (2009). The Validation Suite Approach to Safety Qualification of Tools, In SAE World Congress. SAE International, Detroit, MI, USA, 2009. doi:10.4271/2009-01-0746
[28] Schäuffele, J. and Zurawka, T. (2010). Automotive Software Engineering, Vieweg + Teubner, Wiesbaden, 4 edition.
[29] Sloane, A.M. (2011). Lightweight Language Processing in Kiama, In J.Fernandes, R.Lämmel, J.Visser, and J.Saraiva, editors, Generative and Transformational Techniques in Software Engineering III, volume 6491 of Lecture Notes in Computer Science, pages 408--425. Springer Berlin Heidelberg. doi:10.1007/978-3-642-18023-1_12
[30] Åström, K.J. and Hägglund, T. (1995). PID Controllers: Theory, Design, and Tuning, Instrument Society of America.
[31] Åström, K.J. and Wittenmark, B. (1997). Computer-Controlled Systems: Theory and Design, Prentice-Hall, Inc.
[32] Stürmer, I., Conrad, M., Fey, I., and Dörr, H. (2006). Experiences with Model and Autocode Reviews in Model-based Software Development, In Proceedings of the 2006 international workshop on Software engineering for automotive systems, SEAS '06. ACM, New York, NY, USA, pages 45--52. doi:10.1145/1138474.1138483
[33] Thiele, B., Schneider, S.-A., and Mai, P.R. (2012). A Modelica Sub-and Superset for Safety-Relevant Control Applications, In M.Otter and D.Zimmer, editors, 9th Int. Modelica Conference. Munich, Germany doi:10.3384/ecp12076455


BibTeX:
@article{MIC-2015-1-3,
  title={{Towards Qualifiable Code Generation from a Clocked Synchronous Subset of Modelica}},
  author={Thiele, Bernhard and Knoll, Alois and Fritzson, Peter},
  journal={Modeling, Identification and Control},
  volume={36},
  number={1},
  pages={23--52},
  year={2015},
  doi={10.4173/mic.2015.1.3},
  publisher={Norwegian Society of Automatic Control}
};