|
|
@@ -178,6 +178,13 @@
|
|
|
self.realtime_scale = float(realtime_scale)
|
|
|
</script>
|
|
|
</transition>
|
|
|
+ <!-- We allow step into only when paused, because we then know the system is stable (pause is only possible after a big step). -->
|
|
|
+ <transition target="../Running/ChildStep" event="WovenSimulation.StepInto" cond="isinstance(self.fsa_state, CBDState)">
|
|
|
+ <raise event="StepInto.Success" scope="narrow" target="'parent'" />
|
|
|
+ </transition>
|
|
|
+ <transition target="." event="WovenSimulation.StepInto" cond="not isinstance(self.fsa_state, CBDState)">
|
|
|
+ <raise event="StepInto.Failure" scope="narrow" target="'parent'" />
|
|
|
+ </transition>
|
|
|
<transition target="." event="FSABigStep.Finished">
|
|
|
<parameter name="fsa_clock" />
|
|
|
<parameter name="fsa_state" />
|
|
|
@@ -293,6 +300,49 @@
|
|
|
</raise>
|
|
|
</transition>
|
|
|
</state>
|
|
|
+ <state id="ChildStep" initial="Paused">
|
|
|
+ <state id="Paused">
|
|
|
+ <transition target="../BigStep" event="CBDBigStep.Execute" />
|
|
|
+ <transition target="../SmallStep" event="CBDSmallStep.Execute" />
|
|
|
+ <!-- When a big step finishes after the last small step -->
|
|
|
+ <transition target="../../../Paused" event="CBDBigStep.Finished">
|
|
|
+ <parameter name="clock" />
|
|
|
+ <parameter name="iteration" />
|
|
|
+ <parameter name="time_next" />
|
|
|
+ <parameter name="state" />
|
|
|
+ <raise event="CBDBigStep.Finished" scope="narrow" target="'parent'">
|
|
|
+ <parameter expr="clock" />
|
|
|
+ <parameter expr="iteration" />
|
|
|
+ <parameter expr="time_next" />
|
|
|
+ <parameter expr="state" />
|
|
|
+ </raise>
|
|
|
+ </transition>
|
|
|
+ </state>
|
|
|
+ <state id="BigStep">
|
|
|
+ <transition target="../../../Paused" event="CBDBigStep.Finished">
|
|
|
+ <parameter name="clock" />
|
|
|
+ <parameter name="iteration" />
|
|
|
+ <parameter name="time_next" />
|
|
|
+ <parameter name="state" />
|
|
|
+ <raise event="CBDBigStep.Finished" scope="narrow" target="'parent'">
|
|
|
+ <parameter expr="clock" />
|
|
|
+ <parameter expr="iteration" />
|
|
|
+ <parameter expr="time_next" />
|
|
|
+ <parameter expr="state" />
|
|
|
+ </raise>
|
|
|
+ </transition>
|
|
|
+ </state>
|
|
|
+ <state id="SmallStep">
|
|
|
+ <transition target="../Paused" event="CBDSmallStep.Finished">
|
|
|
+ <parameter name="new_current_component_idx" />
|
|
|
+ <parameter name="new_state" />
|
|
|
+ <raise event="CBDSmallStep.Finished" scope="narrow" target="'parent'">
|
|
|
+ <parameter expr="new_current_component_idx" />
|
|
|
+ <parameter expr="new_state" />
|
|
|
+ </raise>
|
|
|
+ </transition>
|
|
|
+ </state>
|
|
|
+ </state>
|
|
|
<transition target="../Paused" cond="self.breakpointTriggers(INSTATE('Realtime'))">
|
|
|
<raise event="Breakpoint.Triggered" scope="narrow" target="'parent'">
|
|
|
<parameter expr="self.triggered_bp" />
|
|
|
@@ -479,13 +529,16 @@
|
|
|
</state>
|
|
|
<state id="CheckTermination">
|
|
|
<transition target="../Executing" cond="(INSTATE('../../ModeSelector/Running/Continuous') or INSTATE('../../ModeSelector/Running/BigStep') or INSTATE('../../ModeSelector/Running/SmallStep')) and INSTATE('../../FSAChildState/Initialized') and not isinstance(self.fsa_state, CBDState)">
|
|
|
- <raise event="FSASmallStep.Execute" scope="narrow" target="'child_fsa_simulator'" />
|
|
|
- <script>print 'Executing a FSA small step... (no CBD state)'</script>
|
|
|
+ <raise event="FSASmallStep.Execute" scope="narrow" target="'child_fsa_simulator'">
|
|
|
+ <parameter expr="None" />
|
|
|
+ </raise>
|
|
|
+ <script># print 'Executing a FSA small step... (no CBD state)'</script>
|
|
|
</transition>
|
|
|
<transition target="../ExecutingCBD" cond="(INSTATE('../../ModeSelector/Running/Continuous') or INSTATE('../../ModeSelector/Running/BigStep') or INSTATE('../../ModeSelector/Running/SmallStep')) and INSTATE('../../CBDChildState/Initialized') and isinstance(self.fsa_state, CBDState)">
|
|
|
<raise event="CBDBigStep.Execute" scope="narrow" target="'child_cbd_simulator'" />
|
|
|
- <script>print 'Executing a CBD big step... (CBD state)'</script>
|
|
|
+ <script># print 'Executing a CBD big step... (CBD state)'</script>
|
|
|
</transition>
|
|
|
+ <transition target="../SteppedInto" cond="INSTATE('../../ModeSelector/Running/ChildStep/SmallStep') or INSTATE('../../ModeSelector/Running/ChildStep/BigStep')" />
|
|
|
<transition target="../WaitingRealtime" cond="INSTATE('../../ModeSelector/Running/Realtime') and INSTATE('../../FSAChildState/Initialized')" />
|
|
|
<transition target="../Stopped" cond="INSTATE('../../ModeSelector/Stopped')">
|
|
|
<script>
|
|
|
@@ -512,13 +565,47 @@
|
|
|
</transition>
|
|
|
<!-- We execute a step when the wait time is smaller than the smallest possible delay. -->
|
|
|
<transition target="../Executing" cond="self.waitTime() / 1000.0 <= self.sccd_yield() and not isinstance(self.fsa_state, CBDState) and INSTATE('../../FSAChildState/Initialized')">
|
|
|
- <raise event="FSASmallStep.Execute" scope="narrow" target="'child_fsa_simulator'" />
|
|
|
- <script>print 'Executing a FSA small step... (no CBD state - RT)'</script>
|
|
|
+ <raise event="FSASmallStep.Execute" scope="narrow" target="'child_fsa_simulator'">
|
|
|
+ <parameter expr="None" />
|
|
|
+ </raise>
|
|
|
+ <script># print 'Executing a FSA small step... (no CBD state - RT)'</script>
|
|
|
</transition>
|
|
|
<transition target="../ExecutingCBD" cond="self.waitTime() / 1000.0 <= self.sccd_yield() and isinstance(self.fsa_state, CBDState) and INSTATE('../../CBDChildState/Initialized')">
|
|
|
<raise event="CBDBigStep.Execute" scope="narrow" target="'child_cbd_simulator'" />
|
|
|
</transition>
|
|
|
</state>
|
|
|
+ <state id="SteppedInto" initial="Waiting">
|
|
|
+ <state id="Waiting">
|
|
|
+ <transition target="../ExecutingCBDSmallStep" cond="INSTATE('../../../ModeSelector/Running/ChildStep/SmallStep') and INSTATE('../../../CBDChildState/Initialized')">
|
|
|
+ <raise event="CBDSmallStep.Execute" scope="narrow" target="'child_cbd_simulator'" />
|
|
|
+ </transition>
|
|
|
+ <transition target="../SettleBeforeWaiting" cond="INSTATE('../../../ModeSelector/Running/ChildStep/BigStep') and INSTATE('../../../CBDChildState/Initialized')">
|
|
|
+ <raise event="CBDBigStep.Execute" scope="narrow" target="'child_cbd_simulator'" />
|
|
|
+ </transition>
|
|
|
+ </state>
|
|
|
+ <state id="ExecutingCBDSmallStep">
|
|
|
+ <transition target="../SettleBeforeWaiting" event="CBDSmallStep.Finished" />
|
|
|
+ </state>
|
|
|
+ <state id="SettleBeforeWaiting">
|
|
|
+ <transition target="../Waiting" after="self.sccd_yield()" />
|
|
|
+ </state>
|
|
|
+ <transition target="../Executing" event="CBDBigStep.Finished">
|
|
|
+ <parameter name="cbd_clock" />
|
|
|
+ <parameter name="cbd_state" />
|
|
|
+ <parameter name="cbd_iteration" />
|
|
|
+ <parameter name="cbd_time_next" />
|
|
|
+ <script>
|
|
|
+ self.wovenUpdateGlobalState()
|
|
|
+ self.woven_lib.dumpGlobalState(self.woven_model, self.woven_global_state, self.fsa_clock / 1000.0, self.fsa_state)
|
|
|
+ self.cbd_clock = cbd_clock
|
|
|
+ self.woven_triggered_when_transition = self.wovenGetTriggeredWhenTransition()
|
|
|
+ </script>
|
|
|
+ <raise event="FSASmallStep.Execute" scope="narrow" target="'child_fsa_simulator'">
|
|
|
+ <parameter expr="self.woven_triggered_when_transition" />
|
|
|
+ </raise>
|
|
|
+ <script># print 'Executing a FSA small step... (after CBD big step)'</script>
|
|
|
+ </transition>
|
|
|
+ </state>
|
|
|
<state id="ExecutingCBD">
|
|
|
<transition target="../Executing" event="CBDBigStep.Finished">
|
|
|
<parameter name="cbd_clock" />
|
|
|
@@ -534,7 +621,7 @@
|
|
|
<raise event="FSASmallStep.Execute" scope="narrow" target="'child_fsa_simulator'">
|
|
|
<parameter expr="self.woven_triggered_when_transition" />
|
|
|
</raise>
|
|
|
- <script>print 'Executing a FSA small step... (after CBD big step)'</script>
|
|
|
+ <script># print 'Executing a FSA small step... (after CBD big step)'</script>
|
|
|
</transition>
|
|
|
</state>
|
|
|
<state id="Executing">
|