Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

Starting to model SCCharts with the KIELER tool usually includes the following steps:



Hint

You can click image to enlarge them.

Installing KIELER

Download a suitable KIELER version for your operation system.
The zip bundles are fully compiled and ready-to-run, they do not need any further installation process. Just save and extract them to/at the location of your choice and start the KIELER executable.

When you start the KIELER executable, you probably need to set a (new) workspace location of your choice.

If you selected a new workspace location, you will see a welcome screen like this:

Dismiss this "Welcome" tab. After that you'll be all set and KIELER should look like this:

In order to prepare modeling, we must create a project. Right-click on the File entry of the top menu bar, select New and click on Project.

Select a Project in the General folder and click on next, then enter a project name, here Example, and click on Finish.

Now you have a project where you can create and model your SCCharts.

Modeling SCCharts

To create a new SCChart, you first need to create a new file. Click on File → New → File in the top menu, similar to creating a new project.
Select your project (where you want to create the new file) and set a file name, here abro.sctx. Make sure you use the .sctx file extension, this is necessary to enable the SCCharts language support for this file.

A new editor tab will automatically open and you can start modeling your SCCharts.
For this example you may copy paste the following code for the ABRO SCChart into your editor. You can find further examples and an overview about the SCCharts syntax in the sibling pages of this wiki.

scchart ABRO {
  input bool A, B, R
  output bool O

  initial state ABO {
    entry do O = false

    initial state WaitAB {
      region {
        initial state wA
          if A go to dA 
  
        final state dA
      }
      
      region {
        initial state wB
          if B go to dB
  
        final state dB
      }
    }
    join to done do O = true

    state done
  }
  if R abort to ABO 
}

When you press the save button (or ctrl+S / cmd+S) the model is saved and the diagram view on the right automatically updates and presents the graphical representation of your ABRO SCChart.

The editor provides content assist (Ctrl+Space) to help you find the correct keywords or references to state or variables.

Compiling SCCharts

The KIELER Compiler (KiCo) provides different compilation systems to translate SCCharts into source code for different host languages.
KiCo is controlled via the Kieler Compiler view.

The combo box in the toolbar of this view allows to select a compilation system for the model in the active editor. In the screenshot, the Netlist-based Compilation into C code is about to be selected.
The view itself show a diagram of all the processors in the currently selected compilation system. Gray nodes are groups of processors which can be expanded by a double click.

The button before the combo box (highlighted by the red arrow in the screenshot) starts the compilation using the model in the active editor and the selected compilation system.
The KiCo view updates during compilation and shows all the available intermediate results per processor as blue boxes. When the compilation is finished the diagram view updates and shows the end result of the compilation (in this example the C code).

The intermediate results can be inspected by clicking on the processor itself (to select the last one) or by clicking on a blue box. The diagram view will display the selected intermediate result.
In the screenshot below the SCG Netlist-based group is expanded and the fist processor in this group, Dependencies, is selected. Consequently, the diagram view shows a Sequentially Constructive Graph (SCG) with dependencies.

Simulating SCCharts

SCCharts can be simulated to inspect their behavior.

First we recommend switching to the KIELER Simulation perspective.

TO BE CONTINUED

Simulation requires gcc/java

  • No labels