Bladeren bron

fixed breakpoints

Simon Van Mierlo 10 jaren geleden
bovenliggende
commit
731dcd5f48

+ 269 - 125
debugging_fsa_cbd_composition/fsa_cbd_simulator/HierarchicalSimulator/target.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-Date:   Tue Nov 29 10:25:31 2016
+Date:   Wed Nov 30 16:15:48 2016
 
 Model author: Sadaf Mustafiz and Claudio Gomes and Simon Van Mierlo
 Model name:   FSASimulator_Coordinator
@@ -227,6 +227,10 @@ class WovenSimulator_Coordinator(RuntimeClassBase):
         _Main_ModeSelector_Paused_6.setAction(self._Main_ModeSelector_Paused_6_exec)
         _Main_ModeSelector_Paused_6.setTrigger(Event("WovenSimulation.Finished", None))
         self.states["/Main/ModeSelector/Paused"].addTransition(_Main_ModeSelector_Paused_6)
+        _Main_ModeSelector_Paused_7 = Transition(self, self.states["/Main/ModeSelector/Paused"], [self.states["/Main/ModeSelector/Paused"]])
+        _Main_ModeSelector_Paused_7.setAction(self._Main_ModeSelector_Paused_7_exec)
+        _Main_ModeSelector_Paused_7.setTrigger(Event("Breakpoint.Triggered", None))
+        self.states["/Main/ModeSelector/Paused"].addTransition(_Main_ModeSelector_Paused_7)
         
         # transition /Main/ModeSelector/WaitingForStepIntoSuccess
         _Main_ModeSelector_WaitingForStepIntoSuccess_0 = Transition(self, self.states["/Main/ModeSelector/WaitingForStepIntoSuccess"], [self.states["/Main/ModeSelector/Running/StepInto"]])
@@ -493,6 +497,13 @@ class WovenSimulator_Coordinator(RuntimeClassBase):
         self.big_step.outputEvent(Event("WovenSimulation.Finished", "user_output", []))
         self.big_step.outputEvent(Event("WovenSimulation.State", "user_output", [clock / 1000.0, state]))
     
+    def _Main_ModeSelector_Paused_7_exec(self, parameters):
+        triggered_bp = parameters[0]
+        clock = parameters[1]
+        state = parameters[2]
+        self.big_step.outputEvent(Event("Breakpoint.Triggered", "user_output", [triggered_bp, clock / 1000.0, state]))
+        self.big_step.outputEvent(Event("WovenSimulation.State", "user_output", [clock / 1000.0, state]))
+    
     def _Main_ModeSelector_WaitingForStepIntoSuccess_0_exec(self, parameters):
         self.big_step.outputEvent(Event("StepInto.Success", "user_output", []))
     
@@ -751,6 +762,7 @@ class WovenSimulator_Simulation(RuntimeClassBase):
     def initializeDebugger(self):
         self.breakpoints = []
         self.triggered_bp = None
+        self.breakpoint_triggers = False
     
     
     # user defined method
@@ -809,7 +821,7 @@ class WovenSimulator_Simulation(RuntimeClassBase):
             return -1
         for bp in self.breakpoints:
             if bp.name == name:
-                bp.enabled = enabled
+                bp.enabled = not bp.enabled
                 break
         return 0
     
@@ -826,22 +838,26 @@ class WovenSimulator_Simulation(RuntimeClassBase):
             # note that we pass self.time_next instead of self.simulated_time in the case of as-fast-as-possible simulation (or stepping)
             # this is to make sure that the simulation is stopped BEFORE the specified time is reached, and not AFTER (because we don't necessarily implement 'step back')
             # in case of realtime simulation, we do pass the current simulated time, since we can stop at (more or less) exactly the right time
-            if breakpoint({'fsa_clock': (self.fsa_clock if is_realtime_simulation else self.fsa_time_next) / 1000.0,
-                           'fsa_state': self.fsa_state,
-                           'fsa_elapsed': self.fsa_elapsed,
-                           'fsa_time_next': self.fsa_time_next,
-                           'cbd_clock': (self.cbd_clock if is_realtime_simulation else self.cbd_time_next) / 1000.0,
-                           'cbd_state': self.cbd_state,
-                           'cbd_iteration': self.cbd_iteration,
-                           'cbd_time_next': self.cbd_time_next}):
-                # triggered!
-                self.triggered_bp = bp.name
-                if bp.disable_on_trigger:
-                    bp.enabled = False
-                return True
-            else:
-                # not triggered, so continue
-                continue
+            try:
+                if breakpoint({'fsa_clock': (self.fsa_clock if is_realtime_simulation else self.fsa_time_next) / 1000.0,
+                               'fsa_state': self.fsa_state,
+                               'fsa_elapsed': self.fsa_elapsed,
+                               'fsa_time_next': self.fsa_time_next,
+                               'cbd_clock': (self.cbd_clock if is_realtime_simulation else self.cbd_time_next) / 1000.0,
+                               'cbd_state': self.cbd_state,
+                               'cbd_iteration': self.cbd_iteration,
+                               'cbd_time_next': self.cbd_time_next}):
+                    # triggered!
+                    print 'triggered'
+                    self.triggered_bp = bp.name
+                    if bp.disable_on_trigger:
+                        bp.enabled = False
+                    return True
+                else:
+                    # not triggered, so continue
+                    continue
+            except AttributeError: 
+                pass # this means state/clock has not been set yet, so we are at the start of simulation... no breakpoint can trigger
         return False
     
     
@@ -863,169 +879,184 @@ class WovenSimulator_Simulation(RuntimeClassBase):
         # state /Main/ModeSelector/ExecutingRealtimeIfInitialized
         self.states["/Main/ModeSelector/ExecutingRealtimeIfInitialized"] = State(4, "/Main/ModeSelector/ExecutingRealtimeIfInitialized", self)
         
+        # state /Main/ModeSelector/WaitingForBigStepToEndPause
+        self.states["/Main/ModeSelector/WaitingForBigStepToEndPause"] = State(5, "/Main/ModeSelector/WaitingForBigStepToEndPause", self)
+        
+        # state /Main/ModeSelector/CheckIfBreakpointTriggers
+        self.states["/Main/ModeSelector/CheckIfBreakpointTriggers"] = State(6, "/Main/ModeSelector/CheckIfBreakpointTriggers", self)
+        self.states["/Main/ModeSelector/CheckIfBreakpointTriggers"].setEnter(self._Main_ModeSelector_CheckIfBreakpointTriggers_enter)
+        
         # state /Main/ModeSelector/Running
-        self.states["/Main/ModeSelector/Running"] = State(5, "/Main/ModeSelector/Running", self)
+        self.states["/Main/ModeSelector/Running"] = State(7, "/Main/ModeSelector/Running", self)
         
         # state /Main/ModeSelector/Running/Continuous
-        self.states["/Main/ModeSelector/Running/Continuous"] = State(6, "/Main/ModeSelector/Running/Continuous", self)
+        self.states["/Main/ModeSelector/Running/Continuous"] = State(8, "/Main/ModeSelector/Running/Continuous", self)
         
-        # state /Main/ModeSelector/Running/Continuous/Running
-        self.states["/Main/ModeSelector/Running/Continuous/Running"] = State(7, "/Main/ModeSelector/Running/Continuous/Running", self)
+        # state /Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers
+        self.states["/Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers"] = State(9, "/Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers", self)
+        self.states["/Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers"].setEnter(self._Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_enter)
         
-        # state /Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd
-        self.states["/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd"] = State(8, "/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd", self)
+        # state /Main/ModeSelector/Running/Continuous/Running
+        self.states["/Main/ModeSelector/Running/Continuous/Running"] = State(10, "/Main/ModeSelector/Running/Continuous/Running", self)
         
         # state /Main/ModeSelector/Running/Realtime
-        self.states["/Main/ModeSelector/Running/Realtime"] = State(9, "/Main/ModeSelector/Running/Realtime", self)
+        self.states["/Main/ModeSelector/Running/Realtime"] = State(11, "/Main/ModeSelector/Running/Realtime", self)
+        
+        # state /Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers
+        self.states["/Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers"] = State(12, "/Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers", self)
+        self.states["/Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers"].setEnter(self._Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_enter)
+        
+        # state /Main/ModeSelector/Running/Realtime/Running
+        self.states["/Main/ModeSelector/Running/Realtime/Running"] = State(13, "/Main/ModeSelector/Running/Realtime/Running", self)
         
         # state /Main/ModeSelector/Running/BigStep
-        self.states["/Main/ModeSelector/Running/BigStep"] = State(10, "/Main/ModeSelector/Running/BigStep", self)
+        self.states["/Main/ModeSelector/Running/BigStep"] = State(14, "/Main/ModeSelector/Running/BigStep", self)
         
         # state /Main/ModeSelector/Running/SmallStep
-        self.states["/Main/ModeSelector/Running/SmallStep"] = State(11, "/Main/ModeSelector/Running/SmallStep", self)
+        self.states["/Main/ModeSelector/Running/SmallStep"] = State(15, "/Main/ModeSelector/Running/SmallStep", self)
         
         # state /Main/ModeSelector/Running/ChildStep
-        self.states["/Main/ModeSelector/Running/ChildStep"] = State(12, "/Main/ModeSelector/Running/ChildStep", self)
+        self.states["/Main/ModeSelector/Running/ChildStep"] = State(16, "/Main/ModeSelector/Running/ChildStep", self)
         
         # state /Main/ModeSelector/Running/ChildStep/Paused
-        self.states["/Main/ModeSelector/Running/ChildStep/Paused"] = State(13, "/Main/ModeSelector/Running/ChildStep/Paused", self)
+        self.states["/Main/ModeSelector/Running/ChildStep/Paused"] = State(17, "/Main/ModeSelector/Running/ChildStep/Paused", self)
         
         # state /Main/ModeSelector/Running/ChildStep/BigStep
-        self.states["/Main/ModeSelector/Running/ChildStep/BigStep"] = State(14, "/Main/ModeSelector/Running/ChildStep/BigStep", self)
+        self.states["/Main/ModeSelector/Running/ChildStep/BigStep"] = State(18, "/Main/ModeSelector/Running/ChildStep/BigStep", self)
         
         # state /Main/ModeSelector/Running/ChildStep/SmallStep
-        self.states["/Main/ModeSelector/Running/ChildStep/SmallStep"] = State(15, "/Main/ModeSelector/Running/ChildStep/SmallStep", self)
+        self.states["/Main/ModeSelector/Running/ChildStep/SmallStep"] = State(19, "/Main/ModeSelector/Running/ChildStep/SmallStep", self)
         
         # state /Main/ModeSelector/Stopped
-        self.states["/Main/ModeSelector/Stopped"] = State(16, "/Main/ModeSelector/Stopped", self)
+        self.states["/Main/ModeSelector/Stopped"] = State(20, "/Main/ModeSelector/Stopped", self)
         self.states["/Main/ModeSelector/Stopped"].setEnter(self._Main_ModeSelector_Stopped_enter)
         
         # state /Main/FSAChildState
-        self.states["/Main/FSAChildState"] = State(17, "/Main/FSAChildState", self)
+        self.states["/Main/FSAChildState"] = State(21, "/Main/FSAChildState", self)
         
         # state /Main/FSAChildState/Uninitialized
-        self.states["/Main/FSAChildState/Uninitialized"] = State(18, "/Main/FSAChildState/Uninitialized", self)
+        self.states["/Main/FSAChildState/Uninitialized"] = State(22, "/Main/FSAChildState/Uninitialized", self)
         
         # state /Main/FSAChildState/Initialized
-        self.states["/Main/FSAChildState/Initialized"] = State(19, "/Main/FSAChildState/Initialized", self)
+        self.states["/Main/FSAChildState/Initialized"] = State(23, "/Main/FSAChildState/Initialized", self)
         
         # state /Main/CBDChildState
-        self.states["/Main/CBDChildState"] = State(20, "/Main/CBDChildState", self)
+        self.states["/Main/CBDChildState"] = State(24, "/Main/CBDChildState", self)
         
         # state /Main/CBDChildState/Uninitialized
-        self.states["/Main/CBDChildState/Uninitialized"] = State(21, "/Main/CBDChildState/Uninitialized", self)
+        self.states["/Main/CBDChildState/Uninitialized"] = State(25, "/Main/CBDChildState/Uninitialized", self)
         
         # state /Main/CBDChildState/Initialized
-        self.states["/Main/CBDChildState/Initialized"] = State(22, "/Main/CBDChildState/Initialized", self)
+        self.states["/Main/CBDChildState/Initialized"] = State(26, "/Main/CBDChildState/Initialized", self)
         
         # state /Main/FSAInitializer
-        self.states["/Main/FSAInitializer"] = State(23, "/Main/FSAInitializer", self)
+        self.states["/Main/FSAInitializer"] = State(27, "/Main/FSAInitializer", self)
         
         # state /Main/FSAInitializer/Waiting
-        self.states["/Main/FSAInitializer/Waiting"] = State(24, "/Main/FSAInitializer/Waiting", self)
+        self.states["/Main/FSAInitializer/Waiting"] = State(28, "/Main/FSAInitializer/Waiting", self)
         
         # state /Main/FSAInitializer/CreatingChildSimulator
-        self.states["/Main/FSAInitializer/CreatingChildSimulator"] = State(25, "/Main/FSAInitializer/CreatingChildSimulator", self)
+        self.states["/Main/FSAInitializer/CreatingChildSimulator"] = State(29, "/Main/FSAInitializer/CreatingChildSimulator", self)
         
         # state /Main/FSAInitializer/StartingChildSimulator
-        self.states["/Main/FSAInitializer/StartingChildSimulator"] = State(26, "/Main/FSAInitializer/StartingChildSimulator", self)
+        self.states["/Main/FSAInitializer/StartingChildSimulator"] = State(30, "/Main/FSAInitializer/StartingChildSimulator", self)
         
         # state /Main/FSAInitializer/Running
-        self.states["/Main/FSAInitializer/Running"] = State(27, "/Main/FSAInitializer/Running", self)
+        self.states["/Main/FSAInitializer/Running"] = State(31, "/Main/FSAInitializer/Running", self)
         
         # state /Main/FSAInitializer/SettleBeforeWaiting
-        self.states["/Main/FSAInitializer/SettleBeforeWaiting"] = State(28, "/Main/FSAInitializer/SettleBeforeWaiting", self)
+        self.states["/Main/FSAInitializer/SettleBeforeWaiting"] = State(32, "/Main/FSAInitializer/SettleBeforeWaiting", self)
         self.states["/Main/FSAInitializer/SettleBeforeWaiting"].setEnter(self._Main_FSAInitializer_SettleBeforeWaiting_enter)
         self.states["/Main/FSAInitializer/SettleBeforeWaiting"].setExit(self._Main_FSAInitializer_SettleBeforeWaiting_exit)
         
         # state /Main/CBDInitializer
-        self.states["/Main/CBDInitializer"] = State(29, "/Main/CBDInitializer", self)
+        self.states["/Main/CBDInitializer"] = State(33, "/Main/CBDInitializer", self)
         
         # state /Main/CBDInitializer/Waiting
-        self.states["/Main/CBDInitializer/Waiting"] = State(30, "/Main/CBDInitializer/Waiting", self)
+        self.states["/Main/CBDInitializer/Waiting"] = State(34, "/Main/CBDInitializer/Waiting", self)
         
         # state /Main/CBDInitializer/CreatingChildSimulator
-        self.states["/Main/CBDInitializer/CreatingChildSimulator"] = State(31, "/Main/CBDInitializer/CreatingChildSimulator", self)
+        self.states["/Main/CBDInitializer/CreatingChildSimulator"] = State(35, "/Main/CBDInitializer/CreatingChildSimulator", self)
         
         # state /Main/CBDInitializer/StartingChildSimulator
-        self.states["/Main/CBDInitializer/StartingChildSimulator"] = State(32, "/Main/CBDInitializer/StartingChildSimulator", self)
+        self.states["/Main/CBDInitializer/StartingChildSimulator"] = State(36, "/Main/CBDInitializer/StartingChildSimulator", self)
         
         # state /Main/CBDInitializer/Running
-        self.states["/Main/CBDInitializer/Running"] = State(33, "/Main/CBDInitializer/Running", self)
+        self.states["/Main/CBDInitializer/Running"] = State(37, "/Main/CBDInitializer/Running", self)
         
         # state /Main/CBDInitializer/SettleBeforeWaiting
-        self.states["/Main/CBDInitializer/SettleBeforeWaiting"] = State(34, "/Main/CBDInitializer/SettleBeforeWaiting", self)
+        self.states["/Main/CBDInitializer/SettleBeforeWaiting"] = State(38, "/Main/CBDInitializer/SettleBeforeWaiting", self)
         self.states["/Main/CBDInitializer/SettleBeforeWaiting"].setEnter(self._Main_CBDInitializer_SettleBeforeWaiting_enter)
         self.states["/Main/CBDInitializer/SettleBeforeWaiting"].setExit(self._Main_CBDInitializer_SettleBeforeWaiting_exit)
         
         # state /Main/SimulationFlow
-        self.states["/Main/SimulationFlow"] = State(35, "/Main/SimulationFlow", self)
+        self.states["/Main/SimulationFlow"] = State(39, "/Main/SimulationFlow", self)
         
         # state /Main/SimulationFlow/Started
-        self.states["/Main/SimulationFlow/Started"] = State(36, "/Main/SimulationFlow/Started", self)
+        self.states["/Main/SimulationFlow/Started"] = State(40, "/Main/SimulationFlow/Started", self)
         
         # state /Main/SimulationFlow/Initialized
-        self.states["/Main/SimulationFlow/Initialized"] = State(37, "/Main/SimulationFlow/Initialized", self)
+        self.states["/Main/SimulationFlow/Initialized"] = State(41, "/Main/SimulationFlow/Initialized", self)
         
         # state /Main/SimulationFlow/InitializeDebugger
-        self.states["/Main/SimulationFlow/InitializeDebugger"] = State(38, "/Main/SimulationFlow/InitializeDebugger", self)
+        self.states["/Main/SimulationFlow/InitializeDebugger"] = State(42, "/Main/SimulationFlow/InitializeDebugger", self)
         
         # state /Main/SimulationFlow/DebuggerInitialized
-        self.states["/Main/SimulationFlow/DebuggerInitialized"] = State(39, "/Main/SimulationFlow/DebuggerInitialized", self)
+        self.states["/Main/SimulationFlow/DebuggerInitialized"] = State(43, "/Main/SimulationFlow/DebuggerInitialized", self)
         
         # state /Main/SimulationFlow/Waiting
-        self.states["/Main/SimulationFlow/Waiting"] = State(40, "/Main/SimulationFlow/Waiting", self)
+        self.states["/Main/SimulationFlow/Waiting"] = State(44, "/Main/SimulationFlow/Waiting", self)
         
         # state /Main/SimulationFlow/SettleBeforeCheckTermination
-        self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"] = State(41, "/Main/SimulationFlow/SettleBeforeCheckTermination", self)
+        self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"] = State(45, "/Main/SimulationFlow/SettleBeforeCheckTermination", self)
         self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"].setEnter(self._Main_SimulationFlow_SettleBeforeCheckTermination_enter)
         self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"].setExit(self._Main_SimulationFlow_SettleBeforeCheckTermination_exit)
         
         # state /Main/SimulationFlow/CheckTermination
-        self.states["/Main/SimulationFlow/CheckTermination"] = State(42, "/Main/SimulationFlow/CheckTermination", self)
+        self.states["/Main/SimulationFlow/CheckTermination"] = State(46, "/Main/SimulationFlow/CheckTermination", self)
         
         # state /Main/SimulationFlow/WaitingRealtime
-        self.states["/Main/SimulationFlow/WaitingRealtime"] = State(43, "/Main/SimulationFlow/WaitingRealtime", self)
+        self.states["/Main/SimulationFlow/WaitingRealtime"] = State(47, "/Main/SimulationFlow/WaitingRealtime", self)
         self.states["/Main/SimulationFlow/WaitingRealtime"].setEnter(self._Main_SimulationFlow_WaitingRealtime_enter)
         self.states["/Main/SimulationFlow/WaitingRealtime"].setExit(self._Main_SimulationFlow_WaitingRealtime_exit)
         
         # state /Main/SimulationFlow/SteppedInto
-        self.states["/Main/SimulationFlow/SteppedInto"] = State(44, "/Main/SimulationFlow/SteppedInto", self)
+        self.states["/Main/SimulationFlow/SteppedInto"] = State(48, "/Main/SimulationFlow/SteppedInto", self)
         
         # state /Main/SimulationFlow/SteppedInto/Waiting
-        self.states["/Main/SimulationFlow/SteppedInto/Waiting"] = State(45, "/Main/SimulationFlow/SteppedInto/Waiting", self)
+        self.states["/Main/SimulationFlow/SteppedInto/Waiting"] = State(49, "/Main/SimulationFlow/SteppedInto/Waiting", self)
         
         # state /Main/SimulationFlow/SteppedInto/ExecutingCBDSmallStep
-        self.states["/Main/SimulationFlow/SteppedInto/ExecutingCBDSmallStep"] = State(46, "/Main/SimulationFlow/SteppedInto/ExecutingCBDSmallStep", self)
+        self.states["/Main/SimulationFlow/SteppedInto/ExecutingCBDSmallStep"] = State(50, "/Main/SimulationFlow/SteppedInto/ExecutingCBDSmallStep", self)
         
         # state /Main/SimulationFlow/SteppedInto/SettleBeforeWaiting
-        self.states["/Main/SimulationFlow/SteppedInto/SettleBeforeWaiting"] = State(47, "/Main/SimulationFlow/SteppedInto/SettleBeforeWaiting", self)
+        self.states["/Main/SimulationFlow/SteppedInto/SettleBeforeWaiting"] = State(51, "/Main/SimulationFlow/SteppedInto/SettleBeforeWaiting", self)
         self.states["/Main/SimulationFlow/SteppedInto/SettleBeforeWaiting"].setEnter(self._Main_SimulationFlow_SteppedInto_SettleBeforeWaiting_enter)
         self.states["/Main/SimulationFlow/SteppedInto/SettleBeforeWaiting"].setExit(self._Main_SimulationFlow_SteppedInto_SettleBeforeWaiting_exit)
         
         # state /Main/SimulationFlow/ExecutingCBD
-        self.states["/Main/SimulationFlow/ExecutingCBD"] = State(48, "/Main/SimulationFlow/ExecutingCBD", self)
+        self.states["/Main/SimulationFlow/ExecutingCBD"] = State(52, "/Main/SimulationFlow/ExecutingCBD", self)
         
         # state /Main/SimulationFlow/Executing
-        self.states["/Main/SimulationFlow/Executing"] = State(49, "/Main/SimulationFlow/Executing", self)
+        self.states["/Main/SimulationFlow/Executing"] = State(53, "/Main/SimulationFlow/Executing", self)
         
         # state /Main/SimulationFlow/Stopped
-        self.states["/Main/SimulationFlow/Stopped"] = State(50, "/Main/SimulationFlow/Stopped", self)
+        self.states["/Main/SimulationFlow/Stopped"] = State(54, "/Main/SimulationFlow/Stopped", self)
         
         # state /Main/BreakpointManager
-        self.states["/Main/BreakpointManager"] = State(51, "/Main/BreakpointManager", self)
+        self.states["/Main/BreakpointManager"] = State(55, "/Main/BreakpointManager", self)
         
         # state /Main/BreakpointManager/Listening
-        self.states["/Main/BreakpointManager/Listening"] = State(52, "/Main/BreakpointManager/Listening", self)
+        self.states["/Main/BreakpointManager/Listening"] = State(56, "/Main/BreakpointManager/Listening", self)
         
         # state /Main/ParentCommunicator
-        self.states["/Main/ParentCommunicator"] = State(53, "/Main/ParentCommunicator", self)
+        self.states["/Main/ParentCommunicator"] = State(57, "/Main/ParentCommunicator", self)
         
         # state /Main/ParentCommunicator/Forwarding
-        self.states["/Main/ParentCommunicator/Forwarding"] = State(54, "/Main/ParentCommunicator/Forwarding", self)
+        self.states["/Main/ParentCommunicator/Forwarding"] = State(58, "/Main/ParentCommunicator/Forwarding", self)
         
         # state /Stopped
-        self.states["/Stopped"] = State(55, "/Stopped", self)
+        self.states["/Stopped"] = State(59, "/Stopped", self)
         
         # add children
         self.states[""].addChild(self.states["/Main"])
@@ -1040,6 +1071,8 @@ class WovenSimulator_Simulation(RuntimeClassBase):
         self.states["/Main"].addChild(self.states["/Main/ParentCommunicator"])
         self.states["/Main/ModeSelector"].addChild(self.states["/Main/ModeSelector/Paused"])
         self.states["/Main/ModeSelector"].addChild(self.states["/Main/ModeSelector/ExecutingRealtimeIfInitialized"])
+        self.states["/Main/ModeSelector"].addChild(self.states["/Main/ModeSelector/WaitingForBigStepToEndPause"])
+        self.states["/Main/ModeSelector"].addChild(self.states["/Main/ModeSelector/CheckIfBreakpointTriggers"])
         self.states["/Main/ModeSelector"].addChild(self.states["/Main/ModeSelector/Running"])
         self.states["/Main/ModeSelector"].addChild(self.states["/Main/ModeSelector/Stopped"])
         self.states["/Main/ModeSelector/Running"].addChild(self.states["/Main/ModeSelector/Running/Continuous"])
@@ -1047,8 +1080,10 @@ class WovenSimulator_Simulation(RuntimeClassBase):
         self.states["/Main/ModeSelector/Running"].addChild(self.states["/Main/ModeSelector/Running/BigStep"])
         self.states["/Main/ModeSelector/Running"].addChild(self.states["/Main/ModeSelector/Running/SmallStep"])
         self.states["/Main/ModeSelector/Running"].addChild(self.states["/Main/ModeSelector/Running/ChildStep"])
+        self.states["/Main/ModeSelector/Running/Continuous"].addChild(self.states["/Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers"])
         self.states["/Main/ModeSelector/Running/Continuous"].addChild(self.states["/Main/ModeSelector/Running/Continuous/Running"])
-        self.states["/Main/ModeSelector/Running/Continuous"].addChild(self.states["/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd"])
+        self.states["/Main/ModeSelector/Running/Realtime"].addChild(self.states["/Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers"])
+        self.states["/Main/ModeSelector/Running/Realtime"].addChild(self.states["/Main/ModeSelector/Running/Realtime/Running"])
         self.states["/Main/ModeSelector/Running/ChildStep"].addChild(self.states["/Main/ModeSelector/Running/ChildStep/Paused"])
         self.states["/Main/ModeSelector/Running/ChildStep"].addChild(self.states["/Main/ModeSelector/Running/ChildStep/BigStep"])
         self.states["/Main/ModeSelector/Running/ChildStep"].addChild(self.states["/Main/ModeSelector/Running/ChildStep/SmallStep"])
@@ -1087,7 +1122,8 @@ class WovenSimulator_Simulation(RuntimeClassBase):
         self.states[""].default_state = self.states["/Main"]
         self.states["/Main/ModeSelector"].default_state = self.states["/Main/ModeSelector/Paused"]
         self.states["/Main/ModeSelector/Running"].default_state = self.states["/Main/ModeSelector/Running/Continuous"]
-        self.states["/Main/ModeSelector/Running/Continuous"].default_state = self.states["/Main/ModeSelector/Running/Continuous/Running"]
+        self.states["/Main/ModeSelector/Running/Continuous"].default_state = self.states["/Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers"]
+        self.states["/Main/ModeSelector/Running/Realtime"].default_state = self.states["/Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers"]
         self.states["/Main/ModeSelector/Running/ChildStep"].default_state = self.states["/Main/ModeSelector/Running/ChildStep/Paused"]
         self.states["/Main/FSAChildState"].default_state = self.states["/Main/FSAChildState/Uninitialized"]
         self.states["/Main/CBDChildState"].default_state = self.states["/Main/CBDChildState/Uninitialized"]
@@ -1122,7 +1158,7 @@ class WovenSimulator_Simulation(RuntimeClassBase):
         _Main_ModeSelector_Paused_5.setTrigger(Event("WovenSimulation.StepInto", None))
         _Main_ModeSelector_Paused_5.setGuard(self._Main_ModeSelector_Paused_5_guard)
         self.states["/Main/ModeSelector/Paused"].addTransition(_Main_ModeSelector_Paused_5)
-        _Main_ModeSelector_Paused_6 = Transition(self, self.states["/Main/ModeSelector/Paused"], [self.states["/Main/ModeSelector/Paused"]])
+        _Main_ModeSelector_Paused_6 = Transition(self, self.states["/Main/ModeSelector/Paused"], [self.states["/Main/ModeSelector/CheckIfBreakpointTriggers"]])
         _Main_ModeSelector_Paused_6.setAction(self._Main_ModeSelector_Paused_6_exec)
         _Main_ModeSelector_Paused_6.setTrigger(Event("FSABigStep.Finished", None))
         self.states["/Main/ModeSelector/Paused"].addTransition(_Main_ModeSelector_Paused_6)
@@ -1140,27 +1176,75 @@ class WovenSimulator_Simulation(RuntimeClassBase):
         _Main_ModeSelector_ExecutingRealtimeIfInitialized_0.setGuard(self._Main_ModeSelector_ExecutingRealtimeIfInitialized_0_guard)
         self.states["/Main/ModeSelector/ExecutingRealtimeIfInitialized"].addTransition(_Main_ModeSelector_ExecutingRealtimeIfInitialized_0)
         
+        # transition /Main/ModeSelector/WaitingForBigStepToEndPause
+        _Main_ModeSelector_WaitingForBigStepToEndPause_0 = Transition(self, self.states["/Main/ModeSelector/WaitingForBigStepToEndPause"], [self.states["/Main/ModeSelector/Paused"]])
+        _Main_ModeSelector_WaitingForBigStepToEndPause_0.setAction(self._Main_ModeSelector_WaitingForBigStepToEndPause_0_exec)
+        _Main_ModeSelector_WaitingForBigStepToEndPause_0.setTrigger(Event("FSABigStep.Finished", None))
+        self.states["/Main/ModeSelector/WaitingForBigStepToEndPause"].addTransition(_Main_ModeSelector_WaitingForBigStepToEndPause_0)
+        
+        # transition /Main/ModeSelector/CheckIfBreakpointTriggers
+        _Main_ModeSelector_CheckIfBreakpointTriggers_0 = Transition(self, self.states["/Main/ModeSelector/CheckIfBreakpointTriggers"], [self.states["/Main/ModeSelector/Paused"]])
+        _Main_ModeSelector_CheckIfBreakpointTriggers_0.setAction(self._Main_ModeSelector_CheckIfBreakpointTriggers_0_exec)
+        _Main_ModeSelector_CheckIfBreakpointTriggers_0.setTrigger(None)
+        _Main_ModeSelector_CheckIfBreakpointTriggers_0.setGuard(self._Main_ModeSelector_CheckIfBreakpointTriggers_0_guard)
+        self.states["/Main/ModeSelector/CheckIfBreakpointTriggers"].addTransition(_Main_ModeSelector_CheckIfBreakpointTriggers_0)
+        _Main_ModeSelector_CheckIfBreakpointTriggers_1 = Transition(self, self.states["/Main/ModeSelector/CheckIfBreakpointTriggers"], [self.states["/Main/ModeSelector/Paused"]])
+        _Main_ModeSelector_CheckIfBreakpointTriggers_1.setTrigger(None)
+        _Main_ModeSelector_CheckIfBreakpointTriggers_1.setGuard(self._Main_ModeSelector_CheckIfBreakpointTriggers_1_guard)
+        self.states["/Main/ModeSelector/CheckIfBreakpointTriggers"].addTransition(_Main_ModeSelector_CheckIfBreakpointTriggers_1)
+        
+        # transition /Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers
+        _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_0 = Transition(self, self.states["/Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers"], [self.states["/Main/ModeSelector/Paused"]])
+        _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_0.setAction(self._Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_0_exec)
+        _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_0.setTrigger(None)
+        _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_0.setGuard(self._Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_0_guard)
+        self.states["/Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers"].addTransition(_Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_0)
+        _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_1 = Transition(self, self.states["/Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers"], [self.states["/Main/ModeSelector/Running/Continuous/Running"]])
+        _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_1.setTrigger(None)
+        _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_1.setGuard(self._Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_1_guard)
+        self.states["/Main/ModeSelector/Running/Continuous/CheckIfBreakpointTriggers"].addTransition(_Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_1)
+        
         # transition /Main/ModeSelector/Running/Continuous/Running
-        _Main_ModeSelector_Running_Continuous_Running_0 = Transition(self, self.states["/Main/ModeSelector/Running/Continuous/Running"], [self.states["/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd"]])
+        _Main_ModeSelector_Running_Continuous_Running_0 = Transition(self, self.states["/Main/ModeSelector/Running/Continuous/Running"], [self.states["/Main/ModeSelector/WaitingForBigStepToEndPause"]])
         _Main_ModeSelector_Running_Continuous_Running_0.setTrigger(Event("WovenSimulation.Pause", None))
         self.states["/Main/ModeSelector/Running/Continuous/Running"].addTransition(_Main_ModeSelector_Running_Continuous_Running_0)
-        
-        # transition /Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd
-        _Main_ModeSelector_Running_Continuous_WaitingForBigStepToEnd_0 = Transition(self, self.states["/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd"], [self.states["/Main/ModeSelector/Paused"]])
-        _Main_ModeSelector_Running_Continuous_WaitingForBigStepToEnd_0.setTrigger(Event("FSABigStep.Finished", None))
-        self.states["/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd"].addTransition(_Main_ModeSelector_Running_Continuous_WaitingForBigStepToEnd_0)
-        
-        # transition /Main/ModeSelector/Running/Realtime
-        _Main_ModeSelector_Running_Realtime_0 = Transition(self, self.states["/Main/ModeSelector/Running/Realtime"], [self.states["/Main/ModeSelector/Paused"]])
-        _Main_ModeSelector_Running_Realtime_0.setTrigger(Event("WovenSimulation.Pause", None))
-        self.states["/Main/ModeSelector/Running/Realtime"].addTransition(_Main_ModeSelector_Running_Realtime_0)
-        _Main_ModeSelector_Running_Realtime_1 = Transition(self, self.states["/Main/ModeSelector/Running/Realtime"], [self.states["/Main/ModeSelector/Running/Realtime"]])
-        _Main_ModeSelector_Running_Realtime_1.setAction(self._Main_ModeSelector_Running_Realtime_1_exec)
-        _Main_ModeSelector_Running_Realtime_1.setTrigger(Event("FSABigStep.Finished", None))
-        self.states["/Main/ModeSelector/Running/Realtime"].addTransition(_Main_ModeSelector_Running_Realtime_1)
+        _Main_ModeSelector_Running_Continuous_Running_1 = Transition(self, self.states["/Main/ModeSelector/Running/Continuous/Running"], [self.states["/Main/ModeSelector/Paused"]])
+        _Main_ModeSelector_Running_Continuous_Running_1.setAction(self._Main_ModeSelector_Running_Continuous_Running_1_exec)
+        _Main_ModeSelector_Running_Continuous_Running_1.setTrigger(None)
+        _Main_ModeSelector_Running_Continuous_Running_1.setGuard(self._Main_ModeSelector_Running_Continuous_Running_1_guard)
+        self.states["/Main/ModeSelector/Running/Continuous/Running"].addTransition(_Main_ModeSelector_Running_Continuous_Running_1)
+        _Main_ModeSelector_Running_Continuous_Running_2 = Transition(self, self.states["/Main/ModeSelector/Running/Continuous/Running"], [self.states["/Main/ModeSelector/Running/Continuous/Running"]])
+        _Main_ModeSelector_Running_Continuous_Running_2.setAction(self._Main_ModeSelector_Running_Continuous_Running_2_exec)
+        _Main_ModeSelector_Running_Continuous_Running_2.setTrigger(Event("FSABigStep.Finished", None))
+        self.states["/Main/ModeSelector/Running/Continuous/Running"].addTransition(_Main_ModeSelector_Running_Continuous_Running_2)
+        
+        # transition /Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers
+        _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_0 = Transition(self, self.states["/Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers"], [self.states["/Main/ModeSelector/Paused"]])
+        _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_0.setAction(self._Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_0_exec)
+        _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_0.setTrigger(None)
+        _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_0.setGuard(self._Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_0_guard)
+        self.states["/Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers"].addTransition(_Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_0)
+        _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_1 = Transition(self, self.states["/Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers"], [self.states["/Main/ModeSelector/Running/Realtime/Running"]])
+        _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_1.setTrigger(None)
+        _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_1.setGuard(self._Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_1_guard)
+        self.states["/Main/ModeSelector/Running/Realtime/CheckIfBreakpointTriggers"].addTransition(_Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_1)
+        
+        # transition /Main/ModeSelector/Running/Realtime/Running
+        _Main_ModeSelector_Running_Realtime_Running_0 = Transition(self, self.states["/Main/ModeSelector/Running/Realtime/Running"], [self.states["/Main/ModeSelector/WaitingForBigStepToEndPause"]])
+        _Main_ModeSelector_Running_Realtime_Running_0.setTrigger(Event("WovenSimulation.Pause", None))
+        self.states["/Main/ModeSelector/Running/Realtime/Running"].addTransition(_Main_ModeSelector_Running_Realtime_Running_0)
+        _Main_ModeSelector_Running_Realtime_Running_1 = Transition(self, self.states["/Main/ModeSelector/Running/Realtime/Running"], [self.states["/Main/ModeSelector/Paused"]])
+        _Main_ModeSelector_Running_Realtime_Running_1.setAction(self._Main_ModeSelector_Running_Realtime_Running_1_exec)
+        _Main_ModeSelector_Running_Realtime_Running_1.setTrigger(None)
+        _Main_ModeSelector_Running_Realtime_Running_1.setGuard(self._Main_ModeSelector_Running_Realtime_Running_1_guard)
+        self.states["/Main/ModeSelector/Running/Realtime/Running"].addTransition(_Main_ModeSelector_Running_Realtime_Running_1)
+        _Main_ModeSelector_Running_Realtime_Running_2 = Transition(self, self.states["/Main/ModeSelector/Running/Realtime/Running"], [self.states["/Main/ModeSelector/Running/Realtime/Running"]])
+        _Main_ModeSelector_Running_Realtime_Running_2.setAction(self._Main_ModeSelector_Running_Realtime_Running_2_exec)
+        _Main_ModeSelector_Running_Realtime_Running_2.setTrigger(Event("FSABigStep.Finished", None))
+        self.states["/Main/ModeSelector/Running/Realtime/Running"].addTransition(_Main_ModeSelector_Running_Realtime_Running_2)
         
         # transition /Main/ModeSelector/Running/BigStep
-        _Main_ModeSelector_Running_BigStep_0 = Transition(self, self.states["/Main/ModeSelector/Running/BigStep"], [self.states["/Main/ModeSelector/Paused"]])
+        _Main_ModeSelector_Running_BigStep_0 = Transition(self, self.states["/Main/ModeSelector/Running/BigStep"], [self.states["/Main/ModeSelector/CheckIfBreakpointTriggers"]])
         _Main_ModeSelector_Running_BigStep_0.setAction(self._Main_ModeSelector_Running_BigStep_0_exec)
         _Main_ModeSelector_Running_BigStep_0.setTrigger(Event("FSABigStep.Finished", None))
         self.states["/Main/ModeSelector/Running/BigStep"].addTransition(_Main_ModeSelector_Running_BigStep_0)
@@ -1310,11 +1394,6 @@ class WovenSimulator_Simulation(RuntimeClassBase):
         _Main_SimulationFlow_SettleBeforeCheckTermination_0 = Transition(self, self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"], [self.states["/Main/SimulationFlow/CheckTermination"]])
         _Main_SimulationFlow_SettleBeforeCheckTermination_0.setTrigger(Event("_2after"))
         self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"].addTransition(_Main_SimulationFlow_SettleBeforeCheckTermination_0)
-        _Main_SimulationFlow_SettleBeforeCheckTermination_1 = Transition(self, self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"], [self.states["/Main/SimulationFlow/CheckTermination"]])
-        _Main_SimulationFlow_SettleBeforeCheckTermination_1.setAction(self._Main_SimulationFlow_SettleBeforeCheckTermination_1_exec)
-        _Main_SimulationFlow_SettleBeforeCheckTermination_1.setTrigger(None)
-        _Main_SimulationFlow_SettleBeforeCheckTermination_1.setGuard(self._Main_SimulationFlow_SettleBeforeCheckTermination_1_guard)
-        self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"].addTransition(_Main_SimulationFlow_SettleBeforeCheckTermination_1)
         
         # transition /Main/SimulationFlow/CheckTermination
         _Main_SimulationFlow_CheckTermination_0 = Transition(self, self.states["/Main/SimulationFlow/CheckTermination"], [self.states["/Main/SimulationFlow/Executing"]])
@@ -1416,17 +1495,12 @@ class WovenSimulator_Simulation(RuntimeClassBase):
         self.states["/Main/BreakpointManager/Listening"].addTransition(_Main_BreakpointManager_Listening_3)
         
         # transition /Main/ModeSelector/Running
-        _Main_ModeSelector_Running_0 = Transition(self, self.states["/Main/ModeSelector/Running"], [self.states["/Main/ModeSelector/Paused"]])
-        _Main_ModeSelector_Running_0.setAction(self._Main_ModeSelector_Running_0_exec)
-        _Main_ModeSelector_Running_0.setTrigger(None)
-        _Main_ModeSelector_Running_0.setGuard(self._Main_ModeSelector_Running_0_guard)
+        _Main_ModeSelector_Running_0 = Transition(self, self.states["/Main/ModeSelector/Running"], [self.states["/Main/ModeSelector/Stopped"]])
+        _Main_ModeSelector_Running_0.setTrigger(Event("FSASimulation.Finished", None))
         self.states["/Main/ModeSelector/Running"].addTransition(_Main_ModeSelector_Running_0)
         _Main_ModeSelector_Running_1 = Transition(self, self.states["/Main/ModeSelector/Running"], [self.states["/Main/ModeSelector/Stopped"]])
-        _Main_ModeSelector_Running_1.setTrigger(Event("FSASimulation.Finished", None))
+        _Main_ModeSelector_Running_1.setTrigger(Event("CBDSimulation.Finished", None))
         self.states["/Main/ModeSelector/Running"].addTransition(_Main_ModeSelector_Running_1)
-        _Main_ModeSelector_Running_2 = Transition(self, self.states["/Main/ModeSelector/Running"], [self.states["/Main/ModeSelector/Stopped"]])
-        _Main_ModeSelector_Running_2.setTrigger(Event("CBDSimulation.Finished", None))
-        self.states["/Main/ModeSelector/Running"].addTransition(_Main_ModeSelector_Running_2)
         
         # transition /Main/SimulationFlow/SteppedInto
         _Main_SimulationFlow_SteppedInto_0 = Transition(self, self.states["/Main/SimulationFlow/SteppedInto"], [self.states["/Main/SimulationFlow/Executing"]])
@@ -1434,6 +1508,15 @@ class WovenSimulator_Simulation(RuntimeClassBase):
         _Main_SimulationFlow_SteppedInto_0.setTrigger(Event("CBDBigStep.Finished", None))
         self.states["/Main/SimulationFlow/SteppedInto"].addTransition(_Main_SimulationFlow_SteppedInto_0)
     
+    def _Main_ModeSelector_CheckIfBreakpointTriggers_enter(self):
+        self.breakpoint_triggers = self.breakpointTriggers(False)
+    
+    def _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_enter(self):
+        self.breakpoint_triggers = self.breakpointTriggers(False)
+    
+    def _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_enter(self):
+        self.breakpoint_triggers = self.breakpointTriggers(False)
+    
     def _Main_ModeSelector_Stopped_enter(self):
         self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("WovenSimulation.Finished", None, [self.fsa_clock, self.fsa_state])]))
     
@@ -1467,20 +1550,17 @@ class WovenSimulator_Simulation(RuntimeClassBase):
     def _Main_SimulationFlow_SteppedInto_SettleBeforeWaiting_exit(self):
         self.removeTimer(4)
     
-    def _Main_ModeSelector_Running_0_exec(self, parameters):
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("Breakpoint.Triggered", None, [self.triggered_bp, self.fsa_clock, self.fsa_state])]))
-    
-    def _Main_ModeSelector_Running_0_guard(self, parameters):
-        return self.breakpointTriggers(self.inState(["/Main/ModeSelector/Running/Realtime"]))
-    
     def _Main_SimulationFlow_SteppedInto_0_exec(self, parameters):
         cbd_clock = parameters[0]
-        cbd_state = parameters[1]
-        cbd_iteration = parameters[2]
-        cbd_time_next = parameters[3]
+        cbd_iteration = parameters[1]
+        cbd_time_next = parameters[2]
+        cbd_state = parameters[3]
         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.cbd_state = cbd_state
+        self.cbd_iteration = cbd_iteration
+        self.cbd_time_next = cbd_time_next
         self.woven_triggered_when_transition = self.wovenGetTriggeredWhenTransition()
         self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_fsa_simulator', Event("FSASmallStep.Execute", None, [self.woven_triggered_when_transition])]))
         # print 'Executing a FSA small step... (after CBD big step)'
@@ -1525,7 +1605,74 @@ class WovenSimulator_Simulation(RuntimeClassBase):
     def _Main_ModeSelector_ExecutingRealtimeIfInitialized_0_guard(self, parameters):
         return self.inState(["/Main/FSAChildState/Initialized"])
     
-    def _Main_ModeSelector_Running_Realtime_1_exec(self, parameters):
+    def _Main_ModeSelector_WaitingForBigStepToEndPause_0_exec(self, parameters):
+        fsa_clock = parameters[0]
+        fsa_state = parameters[1]
+        fsa_elapsed = parameters[2]
+        fsa_time_next = parameters[3]
+        fsa_event_list = parameters[4]
+        fsa_executed_transition = parameters[5]
+        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("FSABigStep.Finished", None, [fsa_clock, fsa_state, fsa_elapsed, fsa_time_next, fsa_event_list, fsa_executed_transition])]))
+        self.fsa_clock = fsa_clock
+        self.fsa_state = fsa_state
+        self.fsa_elapsed = fsa_elapsed
+        self.fsa_time_next = fsa_time_next
+        self.fsa_event_list = fsa_event_list
+        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("WovenSimulation.Paused", None, [self.fsa_clock, self.fsa_state])]))
+    
+    def _Main_ModeSelector_CheckIfBreakpointTriggers_0_exec(self, parameters):
+        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("Breakpoint.Triggered", None, [self.triggered_bp, self.fsa_clock, self.fsa_state])]))
+    
+    def _Main_ModeSelector_CheckIfBreakpointTriggers_0_guard(self, parameters):
+        return self.breakpoint_triggers
+    
+    def _Main_ModeSelector_CheckIfBreakpointTriggers_1_guard(self, parameters):
+        return not self.breakpoint_triggers
+    
+    def _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_0_exec(self, parameters):
+        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("Breakpoint.Triggered", None, [self.triggered_bp, self.fsa_clock, self.fsa_state])]))
+    
+    def _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_0_guard(self, parameters):
+        return self.breakpoint_triggers
+    
+    def _Main_ModeSelector_Running_Continuous_CheckIfBreakpointTriggers_1_guard(self, parameters):
+        return not self.breakpoint_triggers
+    
+    def _Main_ModeSelector_Running_Continuous_Running_1_exec(self, parameters):
+        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("Breakpoint.Triggered", None, [self.triggered_bp, self.fsa_clock, self.fsa_state])]))
+    
+    def _Main_ModeSelector_Running_Continuous_Running_1_guard(self, parameters):
+        return self.breakpointTriggers(False)
+    
+    def _Main_ModeSelector_Running_Continuous_Running_2_exec(self, parameters):
+        fsa_clock = parameters[0]
+        fsa_state = parameters[1]
+        fsa_elapsed = parameters[2]
+        fsa_time_next = parameters[3]
+        fsa_event_list = parameters[4]
+        fsa_executed_transition = parameters[5]
+        self.fsa_clock = fsa_clock
+        self.fsa_state = fsa_state
+        self.fsa_elapsed = fsa_elapsed
+        self.fsa_time_next = fsa_time_next
+        self.fsa_event_list = fsa_event_list
+    
+    def _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_0_exec(self, parameters):
+        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("Breakpoint.Triggered", None, [self.triggered_bp, self.fsa_clock, self.fsa_state])]))
+    
+    def _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_0_guard(self, parameters):
+        return self.breakpoint_triggers
+    
+    def _Main_ModeSelector_Running_Realtime_CheckIfBreakpointTriggers_1_guard(self, parameters):
+        return not self.breakpoint_triggers
+    
+    def _Main_ModeSelector_Running_Realtime_Running_1_exec(self, parameters):
+        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("Breakpoint.Triggered", None, [self.triggered_bp, self.fsa_clock, self.fsa_state])]))
+    
+    def _Main_ModeSelector_Running_Realtime_Running_1_guard(self, parameters):
+        return self.breakpointTriggers(True)
+    
+    def _Main_ModeSelector_Running_Realtime_Running_2_exec(self, parameters):
         fsa_clock = parameters[0]
         fsa_state = parameters[1]
         fsa_elapsed = parameters[2]
@@ -1662,31 +1809,25 @@ class WovenSimulator_Simulation(RuntimeClassBase):
     def _Main_SimulationFlow_Waiting_0_guard(self, parameters):
         return self.inState(["/Main/ModeSelector/Running"])
     
-    def _Main_SimulationFlow_SettleBeforeCheckTermination_1_exec(self, parameters):
-        self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("WovenSimulation.Paused", None, [self.fsa_clock, self.fsa_state])]))
-    
-    def _Main_SimulationFlow_SettleBeforeCheckTermination_1_guard(self, parameters):
-        return self.inState(["/Main/ModeSelector/Paused"])
-    
     def _Main_SimulationFlow_CheckTermination_0_exec(self, parameters):
         self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_fsa_simulator', Event("FSASmallStep.Execute", None, [None])]))
         # print 'Executing a FSA small step... (no CBD state)'
     
     def _Main_SimulationFlow_CheckTermination_0_guard(self, parameters):
-        return (self.inState(["/Main/ModeSelector/Running/Continuous"]) or self.inState(["/Main/ModeSelector/Running/BigStep"]) or self.inState(["/Main/ModeSelector/Running/SmallStep"])) and self.inState(["/Main/FSAChildState/Initialized"]) and not isinstance(self.fsa_state, CBDState)
+        return (self.inState(["/Main/ModeSelector/Running/Continuous/Running"]) or self.inState(["/Main/ModeSelector/Running/BigStep"]) or self.inState(["/Main/ModeSelector/Running/SmallStep"])) and self.inState(["/Main/FSAChildState/Initialized"]) and not isinstance(self.fsa_state, CBDState)
     
     def _Main_SimulationFlow_CheckTermination_1_exec(self, parameters):
         self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_cbd_simulator', Event("CBDBigStep.Execute", None, [])]))
         # print 'Executing a CBD big step... (CBD state)'
     
     def _Main_SimulationFlow_CheckTermination_1_guard(self, parameters):
-        return (self.inState(["/Main/ModeSelector/Running/Continuous"]) or self.inState(["/Main/ModeSelector/Running/BigStep"]) or self.inState(["/Main/ModeSelector/Running/SmallStep"])) and self.inState(["/Main/CBDChildState/Initialized"]) and isinstance(self.fsa_state, CBDState)
+        return (self.inState(["/Main/ModeSelector/Running/Continuous/Running"]) or self.inState(["/Main/ModeSelector/Running/BigStep"]) or self.inState(["/Main/ModeSelector/Running/SmallStep"])) and self.inState(["/Main/CBDChildState/Initialized"]) and isinstance(self.fsa_state, CBDState)
     
     def _Main_SimulationFlow_CheckTermination_2_guard(self, parameters):
         return self.inState(["/Main/ModeSelector/Running/ChildStep/SmallStep"]) or self.inState(["/Main/ModeSelector/Running/ChildStep/BigStep"])
     
     def _Main_SimulationFlow_CheckTermination_3_guard(self, parameters):
-        return self.inState(["/Main/ModeSelector/Running/Realtime"]) and self.inState(["/Main/FSAChildState/Initialized"])
+        return self.inState(["/Main/ModeSelector/Running/Realtime/Running"]) and self.inState(["/Main/FSAChildState/Initialized"])
     
     def _Main_SimulationFlow_CheckTermination_4_exec(self, parameters):
         # print '>>> (WOVEN) simulation executed <<<'
@@ -1734,12 +1875,15 @@ class WovenSimulator_Simulation(RuntimeClassBase):
     
     def _Main_SimulationFlow_ExecutingCBD_0_exec(self, parameters):
         cbd_clock = parameters[0]
-        cbd_state = parameters[1]
-        cbd_iteration = parameters[2]
-        cbd_time_next = parameters[3]
+        cbd_iteration = parameters[1]
+        cbd_time_next = parameters[2]
+        cbd_state = parameters[3]
         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.cbd_state = cbd_state
+        self.cbd_iteration = cbd_iteration
+        self.cbd_time_next = cbd_time_next
         self.woven_triggered_when_transition = self.wovenGetTriggeredWhenTransition()
         self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_fsa_simulator', Event("FSASmallStep.Execute", None, [self.woven_triggered_when_transition])]))
         # print 'Executing a FSA small step... (after CBD big step)'

+ 14 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/HierarchicalSimulator/woven_sim_coordinator.xml

@@ -55,6 +55,20 @@
                             <parameter expr="state" />
                         </raise>
                     </transition>
+                    <transition target="." event="Breakpoint.Triggered">
+                        <parameter name="triggered_bp" />
+                        <parameter name="clock" />
+                        <parameter name="state" />
+                        <raise event="Breakpoint.Triggered" port="user_output">
+                            <parameter expr="triggered_bp" />
+                            <parameter expr="clock / 1000.0" />
+                            <parameter expr="state" />
+                        </raise>
+                        <raise event="WovenSimulation.State" port="user_output">
+                            <parameter expr="clock / 1000.0" />
+                            <parameter expr="state" />
+                        </raise>
+                    </transition>
                 </state>
                 <state id="WaitingForStepIntoSuccess">
                     <transition target="../Running/StepInto" event="StepInto.Success">

+ 171 - 71
debugging_fsa_cbd_composition/fsa_cbd_simulator/HierarchicalSimulator/woven_sim_simulation.xml

@@ -47,6 +47,7 @@
         <![CDATA[
             self.breakpoints = []
             self.triggered_bp = None
+            self.breakpoint_triggers = False
         ]]>
         </body>
     </method>
@@ -125,7 +126,7 @@
                 return -1
             for bp in self.breakpoints:
                 if bp.name == name:
-                    bp.enabled = enabled
+                    bp.enabled = not bp.enabled
                     break
             return 0
         ]]>
@@ -145,22 +146,26 @@
                 # note that we pass self.time_next instead of self.simulated_time in the case of as-fast-as-possible simulation (or stepping)
                 # this is to make sure that the simulation is stopped BEFORE the specified time is reached, and not AFTER (because we don't necessarily implement 'step back')
                 # in case of realtime simulation, we do pass the current simulated time, since we can stop at (more or less) exactly the right time
-                if breakpoint({'fsa_clock': (self.fsa_clock if is_realtime_simulation else self.fsa_time_next) / 1000.0,
-                               'fsa_state': self.fsa_state,
-                               'fsa_elapsed': self.fsa_elapsed,
-                               'fsa_time_next': self.fsa_time_next,
-                               'cbd_clock': (self.cbd_clock if is_realtime_simulation else self.cbd_time_next) / 1000.0,
-                               'cbd_state': self.cbd_state,
-                               'cbd_iteration': self.cbd_iteration,
-                               'cbd_time_next': self.cbd_time_next}):
-                    # triggered!
-                    self.triggered_bp = bp.name
-                    if bp.disable_on_trigger:
-                        bp.enabled = False
-                    return True
-                else:
-                    # not triggered, so continue
-                    continue
+                try:
+                    if breakpoint({'fsa_clock': (self.fsa_clock if is_realtime_simulation else self.fsa_time_next) / 1000.0,
+                                   'fsa_state': self.fsa_state,
+                                   'fsa_elapsed': self.fsa_elapsed,
+                                   'fsa_time_next': self.fsa_time_next,
+                                   'cbd_clock': (self.cbd_clock if is_realtime_simulation else self.cbd_time_next) / 1000.0,
+                                   'cbd_state': self.cbd_state,
+                                   'cbd_iteration': self.cbd_iteration,
+                                   'cbd_time_next': self.cbd_time_next}):
+                        # triggered!
+                        print 'triggered'
+                        self.triggered_bp = bp.name
+                        if bp.disable_on_trigger:
+                            bp.enabled = False
+                        return True
+                    else:
+                        # not triggered, so continue
+                        continue
+                except AttributeError: 
+                    pass # this means state/clock has not been set yet, so we are at the start of simulation... no breakpoint can trigger
             return False
         ]]>
         </body>
@@ -185,7 +190,7 @@
                     <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">
+                    <transition target="../CheckIfBreakpointTriggers" event="FSABigStep.Finished">
                         <parameter name="fsa_clock" />
                         <parameter name="fsa_state" />
                         <parameter name="fsa_elapsed" />
@@ -207,9 +212,9 @@
                             self.fsa_time_next = fsa_time_next
                             self.fsa_event_list = fsa_event_list
                         </script>
-                   </transition>
-                   <transition target="../Stopped" event="FSASimulation.Finished" />
-                   <transition target="../Stopped" event="CBDSimulation.Finished" />
+                    </transition>
+                    <transition target="../Stopped" event="FSASimulation.Finished" />
+                    <transition target="../Stopped" event="CBDSimulation.Finished" />
                 </state>
                 <state id="ExecutingRealtimeIfInitialized">
                     <transition target="../Running/Realtime" cond="INSTATE('../../FSAChildState/Initialized')">
@@ -222,43 +227,146 @@
                         </script>
                     </transition>
                 </state>
+                <state id="WaitingForBigStepToEndPause">
+                    <!-- If the simulation was paused, it is communicated here up the chain. -->
+                    <transition target="../Paused" event="FSABigStep.Finished">
+                        <parameter name="fsa_clock" />
+                        <parameter name="fsa_state" />
+                        <parameter name="fsa_elapsed" />
+                        <parameter name="fsa_time_next" />
+                        <parameter name="fsa_event_list" />
+                        <parameter name="fsa_executed_transition" />
+                        <raise event="FSABigStep.Finished" scope="narrow" target="'parent'">
+                            <parameter expr="fsa_clock" />
+                            <parameter expr="fsa_state" />
+                            <parameter expr="fsa_elapsed" />
+                            <parameter expr="fsa_time_next" />
+                            <parameter expr="fsa_event_list" />
+                            <parameter expr="fsa_executed_transition" />
+                        </raise>
+                        <script>
+                            self.fsa_clock = fsa_clock
+                            self.fsa_state = fsa_state
+                            self.fsa_elapsed = fsa_elapsed
+                            self.fsa_time_next = fsa_time_next
+                            self.fsa_event_list = fsa_event_list
+                        </script>
+                        <raise event="WovenSimulation.Paused" scope="narrow" target="'parent'">
+                            <parameter expr="self.fsa_clock" />
+                            <parameter expr="self.fsa_state" />
+                        </raise>
+                    </transition>
+                </state>
+                <state id="CheckIfBreakpointTriggers">
+                    <onentry>
+                        <script>
+                            self.breakpoint_triggers = self.breakpointTriggers(False)
+                        </script>
+                    </onentry>
+                    <transition target="../Paused" cond="self.breakpoint_triggers">
+                        <raise event="Breakpoint.Triggered" scope="narrow" target="'parent'">
+                            <parameter expr="self.triggered_bp" />
+                            <parameter expr="self.fsa_clock" />
+                            <parameter expr="self.fsa_state" />
+                        </raise>
+                    </transition>
+                    <transition target="../Paused" cond="not self.breakpoint_triggers" />
+                </state>
                 <state id="Running" initial="Continuous">
-                    <state id="Continuous" initial="Running">
-                        <state id="Running">
-                            <transition target="../WaitingForBigStepToEnd" event="WovenSimulation.Pause" />
+                    <state id="Continuous" initial="CheckIfBreakpointTriggers">
+                        <state id="CheckIfBreakpointTriggers">
+                            <onentry>
+                                <script>
+                                    self.breakpoint_triggers = self.breakpointTriggers(False)
+                                </script>
+                            </onentry>
+                            <transition target="../../../Paused" cond="self.breakpoint_triggers">
+                                <raise event="Breakpoint.Triggered" scope="narrow" target="'parent'">
+                                    <parameter expr="self.triggered_bp" />
+                                    <parameter expr="self.fsa_clock" />
+                                    <parameter expr="self.fsa_state" />
+                                </raise>
+                            </transition>
+                            <transition target="../Running" cond="not self.breakpoint_triggers" />
                         </state>
-                        <state id="WaitingForBigStepToEnd">
-                            <transition target="../../../Paused" event="FSABigStep.Finished" />
+                        <state id="Running">
+                            <transition target="../../../WaitingForBigStepToEndPause" event="WovenSimulation.Pause" />
+                            <transition target="../../../Paused" cond="self.breakpointTriggers(False)">
+                                <raise event="Breakpoint.Triggered" scope="narrow" target="'parent'">
+                                    <parameter expr="self.triggered_bp" />
+                                    <parameter expr="self.fsa_clock" />
+                                    <parameter expr="self.fsa_state" />
+                                </raise>
+                            </transition>
+                            <transition target="." event="FSABigStep.Finished">
+                                <parameter name="fsa_clock" />
+                                <parameter name="fsa_state" />
+                                <parameter name="fsa_elapsed" />
+                                <parameter name="fsa_time_next" />
+                                <parameter name="fsa_event_list" />
+                                <parameter name="fsa_executed_transition" />
+                                <script>
+                                    self.fsa_clock = fsa_clock
+                                    self.fsa_state = fsa_state
+                                    self.fsa_elapsed = fsa_elapsed
+                                    self.fsa_time_next = fsa_time_next
+                                    self.fsa_event_list = fsa_event_list
+                                </script>
+                            </transition>
                         </state>
                     </state>
-                    <state id="Realtime">
-                        <transition target="../../Paused" event="WovenSimulation.Pause" />
-                        <transition target="." event="FSABigStep.Finished">
-                            <parameter name="fsa_clock" />
-                            <parameter name="fsa_state" />
-                            <parameter name="fsa_elapsed" />
-                            <parameter name="fsa_time_next" />
-                            <parameter name="fsa_event_list" />
-                            <parameter name="fsa_executed_transition" />
-                            <raise event="FSABigStep.Finished" scope="narrow" target="'parent'">
-                                <parameter expr="fsa_clock" />
-                                <parameter expr="fsa_state" />
-                                <parameter expr="fsa_elapsed" />
-                                <parameter expr="fsa_time_next" />
-                                <parameter expr="fsa_event_list" />
-                                <parameter expr="fsa_executed_transition" />
-                            </raise>
-                            <script>
-                                self.fsa_clock = fsa_clock
-                                self.fsa_state = fsa_state
-                                self.fsa_elapsed = fsa_elapsed
-                                self.fsa_time_next = fsa_time_next
-                                self.fsa_event_list = fsa_event_list
-                            </script>
-                        </transition>
+                    <state id="Realtime" initial="CheckIfBreakpointTriggers">
+                        <state id="CheckIfBreakpointTriggers">
+                            <onentry>
+                                <script>
+                                    self.breakpoint_triggers = self.breakpointTriggers(False)
+                                </script>
+                            </onentry>
+                            <transition target="../../../Paused" cond="self.breakpoint_triggers">
+                                <raise event="Breakpoint.Triggered" scope="narrow" target="'parent'">
+                                    <parameter expr="self.triggered_bp" />
+                                    <parameter expr="self.fsa_clock" />
+                                    <parameter expr="self.fsa_state" />
+                                </raise>
+                            </transition>
+                            <transition target="../Running" cond="not self.breakpoint_triggers" />
+                        </state>
+                        <state id="Running">
+                            <transition target="../../../WaitingForBigStepToEndPause" event="WovenSimulation.Pause" />
+                            <transition target="../../../Paused" cond="self.breakpointTriggers(True)">
+                                <raise event="Breakpoint.Triggered" scope="narrow" target="'parent'">
+                                    <parameter expr="self.triggered_bp" />
+                                    <parameter expr="self.fsa_clock" />
+                                    <parameter expr="self.fsa_state" />
+                                </raise>
+                            </transition>
+                            <transition target="." event="FSABigStep.Finished">
+                                <parameter name="fsa_clock" />
+                                <parameter name="fsa_state" />
+                                <parameter name="fsa_elapsed" />
+                                <parameter name="fsa_time_next" />
+                                <parameter name="fsa_event_list" />
+                                <parameter name="fsa_executed_transition" />
+                                <raise event="FSABigStep.Finished" scope="narrow" target="'parent'">
+                                    <parameter expr="fsa_clock" />
+                                    <parameter expr="fsa_state" />
+                                    <parameter expr="fsa_elapsed" />
+                                    <parameter expr="fsa_time_next" />
+                                    <parameter expr="fsa_event_list" />
+                                    <parameter expr="fsa_executed_transition" />
+                                </raise>
+                                <script>
+                                    self.fsa_clock = fsa_clock
+                                    self.fsa_state = fsa_state
+                                    self.fsa_elapsed = fsa_elapsed
+                                    self.fsa_time_next = fsa_time_next
+                                    self.fsa_event_list = fsa_event_list
+                                </script>
+                            </transition>
+                        </state>
                     </state>
                     <state id="BigStep">
-                        <transition target="../../Paused" event="FSABigStep.Finished">
+                        <transition target="../../CheckIfBreakpointTriggers" event="FSABigStep.Finished">
                             <parameter name="fsa_clock" />
                             <parameter name="fsa_state" />
                             <parameter name="fsa_elapsed" />
@@ -343,13 +451,6 @@
                             </transition>
                         </state>
                     </state>
-                    <transition target="../Paused" cond="self.breakpointTriggers(INSTATE('Realtime'))">
-                        <raise event="Breakpoint.Triggered" scope="narrow" target="'parent'">
-                            <parameter expr="self.triggered_bp" />
-                            <parameter expr="self.fsa_clock" />
-                            <parameter expr="self.fsa_state" />
-                        </raise>
-                    </transition>
                     <transition target="../Stopped" event="FSASimulation.Finished" />
                     <transition target="../Stopped" event="CBDSimulation.Finished" />
                 </state>
@@ -519,27 +620,20 @@
                 </state>
                 <state id="SettleBeforeCheckTermination">
                     <transition target="../CheckTermination" after="self.sccd_yield()" />
-                    <!-- If the simulation was paused, it is communicated here up the chain. -->
-                    <transition target="../CheckTermination" cond="INSTATE('../../ModeSelector/Paused')">
-                        <raise event="WovenSimulation.Paused" scope="narrow" target="'parent'">
-                            <parameter expr="self.fsa_clock" />
-                            <parameter expr="self.fsa_state" />
-                        </raise>
-                    </transition>
                 </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)">
+                    <transition target="../Executing" cond="(INSTATE('../../ModeSelector/Running/Continuous/Running') 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'">
                             <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)">
+                    <transition target="../ExecutingCBD" cond="(INSTATE('../../ModeSelector/Running/Continuous/Running') 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>
                     </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="../WaitingRealtime" cond="INSTATE('../../ModeSelector/Running/Realtime/Running') and INSTATE('../../FSAChildState/Initialized')" />
                     <transition target="../Stopped" cond="INSTATE('../../ModeSelector/Stopped')">
                         <script>
                         <![CDATA[
@@ -591,13 +685,16 @@
                     </state>
                     <transition target="../Executing" event="CBDBigStep.Finished">
                         <parameter name="cbd_clock" />
-                        <parameter name="cbd_state" />
                         <parameter name="cbd_iteration" />
                         <parameter name="cbd_time_next" />
+                        <parameter name="cbd_state" />
                         <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.cbd_state = cbd_state
+                            self.cbd_iteration = cbd_iteration
+                            self.cbd_time_next = cbd_time_next
                             self.woven_triggered_when_transition = self.wovenGetTriggeredWhenTransition()
                         </script>
                         <raise event="FSASmallStep.Execute" scope="narrow" target="'child_fsa_simulator'">
@@ -609,13 +706,16 @@
                 <state id="ExecutingCBD">
                     <transition target="../Executing" event="CBDBigStep.Finished">
                         <parameter name="cbd_clock" />
-                        <parameter name="cbd_state" />
                         <parameter name="cbd_iteration" />
                         <parameter name="cbd_time_next" />
+                        <parameter name="cbd_state" />
                         <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.cbd_state = cbd_state
+                            self.cbd_iteration = cbd_iteration
+                            self.cbd_time_next = cbd_time_next
                             self.woven_triggered_when_transition = self.wovenGetTriggeredWhenTransition()
                         </script>
                         <raise event="FSASmallStep.Execute" scope="narrow" target="'child_fsa_simulator'">