LTH-image

The OpenModelica Environment including Static and Dynamic Debugging of Modelica Models and Systems Engineering / Design verification

Peter Fritzson, Linköping University, Department of Computer and Information Science, PELAB - Programming Environment Laboratory

Abstract:

This talk gives an overview of the OpenModelica environment, especially
highlighting two aspects: 1) model debugging and 2) systems engineering including design verification against requirements. 

The high abstraction level of equation-based object-oriented
languages (EOO) such as Modelica has the drawback that programming and
modeling errors are often hard to find. In this paper we present static and
dynamic debugging methods for Modelica models and a debugger prototype
that addresses several of those problems. The goal is an integrated debugging
framework that combines classical debugging techniques with special
techniques for equation-based languages partly based on graph visualization
and interaction. 

The static transformational debugging functionality addresses the problem
that model compilers are optimized so heavily that it is hard to tell the
origin of an equation during runtime. This work proposes and implements a
prototype of a method that is efficient with less than one percent overhead,
yet manages to keep track of all the transformations/operations that the
compiler performs on the model. Modelica models often contain functions
and algorithm sections with algorithmic code. The fraction of algorithmic
code is increasing since Modelica, in addition to equation-based modeling,
is also used for embedded system control code as well as symbolic model
transformations in applications using the MetaModelica language extension.

Our earlier work in debuggers for the algorithmic subset of Modelica
used instrumentation-based techniques which are portable but turned out to have too much overhead for large applications. The new debugger is the first Modelica debugger that can operate without run-time information from instrumented code. Instead it communicates with a low-level C-language symbolic debugger to directly extract information from a running executable, set and remove break-points, etc. This is made possible by the new bootstrapped OpenModelica compiler which keeps track of a detailed mapping from the high level Modelica code down to the generated C code compiled to machine code.
The debugger is operational, supports both standard Modelica data structures
and tree/list data structures, and operates efficiently on large applications
such as the OpenModelica compiler with more than 100 000 lines of
code. Moreover, an integrated debugging approach is proposed that combines
static and dynamic debugging. To our knowledge, this is the first Modelica
debugger that supports transformational debugging and algorithmic code
debugging.
 
The second aspect, systems engineering including design verification against requirements, is supported by the OpenModelica ModelicaML profile. This profile implements the vVDR (Virtual Verification of Designs against Requirements) method that enables a model-based design verification against requirements. In the vVDR method there are different kinds of models that are created independently and that will become dependent and need to be related to each other in some concrete verification usage. The aim is to reduce modeling errors and modeling effort by automatically generating composite verification models from their constituting sub-models based on data dependencies that are defined using so-called mediators, which allow expressing data dependencies between models without affecting, i.e., changing, the models themselves.

Presentation Slides

Biography:Peter Fritzson is Professor and research director of the Programming Environment Laboratory, at Linköping University. He is also director of the Open Source Modelica Consortium, director of the MODPROD center for model-based product development, and vice chairman of the Modelica Association, organizations he helped to establish. During 1999-2007 he served as chairman of the Scandinavian Simulation Society, and secretary of the European simulation organization, EuroSim. Prof. Fritzson's current research interests are in software technology, especially programming languages, tools and environments; parallel and multi-core computing; compilers and compiler generators, high level specification and modeling languages with special emphasis on tools for object-oriented modeling and simulation where he is one of the main contributors and founders of the Modelica language. Professor Fritzson has  authored or co-authored more than 250 technical publications, including 17 books/proceedings.