Chair of Construction Machines and Conveying Technology OpenModelica Workshop 2011 A Modular OpenModelica Compiler Backend J. Frenkel W. Braun A. Pop M. Sjölund
Outline 1. Introduction 2. Concept of Modular Compiler Backend 3. Roadmap and Implementation Status 4. Conclusion Linköping. 07/02/2011 A Modular OpenModelica Compiler Backend. Slide 2
1. Introduction OpenModelica: - open-source Modelica-based modelling and simulation environment for industrial and academic usage - academic research and teaching OpenModelica Compiler Modelica Model Frontend Flat Model Backend Simul ation Linköping. 07/02/2011 A Modular OpenModelica Compiler Backend. Slide 3
1. Introduction Started in 2008 with OpenModelica as a user Since 2009 member of the development team - Bugfixes Multibody - Implemented new features Tearing Relaxation Multibody Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 4
1. Introduction What is planned for the backend? -Extend existing algorithms -Implemented new algorithms What is wrong with the backend? -Functions for symbolic manipulation are very low level Direct access to basic structures Consistency of equation system cannot be guaranteed Changes lead to unexpected side effects => High level symbolic manipulation is needed Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 5
1. Introduction Optimised form of the system of equations - analyse - evaluate system of equations - implement - test symbolic manipulation/optimisation algorithm ambitious task needs support from development environment clear, easy to understand and task related framework Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 6
1. Introduction Expectations Current Situation Redesign of the compiler Backend Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 7
2. Concept Packet Concept for Each Level Expression Solve Symbolic Math Symbol Simplify Equation Equation System Variable System Equation Algorithm Backend DAE-Handler for Index Reduction Matching Code Writer Implementation Modules for Optimisation Sorting Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 8
2. Concept Flat Model Input Phase Pre-Optimisation Transformation Phase Past-Optimisation Output Phase Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 9
2. Concept Flat Model Evaluate Parameter Input Phase Remove Alias Equations Pre-Optimisation Function Inlining Transformation Phase... Past-Optimisation Output Phase Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 10
2. Concept Flat Model Input Phase Matching Pre-Optimisation Transformation Phase DAE-Handler for Index Reduction: Dummy Derivative with Dynamic State Selection Index Reduction and Projection/Stabilization Past-Optimisation Sorting Output Phase Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 11
2. Concept Flat Model Input Phase Remove Alias Equations Inline Integration Function Inlining... Pre-Optimisation Transformation Phase Past-Optimisation Output Phase Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 12
2. Concept Flat Model Input Phase Pre-Optimisation Transformation Phase Past-Optimisation Output Phase Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 13
2. Concept Assemble your own Compiler! Flat Model evaluate parameter Inline Integration Function inlining Remove Alias Equations Tearing Relaxation... Input Phase Pre-Optimisation Transformation Phase Dummy Derivative Index Reduction with Projection Index Reduction with Stabilization Past-Optimisation Output Phase Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 14
2. Concept Interfaces Flat Model Input Phase Pre-Optimisation... Output External symbolic Equation system Optimisation Tool... User Module Transformation Phase... XML File Past-Optimisation Output Output Phase... Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 15
3. RoadMap/Status 1. Resort functions 2. Combine functions with the same purpose 3. Implement internal Interfaces for Equation System Pipeline 4. Improve performance of Equation System Pipeline 5. Improve existing Optimisation modules Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 16
3. RoadMap/Status 1. Resort functions DONE 2. Combine functions with the same purpose DONE 3. Implement internal Interfaces for Equation System Pipeline 4. Improve performance of Equation System Pipeline 5. Improve existing Optimisation modules From 24. 30. Oct. 2010 at Linköping University Backend Reorganisation Week Linköping, 07/02/2011 A Modular OpenModelica Compiler Backend Slide 17
4. Conclusion new Backend Implementation: - increase the clarity of the code - decrease the error-proneness - improve the extensibility - improve the maintainability - speed development process up improve compiler performance and dependability simplifies implementation of new features decrease barrier of becoming a compiler developer increases usability of the compiler Linköping. 07/02/2011 A Modular OpenModelica Compiler Backend. Slide 18
The End The Motion Platform at Dresden University can be visited before/during/after the Modelica Conference 2011 in Dresden. Linköping. 07/02/2011 A Modular OpenModelica Compiler Backend. Slide 19
The End Jens Frenkel Dresden University of Technology jens.frenkel@tu-dresden.de http://tu-dresden.de/bft Linköping. 07/02/2011 A Modular OpenModelica Compiler Backend. Slide 20