Changes for page Examples (sct)
on 2014/08/13 11:21
on 2016/04/18 15:24
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. als1 +XWiki.ssm - Content
-
... ... @@ -1,7 +1,148 @@ 1 -[[~[~[image:attach:SCCharts@download.png~]~]>>url:http://rtsys.informatik.uni-kiel.de/confluence/display/KIELER/SCCharts#SCCharts-Downloads||shape="rect"]] [[~[~[image:attach:SCCharts@onlinecompiler.png~]~]>>url:http://www.sccharts.com||shape="rect"]] (% class="confluence-link" %)[[image:attach:Command Line Compiler@commandlinecompiler2.png]][[doc:Command Line Compiler]](%%) [[image:attach:SCCharts@quickstart.png]][[doc:Quick Start Guide]] 1 +[[~[~[image:attach:SCCharts@download.png~]~]>>url:http://rtsys.informatik.uni-kiel.de/confluence/display/KIELER/SCCharts#SCCharts-Downloads||shape="rect"]] [[~[~[image:attach:SCCharts@onlinecompiler.png~]~]>>url:http://www.sccharts.com||shape="rect"]] (% class="confluence-link" %)[[image:attach:Command Line Compiler@commandlinecompiler2.png]][[doc:Command Line Compiler]](%%) [[image:attach:SCCharts@quickstart.png]][[doc:Quick Start Guide (pre 0\.13)]] 2 2 3 3 = SCCharts Examples = 4 4 5 +A few SCCharts examples... 6 + 7 +|=((( 8 +Example 9 +)))|=((( 10 + 11 +)))|=((( 12 +SCChart (Graphical) 13 +)))|=(% colspan="1" %)(% colspan="1" %) 14 +((( 15 +SCChart (Textual SCT) 16 +))) 17 +|(% colspan="1" %)(% colspan="1" %) 18 +((( 19 += ABO = 20 +)))|(% colspan="1" %)(% colspan="1" %) 21 +((( 22 + 23 +)))|(% colspan="1" %)(% colspan="1" %) 24 +((( 25 +[[image:attach:abo.png]] 26 +)))|(% colspan="1" %)(% colspan="1" %) 27 +((( 28 +{{code title="ABO.sct"}} 29 +@VHLayout 30 +scchart ABO { 31 + input output bool A; 32 + input output bool B; 33 + output bool O1; 34 + output bool O2; 35 + region: 36 + 37 + initial state Init 38 + --> WaitAB immediate with / O1 = false; O2 = false; 39 + state WaitAB { 40 + region HandleA: 41 + initial state WaitA 42 + --> DoneA immediate with A / B = true; O1 = true; 43 + final state DoneA; 44 + region HandleB: 45 + initial state WaitB 46 + --> DoneB with B / O1 = true; 47 + final state DoneB; 48 + } 49 + >-> GotAB with / O1 = false; O2 = true; 50 + state GotAB; 51 +} 52 +{{/code}} 53 +))) 54 +|(% colspan="1" %)(% colspan="1" %) 55 +((( 56 += clock = 57 + 58 +(Referenced SCCharts Example) 59 + 60 +**To enable the referenced SCCharts feature,** 61 + 62 +**activate the Xtext nature for your project!** 63 +)))|(% colspan="1" %)(% colspan="1" %) 64 +((( 65 + 66 +)))|(% colspan="1" %)(% colspan="1" %) 67 +((( 68 +[[image:attach:delay.png]] 69 + 70 +[[image:attach:emitter.png]] 71 + 72 +[[image:attach:clock2h.png]] 73 +)))|(% colspan="1" %)(% colspan="1" %) 74 +((( 75 +{{code language="sct" title="shifter3.sct"}} 76 +scchart delay { 77 + input int ticksToWait; 78 + input bool clock; 79 + int counter = 0; 80 + initial state init 81 + --> done immediate with 82 + counter >= ticksToWait 83 + --> init with 84 + clock / counter = counter + 1; 85 + final state done; 86 +} 87 +{{/code}} 88 + 89 +{{code language="sct" title="shifter3.sct"}} 90 +scchart emitter { 91 + input bool clock; 92 + input bool delay; 93 + output bool emit = false; 94 + initial state wait 95 + references delay 96 + bind clock to clock, 97 + ticksToWait to delay 98 + >-> emit; 99 + 100 + state emit { 101 + entry / emit = true; 102 + exit / emit = false; 103 + } 104 + --> wait; 105 +} 106 +{{/code}} 107 + 108 +{{code language="sct" title="shifter3.sct"}} 109 +scchart clock { 110 + input bool msClock; 111 + output bool second; 112 + output bool minute; 113 + output bool hour; 114 + const int SEC = 1000; 115 + const int MIN = 60; 116 + const int HOUR = 60; 117 + region seconds: 118 + initial state seconds 119 + references emitter 120 + bind clock to msClock, 121 + metrum to SEC, 122 + emit to second 123 + >-> seconds; 124 + 125 + region minutes: 126 + initial state minutes 127 + references emitter 128 + bind clock to second, 129 + metrum to MIN, 130 + emit to minute 131 + >-> minutes; 132 + 133 + region hours: 134 + initial state hours 135 + references emitter 136 + bind clock to minute, 137 + metrum to HOUR, 138 + emit to hour 139 + >-> hours; 140 +} 141 +{{/code}} 142 +))) 143 + 144 += SCCharts Evaluation Examples = 145 + 5 5 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. 6 6 7 7 |=((( ... ... @@ -25,7 +25,7 @@ 25 25 [[image:attach:PLDI'14 Artifact on SCCharts@shifter3.png]] 26 26 )))|(% colspan="1" %)(% colspan="1" %) 27 27 ((( 28 -{{code title="shifter3.sct" language="sct"}}169 +{{code language="sct" title="shifter3.sct"}} 29 29 scchart shifter3 { 30 30 input signal int I = 1; 31 31 signal int S0; ... ... @@ -51,7 +51,7 @@ 51 51 [[image:attach:PLDI'14 Artifact on SCCharts@reincarnation.png]] 52 52 )))|(% colspan="1" %)(% colspan="1" %) 53 53 ((( 54 -{{code title="reincarnation.sct" language="sct"}}195 +{{code language="sct" title="reincarnation.sct"}} 55 55 scchart reincarnation { 56 56 input signal A; 57 57 output signal gotS; ... ... @@ -81,7 +81,7 @@ 81 81 [[image:attach:PLDI'14 Artifact on SCCharts@cabin.png]] 82 82 )))|(% colspan="1" %)(% colspan="1" %) 83 83 ((( 84 -{{code title="cabin.sct" language="sct"}}225 +{{code language="sct" title="cabin.sct"}} 85 85 scchart Cabin { 86 86 input signal Stop; 87 87 input signal CabinStopped; ... ... @@ -129,7 +129,7 @@ 129 129 [[image:attach:PLDI'14 Artifact on SCCharts@reactor-control.png]] 130 130 )))|(% colspan="1" %)(% colspan="1" %) 131 131 ((( 132 -{{code title="reactor-control.sct" language="sct"}}273 +{{code language="sct" title="reactor-control.sct"}} 133 133 scchart Module_ReactorControl { 134 134 output signal PullOutRods; 135 135 output signal PushInRods;
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 - 122884171 +52723792 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/ 12288417/Examples1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/52723792/Examples