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 4 Next »

SCCharts Examples

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 and known limitations. You may use our online compiler or the 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 for rendering SCCharts diagrams from textual SCCharts descriptions.

Example SCChart  (Graphical)SCChart (Textual SCT)

shifter3

 
shifter3.sct
scchart shifter3 {
 input signal int I = 1;
 signal int S0;
 signal int S1;
 output signal int O;
 region R1:
 initial state I2
 --> I2 with pre(S0) / S1(pre(val(S0)));
 region R0:
 initial state I1
 --> I1 with pre(I) / S0(pre(val(I)));
 region R2:
 initial state I3
 --> I3 with pre(S1) / O(pre(val(S1)));
}

reincarnation

 
reincarnation.sct
scchart reincarnation {
  input signal A;
  output signal gotS;
  region R0:
  initial state Reincarnation {
    signal S;
    region R0:
    initial state I
    --> C1 immediate;
    state p;
    final state r;
    state q
    --> r with A / S;
    state C1
    --> p immediate with S / gotS
    --> q immediate;
  }
  >-> Reincarnation;
}

cabin

 
cabin.sct
scchart Cabin {
  input signal Stop;
  input signal CabinStopped;
  input signal DoorIsOpen;
  input signal DoorOpen;
  input signal DoorSensor;
  input signal DoorIsClosed;
  input signal DoorClose;
  input signal TimerExpired;
  output signal StartOK;
  output signal OpenDoorMotorOff;
  output signal OpenDoorMotorOn;
  output signal StartTimer;
  output signal CloseDoorMotorOn;
  output signal CloseDoorMotorOff;
  region R0:
  initial state I
  --> Open immediate with / OpenDoorMotorOn;
  state Open
  --> S0 with DoorIsOpen / OpenDoorMotorOff;
  state S0 {
    region R0:
    initial state Initial
    --> S0 immediate with / StartTimer;
    state S0
    --> S1 with TimerExpired | DoorClose / CloseDoorMotorOn;
    state S1
    --> S2 with DoorIsClosed / StartOK;
    final state S2;
  }
  o-> I with DoorOpen | DoorSensor / CloseDoorMotorOff
  >-> S1 with / CloseDoorMotorOff;
  state S1
  --> S2 with Stop;
  state S2
  --> I with CabinStopped;
}

reactor control

 
reactor-control.sct
scchart Module_ReactorControl {
  output signal PullOutRods;
  output signal PushInRods;
  input signal Start;
  input signal OverHeated;
  input signal CooledDown;
  signal unsafe;
  region main:
  initial state init0 "I"
  --> ParallelStatementList40state immediate;
  state ParallelStatementList40state {
    region R0:
    initial state init1 "I"
    --> Await43state immediate;
    state Await43state {
      region R0:
      initial state init2 "I"
      --> S18 immediate;
      state S18 "18"
      --> S23 with Start / PullOutRods;
      state S23 "23";
    }
    o-> Await43state with unsafe;
    region R1:
    initial state init3 "I"
    --> S94 immediate;
    state S94 "94"
    --> S134 immediate with unsafe / PushInRods;
    state S134 "134"
    --> S94 with !unsafe;
    region R2:
    initial state init4 "I"
    --> S193 immediate;
    state S193 "193"
    --> Sustain68state immediate with OverHeated;
    state Sustain68state {
      region R0:
      initial state init5 "I"
      --> S227 immediate with / unsafe;
      state S227 "227"
      --> S227 with / unsafe;
    }
    o-> S193 with CooledDown;
  };
}
  • No labels