Wiki source code of PLDI'14 Artifact on SCCharts

Version 14.1 by cmot on 2014/02/10 21:01

Hide last authors
cmot 7.1 1 [[image:attach:title7.png]]
2
3 = Modeling SCCharts with KIELER =
4
cmot 8.1 5 This tutorial should guide you if you like to model SCCharts with KIELER and use the circuit based software synthesis path as explained in our [1] [[PLDI'14 submission>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/downloads/papers/pldi14.pdf||shape="rect"]]. We will show you how to
cmot 7.1 6
cmot 9.1 7 ~1. Download & Start KIELER,
cmot 7.1 8
9 2. Model an SCChart, and
10
11 3. Generate C Code.
12
13 We will use a simple example here in order to illustrate the process. It should be straightforward to use these instructions in order to compile a more advanced SCChart. Note that there are known minor bugs in the current nightly build that will be fixed in the next release of KIELER 0.10.0. These bugs might in some cases prevent you from compiling more elaborate examples.
14
cmot 8.1 15
16
17 [1] PLDI submission: [[http:~~/~~/rtsys.informatik.uni-kiel.de/~~~~biblio/downloads/papers/pldi14.pdf>>url:http://rtsys.informatik.uni-kiel.de/%7Ebiblio/downloads/papers/pldi14.pdf||shape="rect" class="moz-txt-link-freetext"]]
18
cmot 9.1 19 = Download & Start KIELER =
cmot 7.1 20
cmot 9.1 21 [[Download>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/files/pldi14/||shape="rect"]] 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.
cmot 7.1 22
cmot 8.1 23 [[~[~[image:attach:RTEmagicC_download.png.png~]~]>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/files/pldi14/||shape="rect"]]
24
25 Download Location: [[http:~~/~~/rtsys.informatik.uni-kiel.de/~~~~kieler/files/pldi14/>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/files/pldi14/||shape="rect"]]
26
cmot 9.1 27 When you start the KIELER executable, you probably need to set a (new) workspace location of your choice. (Click on the images to enlarge them).
28
29 [[image:attach:kieler1.png]]
30
31 If you selected a new workspace location, you will see a welcome screen like this:
32
33 [[image:attach:kieler02.png]]
34
35 Dismiss this "Welcome" tab. After that you'll be all set and KIELER should look like this:
36
37 [[image:attach:kieler03.png]]
38
cmot 10.1 39 In order to prepare modeling, we must create a project. Right-click in the Project Explorer to do so.
40
41 [[image:attach:kieler04.png]]
42
43 Select a General Project and click on next, then enter a project name, e.g. pldi14 and click on finish:
44
45 [[image:attach:kieler05.png]][[image:attach:kieler06.png]]
46
47 Now KIELER should look like this:
48
49 [[image:attach:kieler07.png]]
50
51 Now you can proceed in modeling an SCChart as explained below.
52
cmot 7.1 53 = Model an SCChart =
54
cmot 11.1 55 Right-click on a project and create a (text) File:
cmot 7.1 56
cmot 11.1 57 [[image:attach:kieler08.png]]
58
59 Name it abo.sct:
60
61 [[image:attach:kieler09.png]]
62
cmot 12.1 63 The textual SCCharts Xtext based editor (for *.sct files) will automatically be opened:
64
65 [[image:attach:kieler10.png]]
66
67 Now start modeling an SCChart. For example copy & paste the following sct code of abo, the hello world of SCCharts:
68
69 {{code title="abo.sct"}}
cmot 13.1 70 @VHLayout
cmot 12.1 71 scchart ABO {
72 input output bool A;
73 input output bool B;
74 output bool O1;
75 output bool O2;
76 region:
77
78 initial state Init
79 --> WaitAB immediate with / O1 = false; O2 = false;
80 state WaitAB {
81 region HandleA:
82 initial state WaitA
83 --> DoneA immediate with A / B = true; O1 = true;
84 final state DoneA;
85 region HandleB:
86 initial state WaitB
87 --> DoneB with B / O1 = true;
88 final state DoneB;
89 }
90 >-> GotAB with / O1 = false; O2 = true;
91 state GotAB;
92 }
93 {{/code}}
94
cmot 13.1 95 As you save (Ctrl+S), KIELER will automatically draw the graphical SCChart diagram in a new KLigD view:
96
97 [[image:attach:kieler11.png]]
98
99 You may want to re-arrange views. Just drag the KLighD view to the right side:
100
101 [[image:attach:kieler12.png]]
102
cmot 14.1 103 You will now see how to generate a C tick function.
cmot 12.1 104
cmot 7.1 105 = Generate C Code =
106
cmot 14.1 107 You can do several transformations on SCCharts (*.sct files). Just right click the file you want to transform in the project explorer and select the Transform SCChart sub menu. As abo is already a Core SCCart you do not need the core transformations. Click the All Normalize Transformations, this will do the Split Trigger and Effects and the Surface and Depth transformations together (in this order).
108
109 [[image:attach:kieler13.png]]
110
111 After performing a transformation the transformed SCChart will open (together with it's KLighD diagram visualization):
112
113 [[image:attach:kieler14.png]]
114
115