| ... |
... |
@@ -1,11 +1,14 @@ |
| 1 |
|
-= **SCCharts Examples** = |
|
1 |
+[[~[~[image:attach:SCCharts (pre 1.0)@download.png~]~]>>url:http://rtsys.informatik.uni-kiel.de/confluence/display/KIELER/SCCharts#SCCharts-Downloads||shape="rect"]] [[~[~[image:attach:SCCharts (pre 1.0)@onlinecompiler.png~]~]>>url:http://www.sccharts.com||shape="rect"]] (% class="confluence-link" %)[[image:attach:Command Line Compiler@commandlinecompiler2.png]][[doc:KIELER.Home.SCCharts.Previous Versions (Deprecated Documentation).SCCharts (pre 1\.0).Command Line Compiler.WebHome]](%%) [[image:attach:SCCharts (pre 1.0)@quickstart.png]][[doc:Quick Start Guide (pre 0\.13)]] |
| 2 |
2 |
|
| 3 |
|
-In the following, you find some examples used for evaluation. Be advised that there currently is no tool integrated evaluation possible. Please refer to the SCCharts superpage for the [[project status>>doc:SCCharts]] and [[known limitations>>doc:SCCharts]]. You may use our [[online compiler>>doc:Online Compiler]] or the [[command line compiler >>doc:Command Line Compiler]]to play around with the following SCCharts. On the right side you'll find the textual SCChart (SCT) description, on the left side you see the equivalent synthesized SCChart diagram for it. You can use our [[online SCChart synthesis>>doc:Command Line Rendering]] for rendering SCCharts diagrams from textual SCCharts descriptions. |
|
3 |
+= SCCharts Examples = |
| 4 |
4 |
|
|
5 |
+A few SCCharts examples... |
|
6 |
+ |
|
7 |
+(% class="wrapped" %) |
| 5 |
5 |
|=((( |
| 6 |
6 |
Example |
| 7 |
7 |
)))|=((( |
| 8 |
|
- |
|
11 |
+\\ |
| 9 |
9 |
)))|=((( |
| 10 |
10 |
SCChart (Graphical) |
| 11 |
11 |
)))|=(% colspan="1" %)(% colspan="1" %) |
| ... |
... |
@@ -14,16 +14,175 @@ |
| 14 |
14 |
))) |
| 15 |
15 |
|(% colspan="1" %)(% colspan="1" %) |
| 16 |
16 |
((( |
|
20 |
+= ABO = |
|
21 |
+)))|(% colspan="1" %)(% colspan="1" %) |
|
22 |
+((( |
|
23 |
+\\ |
|
24 |
+)))|(% colspan="1" %)(% colspan="1" %) |
|
25 |
+((( |
|
26 |
+(% class="content-wrapper" %) |
|
27 |
+((( |
|
28 |
+[[image:attach:abo.png]] |
|
29 |
+))) |
|
30 |
+)))|(% colspan="1" %)(% colspan="1" %) |
|
31 |
+((( |
|
32 |
+(% class="content-wrapper" %) |
|
33 |
+((( |
|
34 |
+{{code title="ABO.sct"}} |
|
35 |
+@VHLayout |
|
36 |
+scchart ABO { |
|
37 |
+ input output bool A; |
|
38 |
+ input output bool B; |
|
39 |
+ output bool O1; |
|
40 |
+ output bool O2; |
|
41 |
+ region: |
|
42 |
+ |
|
43 |
+ initial state Init |
|
44 |
+ --> WaitAB immediate with / O1 = false; O2 = false; |
|
45 |
+ state WaitAB { |
|
46 |
+ region HandleA: |
|
47 |
+ initial state WaitA |
|
48 |
+ --> DoneA immediate with A / B = true; O1 = true; |
|
49 |
+ final state DoneA; |
|
50 |
+ region HandleB: |
|
51 |
+ initial state WaitB |
|
52 |
+ --> DoneB with B / O1 = true; |
|
53 |
+ final state DoneB; |
|
54 |
+ } |
|
55 |
+ >-> GotAB with / O1 = false; O2 = true; |
|
56 |
+ state GotAB; |
|
57 |
+} |
|
58 |
+{{/code}} |
|
59 |
+))) |
|
60 |
+))) |
|
61 |
+|(% colspan="1" %)(% colspan="1" %) |
|
62 |
+((( |
|
63 |
+= clock = |
|
64 |
+ |
|
65 |
+(Referenced SCCharts Example) |
|
66 |
+ |
|
67 |
+**To enable the referenced SCCharts feature,** |
|
68 |
+ |
|
69 |
+**activate the Xtext nature for your project!** |
|
70 |
+)))|(% colspan="1" %)(% colspan="1" %) |
|
71 |
+((( |
|
72 |
+\\ |
|
73 |
+)))|(% colspan="1" %)(% colspan="1" %) |
|
74 |
+((( |
|
75 |
+(% class="content-wrapper" %) |
|
76 |
+((( |
|
77 |
+[[image:attach:delay.png]] |
|
78 |
+ |
|
79 |
+[[image:attach:emitter.png]] |
|
80 |
+ |
|
81 |
+[[image:attach:clock2h.png]] |
|
82 |
+))) |
|
83 |
+)))|(% colspan="1" %)(% colspan="1" %) |
|
84 |
+((( |
|
85 |
+(% class="content-wrapper" %) |
|
86 |
+((( |
|
87 |
+{{code language="sct" title="shifter3.sct"}} |
|
88 |
+scchart delay { |
|
89 |
+ input int ticksToWait; |
|
90 |
+ input bool clock; |
|
91 |
+ int counter = 0; |
|
92 |
+ initial state init |
|
93 |
+ --> done immediate with |
|
94 |
+ counter >= ticksToWait |
|
95 |
+ --> init with |
|
96 |
+ clock / counter = counter + 1; |
|
97 |
+ final state done; |
|
98 |
+} |
|
99 |
+{{/code}} |
|
100 |
+ |
|
101 |
+{{code language="sct" title="shifter3.sct"}} |
|
102 |
+scchart emitter { |
|
103 |
+ input bool clock; |
|
104 |
+ input bool delay; |
|
105 |
+ output bool emit = false; |
|
106 |
+ initial state wait |
|
107 |
+ references delay |
|
108 |
+ bind clock to clock, |
|
109 |
+ ticksToWait to delay |
|
110 |
+ >-> emit; |
|
111 |
+ |
|
112 |
+ state emit { |
|
113 |
+ entry / emit = true; |
|
114 |
+ exit / emit = false; |
|
115 |
+ } |
|
116 |
+ --> wait; |
|
117 |
+} |
|
118 |
+{{/code}} |
|
119 |
+ |
|
120 |
+{{code language="sct" title="shifter3.sct"}} |
|
121 |
+scchart clock { |
|
122 |
+ input bool msClock; |
|
123 |
+ output bool second; |
|
124 |
+ output bool minute; |
|
125 |
+ output bool hour; |
|
126 |
+ const int SEC = 1000; |
|
127 |
+ const int MIN = 60; |
|
128 |
+ const int HOUR = 60; |
|
129 |
+ region seconds: |
|
130 |
+ initial state seconds |
|
131 |
+ references emitter |
|
132 |
+ bind clock to msClock, |
|
133 |
+ metrum to SEC, |
|
134 |
+ emit to second |
|
135 |
+ >-> seconds; |
|
136 |
+ |
|
137 |
+ region minutes: |
|
138 |
+ initial state minutes |
|
139 |
+ references emitter |
|
140 |
+ bind clock to second, |
|
141 |
+ metrum to MIN, |
|
142 |
+ emit to minute |
|
143 |
+ >-> minutes; |
|
144 |
+ |
|
145 |
+ region hours: |
|
146 |
+ initial state hours |
|
147 |
+ references emitter |
|
148 |
+ bind clock to minute, |
|
149 |
+ metrum to HOUR, |
|
150 |
+ emit to hour |
|
151 |
+ >-> hours; |
|
152 |
+} |
|
153 |
+{{/code}} |
|
154 |
+))) |
|
155 |
+))) |
|
156 |
+ |
|
157 |
+= SCCharts Evaluation Examples = |
|
158 |
+ |
|
159 |
+In the following, you find some examples used for evaluation. Be advised that there currently is no tool integrated evaluation possible. Please refer to the SCCharts superpage for the [[project status>>doc:KIELER.Home.SCCharts.Previous Versions (Deprecated Documentation).SCCharts (pre 1\.0).WebHome]] and [[known limitations>>doc:KIELER.Home.SCCharts.Previous Versions (Deprecated Documentation).SCCharts (pre 1\.0).WebHome]]. You may use our [[online compiler>>doc:Online Compiler]] or the [[command line compiler >>doc:KIELER.Home.SCCharts.Previous Versions (Deprecated Documentation).SCCharts (pre 1\.0).Command Line Compiler.WebHome]]to play around with the following SCCharts. On the right side you'll find the textual SCChart (SCT) description, on the left side you see the equivalent synthesized SCChart diagram for it. You can use our [[online SCChart synthesis>>doc:KIELER.Home.SCCharts.Previous Versions (Deprecated Documentation).SCCharts (pre 1\.0).Command Line Rendering.WebHome]] for rendering SCCharts diagrams from textual SCCharts descriptions. |
|
160 |
+ |
|
161 |
+(% class="wrapped" %) |
|
162 |
+|=((( |
|
163 |
+Example |
|
164 |
+)))|=((( |
|
165 |
+\\ |
|
166 |
+)))|=((( |
|
167 |
+SCChart (Graphical) |
|
168 |
+)))|=(% colspan="1" %)(% colspan="1" %) |
|
169 |
+((( |
|
170 |
+SCChart (Textual SCT) |
|
171 |
+))) |
|
172 |
+|(% colspan="1" %)(% colspan="1" %) |
|
173 |
+((( |
| 17 |
17 |
= shifter3 = |
| 18 |
18 |
)))|(% colspan="1" %)(% colspan="1" %) |
| 19 |
19 |
((( |
| 20 |
|
- |
|
177 |
+\\ |
| 21 |
21 |
)))|(% colspan="1" %)(% colspan="1" %) |
| 22 |
22 |
((( |
|
180 |
+(% class="content-wrapper" %) |
|
181 |
+((( |
| 23 |
23 |
[[image:attach:PLDI'14 Artifact on SCCharts@shifter3.png]] |
|
183 |
+))) |
| 24 |
24 |
)))|(% colspan="1" %)(% colspan="1" %) |
| 25 |
25 |
((( |
| 26 |
|
-{{code title="shifter3.sct"}} |
|
186 |
+(% class="content-wrapper" %) |
|
187 |
+((( |
|
188 |
+{{code language="sct" title="shifter3.sct"}} |
| 27 |
27 |
scchart shifter3 { |
| 28 |
28 |
input signal int I = 1; |
| 29 |
29 |
signal int S0; |
| ... |
... |
@@ -41,15 +41,21 @@ |
| 41 |
41 |
} |
| 42 |
42 |
{{/code}} |
| 43 |
43 |
))) |
|
206 |
+))) |
| 44 |
44 |
|((( |
| 45 |
45 |
= reincarnation = |
| 46 |
46 |
)))|((( |
| 47 |
|
- |
|
210 |
+\\ |
| 48 |
48 |
)))|((( |
|
212 |
+(% class="content-wrapper" %) |
|
213 |
+((( |
| 49 |
49 |
[[image:attach:PLDI'14 Artifact on SCCharts@reincarnation.png]] |
|
215 |
+))) |
| 50 |
50 |
)))|(% colspan="1" %)(% colspan="1" %) |
| 51 |
51 |
((( |
| 52 |
|
-{{code title="reincarnation.sct"}} |
|
218 |
+(% class="content-wrapper" %) |
|
219 |
+((( |
|
220 |
+{{code language="sct" title="reincarnation.sct"}} |
| 53 |
53 |
scchart reincarnation { |
| 54 |
54 |
input signal A; |
| 55 |
55 |
output signal gotS; |
| ... |
... |
@@ -71,15 +71,21 @@ |
| 71 |
71 |
} |
| 72 |
72 |
{{/code}} |
| 73 |
73 |
))) |
|
242 |
+))) |
| 74 |
74 |
|((( |
| 75 |
75 |
= cabin = |
| 76 |
76 |
)))|((( |
| 77 |
|
- |
|
246 |
+\\ |
| 78 |
78 |
)))|((( |
|
248 |
+(% class="content-wrapper" %) |
|
249 |
+((( |
| 79 |
79 |
[[image:attach:PLDI'14 Artifact on SCCharts@cabin.png]] |
|
251 |
+))) |
| 80 |
80 |
)))|(% colspan="1" %)(% colspan="1" %) |
| 81 |
81 |
((( |
| 82 |
|
-{{code title="cabin.sct"}} |
|
254 |
+(% class="content-wrapper" %) |
|
255 |
+((( |
|
256 |
+{{code language="sct" title="cabin.sct"}} |
| 83 |
83 |
scchart Cabin { |
| 84 |
84 |
input signal Stop; |
| 85 |
85 |
input signal CabinStopped; |
| ... |
... |
@@ -119,15 +119,21 @@ |
| 119 |
119 |
} |
| 120 |
120 |
{{/code}} |
| 121 |
121 |
))) |
|
296 |
+))) |
| 122 |
122 |
|((( |
| 123 |
123 |
= reactor control = |
| 124 |
124 |
)))|((( |
| 125 |
|
- |
|
300 |
+\\ |
| 126 |
126 |
)))|((( |
|
302 |
+(% class="content-wrapper" %) |
|
303 |
+((( |
| 127 |
127 |
[[image:attach:PLDI'14 Artifact on SCCharts@reactor-control.png]] |
|
305 |
+))) |
| 128 |
128 |
)))|(% colspan="1" %)(% colspan="1" %) |
| 129 |
129 |
((( |
| 130 |
|
-{{code title="reactor-control.sct"}} |
|
308 |
+(% class="content-wrapper" %) |
|
309 |
+((( |
|
310 |
+{{code language="sct" title="reactor-control.sct"}} |
| 131 |
131 |
scchart Module_ReactorControl { |
| 132 |
132 |
output signal PullOutRods; |
| 133 |
133 |
output signal PushInRods; |
| ... |
... |
@@ -175,3 +175,4 @@ |
| 175 |
175 |
} |
| 176 |
176 |
{{/code}} |
| 177 |
177 |
))) |
|
358 |
+))) |