Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The incremental project builder is run by Eclipse either in the background when resources changes (Project > Build automatically), or manually by the user (Project > Build Project). What and how files are built can be configured using a new DSL (kibuild files). Errors and warnings that occur during the build are added as markers to the resources where they occur, which is a known concept in the Eclipse IDE. For instance when working with Java, compiler errors are added as markers to files when they are saved. This is now also possible for SCCharts text files and provides faster compiler feedback to users, e.g. because a model can not be compiled, as long as the automatic build is active.

Several actions are performed when a project is built:

  • Model files are compiled
    • Optionally a template is processed for each model to generate the simulation code for the model.
  • Simulation code is compiled to an executable, which can be started using the new simulation
  • Freemarker templates are processed to generate code.
    Depending of the type of the template, additional variables are injected into the template
    • Wrapper code templates are used to create the wrapper code for a specific model.
      Annotations on inputs and outputs in the model can be used to define which code snippets are injected as part of the build. These code snippets typically contain code to read or write the corresponding inputs and outputs.
    • Simulation code templates are used to create wrapper code for simulation of models.
      Thus it is a special form of wrapper code template. Instead of user defined annotations, the injected code snippets are determined by the variables in the model.
      This kind of template can be configured as part of a model compiler to automatically generate the simulation for all compiled models.
    • Simple templates are self contained and no additional variables are injected.

Corresponding to the actions that are performed during the build, its configuration consists of model compilers, simulation compilers and template processors. A template processor is either a simple template processor, wrapper code template processor or simulation template processor.

If all of these are defined, an incremental project build could consist for example of the following steps:

  • Build a model file A.sctx
    • Afterwards process a simulation template to generate its simulation code Sim_A.c
  • Compile the simulation code Sim_A.c to an executable using gcc
  • Create wrapper code for the model, that is ready to be deployed

Note that if the Build automatically option is set, it is possible to (re-)start a simulation without the need to (re-)compile the corresponding model beforehand. This is because the simulation executable has been created in the background as part of the build and is updated if the model changes. This results in a faster code-test-workflow compared to the previous approach, in which a model was always re-compiled before its simulation was started
Several tasks are performed to build a project:

  • Compilation of models
  • Generation and compilation of simulation code, typically for each compiled model
  • Processing of templates and generation of wrapper code

What tasks are performed exactly when a project is build can be configured in a new DSL (kibuild files).

The new incremental project builder replaced the KiCo launch configuration that was used before to compile models and generate wrapper code.

Integrated Simulation

The simulation backend has been rewritten to be more lightweight, flexible and transparent and to better integrate in the workflow.

...