DeepHistory.c 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. #include <stdlib.h>
  2. #include <string.h>
  3. #include "sc_types.h"
  4. #include "DeepHistory.h"
  5. /*! \file Implementation of the state machine 'DeepHistory'
  6. */
  7. /* prototypes of all internal functions */
  8. static sc_boolean deepHistory_check_mainRegion_State1_tr0_tr0(const DeepHistory* handle);
  9. static sc_boolean deepHistory_check_mainRegion_State2_tr0_tr0(const DeepHistory* handle);
  10. static sc_boolean deepHistory_check_mainRegion_State2__region0_a_tr0_tr0(const DeepHistory* handle);
  11. static sc_boolean deepHistory_check_mainRegion_State2__region0_State4_tr0_tr0(const DeepHistory* handle);
  12. static sc_boolean deepHistory_check_mainRegion_State2__region0_State4__region0_State6_tr0_tr0(const DeepHistory* handle);
  13. static sc_boolean deepHistory_check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0(const DeepHistory* handle);
  14. static sc_boolean deepHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0_tr0(const DeepHistory* handle);
  15. static sc_boolean deepHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0_tr0(const DeepHistory* handle);
  16. static void deepHistory_effect_mainRegion_State1_tr0(DeepHistory* handle);
  17. static void deepHistory_effect_mainRegion_State2_tr0(DeepHistory* handle);
  18. static void deepHistory_effect_mainRegion_State2__region0_a_tr0(DeepHistory* handle);
  19. static void deepHistory_effect_mainRegion_State2__region0_State4_tr0(DeepHistory* handle);
  20. static void deepHistory_effect_mainRegion_State2__region0_State4__region0_State6_tr0(DeepHistory* handle);
  21. static void deepHistory_effect_mainRegion_State2__region0_State4__region0_State7_tr0(DeepHistory* handle);
  22. static void deepHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0(DeepHistory* handle);
  23. static void deepHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0(DeepHistory* handle);
  24. static void deepHistory_enseq_mainRegion_State1_default(DeepHistory* handle);
  25. static void deepHistory_enseq_mainRegion_State2_default(DeepHistory* handle);
  26. static void deepHistory_enseq_mainRegion_State2__region0_a_default(DeepHistory* handle);
  27. static void deepHistory_enseq_mainRegion_State2__region0_State4_default(DeepHistory* handle);
  28. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_State6_default(DeepHistory* handle);
  29. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7_default(DeepHistory* handle);
  30. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State8_default(DeepHistory* handle);
  31. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State9_default(DeepHistory* handle);
  32. static void deepHistory_enseq_mainRegion_State2__region0_State5_default(DeepHistory* handle);
  33. static void deepHistory_enseq_mainRegion_default(DeepHistory* handle);
  34. static void deepHistory_enseq_mainRegion_State2__region0_default(DeepHistory* handle);
  35. static void deepHistory_dhenseq_mainRegion_State2__region0(DeepHistory* handle);
  36. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_default(DeepHistory* handle);
  37. static void deepHistory_dhenseq_mainRegion_State2__region0_State4__region0(DeepHistory* handle);
  38. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_default(DeepHistory* handle);
  39. static void deepHistory_dhenseq_mainRegion_State2__region0_State4__region0_State7__region0(DeepHistory* handle);
  40. static void deepHistory_exseq_mainRegion_State1(DeepHistory* handle);
  41. static void deepHistory_exseq_mainRegion_State2(DeepHistory* handle);
  42. static void deepHistory_exseq_mainRegion_State2__region0_a(DeepHistory* handle);
  43. static void deepHistory_exseq_mainRegion_State2__region0_State4(DeepHistory* handle);
  44. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0_State6(DeepHistory* handle);
  45. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7(DeepHistory* handle);
  46. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(DeepHistory* handle);
  47. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(DeepHistory* handle);
  48. static void deepHistory_exseq_mainRegion_State2__region0_State5(DeepHistory* handle);
  49. static void deepHistory_exseq_mainRegion(DeepHistory* handle);
  50. static void deepHistory_exseq_mainRegion_State2__region0(DeepHistory* handle);
  51. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0(DeepHistory* handle);
  52. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0(DeepHistory* handle);
  53. static void deepHistory_react_mainRegion_State1(DeepHistory* handle);
  54. static void deepHistory_react_mainRegion_State2__region0_a(DeepHistory* handle);
  55. static void deepHistory_react_mainRegion_State2__region0_State4__region0_State6(DeepHistory* handle);
  56. static void deepHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State8(DeepHistory* handle);
  57. static void deepHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State9(DeepHistory* handle);
  58. static void deepHistory_react_mainRegion_State2__region0_State5(DeepHistory* handle);
  59. static void deepHistory_react_mainRegion__entry_Default(DeepHistory* handle);
  60. static void deepHistory_react_mainRegion_State2__region0_State4__region0__entry_Default(DeepHistory* handle);
  61. static void deepHistory_react_mainRegion_State2__region0_State4__region0_State7__region0__entry_Default(DeepHistory* handle);
  62. static void deepHistory_react_mainRegion_State2__region0__entry_Default(DeepHistory* handle);
  63. static void deepHistory_clearInEvents(DeepHistory* handle);
  64. static void deepHistory_clearOutEvents(DeepHistory* handle);
  65. void deepHistory_init(DeepHistory* handle)
  66. {
  67. sc_integer i;
  68. for (i = 0; i < DEEPHISTORY_MAX_ORTHOGONAL_STATES; ++i)
  69. {
  70. handle->stateConfVector[i] = DeepHistory_last_state;
  71. }
  72. for (i = 0; i < DEEPHISTORY_MAX_HISTORY_STATES; ++i)
  73. {
  74. handle->historyVector[i] = DeepHistory_last_state;
  75. }
  76. handle->stateConfVectorPosition = 0;
  77. deepHistory_clearInEvents(handle);
  78. deepHistory_clearOutEvents(handle);
  79. }
  80. void deepHistory_enter(DeepHistory* handle)
  81. {
  82. /* Default enter sequence for statechart DeepHistory */
  83. deepHistory_enseq_mainRegion_default(handle);
  84. }
  85. void deepHistory_exit(DeepHistory* handle)
  86. {
  87. /* Default exit sequence for statechart DeepHistory */
  88. deepHistory_exseq_mainRegion(handle);
  89. }
  90. sc_boolean deepHistory_isActive(const DeepHistory* handle)
  91. {
  92. sc_boolean result = bool_false;
  93. int i;
  94. for(i = 0; i < DEEPHISTORY_MAX_ORTHOGONAL_STATES; i++)
  95. {
  96. result = result || handle->stateConfVector[i] != DeepHistory_last_state;
  97. }
  98. return result;
  99. }
  100. /*
  101. * Always returns 'false' since this state machine can never become final.
  102. */
  103. sc_boolean deepHistory_isFinal(const DeepHistory* handle)
  104. {
  105. return bool_false;
  106. }
  107. static void deepHistory_clearInEvents(DeepHistory* handle)
  108. {
  109. handle->iface.event1_raised = bool_false;
  110. handle->iface.event2_raised = bool_false;
  111. handle->iface.event3_raised = bool_false;
  112. handle->iface.event4_raised = bool_false;
  113. handle->iface.event5_raised = bool_false;
  114. handle->iface.event6_raised = bool_false;
  115. handle->iface.event7_raised = bool_false;
  116. handle->iface.event8_raised = bool_false;
  117. handle->iface.event9_raised = bool_false;
  118. }
  119. static void deepHistory_clearOutEvents(DeepHistory* handle)
  120. {
  121. }
  122. void deepHistory_runCycle(DeepHistory* handle)
  123. {
  124. deepHistory_clearOutEvents(handle);
  125. for (handle->stateConfVectorPosition = 0;
  126. handle->stateConfVectorPosition < DEEPHISTORY_MAX_ORTHOGONAL_STATES;
  127. handle->stateConfVectorPosition++)
  128. {
  129. switch (handle->stateConfVector[handle->stateConfVectorPosition])
  130. {
  131. case DeepHistory_mainRegion_State1 :
  132. {
  133. deepHistory_react_mainRegion_State1(handle);
  134. break;
  135. }
  136. case DeepHistory_mainRegion_State2__region0_a :
  137. {
  138. deepHistory_react_mainRegion_State2__region0_a(handle);
  139. break;
  140. }
  141. case DeepHistory_mainRegion_State2__region0_State4__region0_State6 :
  142. {
  143. deepHistory_react_mainRegion_State2__region0_State4__region0_State6(handle);
  144. break;
  145. }
  146. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  147. {
  148. deepHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  149. break;
  150. }
  151. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  152. {
  153. deepHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  154. break;
  155. }
  156. case DeepHistory_mainRegion_State2__region0_State5 :
  157. {
  158. deepHistory_react_mainRegion_State2__region0_State5(handle);
  159. break;
  160. }
  161. default:
  162. break;
  163. }
  164. }
  165. deepHistory_clearInEvents(handle);
  166. }
  167. sc_boolean deepHistory_isStateActive(const DeepHistory* handle, DeepHistoryStates state)
  168. {
  169. sc_boolean result = bool_false;
  170. switch (state)
  171. {
  172. case DeepHistory_mainRegion_State1 :
  173. result = (sc_boolean) (handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE1] == DeepHistory_mainRegion_State1
  174. );
  175. break;
  176. case DeepHistory_mainRegion_State2 :
  177. result = (sc_boolean) (handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2] >= DeepHistory_mainRegion_State2
  178. && handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2] <= DeepHistory_mainRegion_State2__region0_State5);
  179. break;
  180. case DeepHistory_mainRegion_State2__region0_a :
  181. result = (sc_boolean) (handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2__REGION0_A] == DeepHistory_mainRegion_State2__region0_a
  182. );
  183. break;
  184. case DeepHistory_mainRegion_State2__region0_State4 :
  185. result = (sc_boolean) (handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2__REGION0_STATE4] >= DeepHistory_mainRegion_State2__region0_State4
  186. && handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2__REGION0_STATE4] <= DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9);
  187. break;
  188. case DeepHistory_mainRegion_State2__region0_State4__region0_State6 :
  189. result = (sc_boolean) (handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2__REGION0_STATE4__REGION0_STATE6] == DeepHistory_mainRegion_State2__region0_State4__region0_State6
  190. );
  191. break;
  192. case DeepHistory_mainRegion_State2__region0_State4__region0_State7 :
  193. result = (sc_boolean) (handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2__REGION0_STATE4__REGION0_STATE7] >= DeepHistory_mainRegion_State2__region0_State4__region0_State7
  194. && handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2__REGION0_STATE4__REGION0_STATE7] <= DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9);
  195. break;
  196. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  197. result = (sc_boolean) (handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2__REGION0_STATE4__REGION0_STATE7__REGION0_STATE8] == DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8
  198. );
  199. break;
  200. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  201. result = (sc_boolean) (handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2__REGION0_STATE4__REGION0_STATE7__REGION0_STATE9] == DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9
  202. );
  203. break;
  204. case DeepHistory_mainRegion_State2__region0_State5 :
  205. result = (sc_boolean) (handle->stateConfVector[SCVI_DEEPHISTORY_MAINREGION_STATE2__REGION0_STATE5] == DeepHistory_mainRegion_State2__region0_State5
  206. );
  207. break;
  208. default:
  209. result = bool_false;
  210. break;
  211. }
  212. return result;
  213. }
  214. void deepHistoryIface_raise_event1(DeepHistory* handle)
  215. {
  216. handle->iface.event1_raised = bool_true;
  217. }
  218. void deepHistoryIface_raise_event2(DeepHistory* handle)
  219. {
  220. handle->iface.event2_raised = bool_true;
  221. }
  222. void deepHistoryIface_raise_event3(DeepHistory* handle)
  223. {
  224. handle->iface.event3_raised = bool_true;
  225. }
  226. void deepHistoryIface_raise_event4(DeepHistory* handle)
  227. {
  228. handle->iface.event4_raised = bool_true;
  229. }
  230. void deepHistoryIface_raise_event5(DeepHistory* handle)
  231. {
  232. handle->iface.event5_raised = bool_true;
  233. }
  234. void deepHistoryIface_raise_event6(DeepHistory* handle)
  235. {
  236. handle->iface.event6_raised = bool_true;
  237. }
  238. void deepHistoryIface_raise_event7(DeepHistory* handle)
  239. {
  240. handle->iface.event7_raised = bool_true;
  241. }
  242. void deepHistoryIface_raise_event8(DeepHistory* handle)
  243. {
  244. handle->iface.event8_raised = bool_true;
  245. }
  246. void deepHistoryIface_raise_event9(DeepHistory* handle)
  247. {
  248. handle->iface.event9_raised = bool_true;
  249. }
  250. /* implementations of all internal functions */
  251. static sc_boolean deepHistory_check_mainRegion_State1_tr0_tr0(const DeepHistory* handle)
  252. {
  253. return handle->iface.event1_raised;
  254. }
  255. static sc_boolean deepHistory_check_mainRegion_State2_tr0_tr0(const DeepHistory* handle)
  256. {
  257. return handle->iface.event2_raised;
  258. }
  259. static sc_boolean deepHistory_check_mainRegion_State2__region0_a_tr0_tr0(const DeepHistory* handle)
  260. {
  261. return handle->iface.event3_raised;
  262. }
  263. static sc_boolean deepHistory_check_mainRegion_State2__region0_State4_tr0_tr0(const DeepHistory* handle)
  264. {
  265. return handle->iface.event4_raised;
  266. }
  267. static sc_boolean deepHistory_check_mainRegion_State2__region0_State4__region0_State6_tr0_tr0(const DeepHistory* handle)
  268. {
  269. return handle->iface.event5_raised;
  270. }
  271. static sc_boolean deepHistory_check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0(const DeepHistory* handle)
  272. {
  273. return handle->iface.event6_raised;
  274. }
  275. static sc_boolean deepHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0_tr0(const DeepHistory* handle)
  276. {
  277. return handle->iface.event7_raised;
  278. }
  279. static sc_boolean deepHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0_tr0(const DeepHistory* handle)
  280. {
  281. return handle->iface.event8_raised;
  282. }
  283. static void deepHistory_effect_mainRegion_State1_tr0(DeepHistory* handle)
  284. {
  285. deepHistory_exseq_mainRegion_State1(handle);
  286. deepHistory_enseq_mainRegion_State2_default(handle);
  287. }
  288. static void deepHistory_effect_mainRegion_State2_tr0(DeepHistory* handle)
  289. {
  290. deepHistory_exseq_mainRegion_State2(handle);
  291. deepHistory_enseq_mainRegion_State1_default(handle);
  292. }
  293. static void deepHistory_effect_mainRegion_State2__region0_a_tr0(DeepHistory* handle)
  294. {
  295. deepHistory_exseq_mainRegion_State2__region0_a(handle);
  296. deepHistory_enseq_mainRegion_State2__region0_State4_default(handle);
  297. }
  298. static void deepHistory_effect_mainRegion_State2__region0_State4_tr0(DeepHistory* handle)
  299. {
  300. deepHistory_exseq_mainRegion_State2__region0_State4(handle);
  301. deepHistory_enseq_mainRegion_State2__region0_State5_default(handle);
  302. }
  303. static void deepHistory_effect_mainRegion_State2__region0_State4__region0_State6_tr0(DeepHistory* handle)
  304. {
  305. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State6(handle);
  306. deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7_default(handle);
  307. }
  308. static void deepHistory_effect_mainRegion_State2__region0_State4__region0_State7_tr0(DeepHistory* handle)
  309. {
  310. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7(handle);
  311. deepHistory_enseq_mainRegion_State2__region0_State4__region0_State6_default(handle);
  312. }
  313. static void deepHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0(DeepHistory* handle)
  314. {
  315. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  316. deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State9_default(handle);
  317. }
  318. static void deepHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0(DeepHistory* handle)
  319. {
  320. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  321. deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State8_default(handle);
  322. }
  323. /* 'default' enter sequence for state State1 */
  324. static void deepHistory_enseq_mainRegion_State1_default(DeepHistory* handle)
  325. {
  326. /* 'default' enter sequence for state State1 */
  327. handle->stateConfVector[0] = DeepHistory_mainRegion_State1;
  328. handle->stateConfVectorPosition = 0;
  329. }
  330. /* 'default' enter sequence for state State2 */
  331. static void deepHistory_enseq_mainRegion_State2_default(DeepHistory* handle)
  332. {
  333. /* 'default' enter sequence for state State2 */
  334. deepHistory_enseq_mainRegion_State2__region0_default(handle);
  335. }
  336. /* 'default' enter sequence for state a */
  337. static void deepHistory_enseq_mainRegion_State2__region0_a_default(DeepHistory* handle)
  338. {
  339. /* 'default' enter sequence for state a */
  340. handle->stateConfVector[0] = DeepHistory_mainRegion_State2__region0_a;
  341. handle->stateConfVectorPosition = 0;
  342. handle->historyVector[0] = handle->stateConfVector[0];
  343. }
  344. /* 'default' enter sequence for state State4 */
  345. static void deepHistory_enseq_mainRegion_State2__region0_State4_default(DeepHistory* handle)
  346. {
  347. /* 'default' enter sequence for state State4 */
  348. deepHistory_enseq_mainRegion_State2__region0_State4__region0_default(handle);
  349. handle->historyVector[0] = handle->stateConfVector[0];
  350. }
  351. /* 'default' enter sequence for state State6 */
  352. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_State6_default(DeepHistory* handle)
  353. {
  354. /* 'default' enter sequence for state State6 */
  355. handle->stateConfVector[0] = DeepHistory_mainRegion_State2__region0_State4__region0_State6;
  356. handle->stateConfVectorPosition = 0;
  357. handle->historyVector[1] = handle->stateConfVector[0];
  358. }
  359. /* 'default' enter sequence for state State7 */
  360. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7_default(DeepHistory* handle)
  361. {
  362. /* 'default' enter sequence for state State7 */
  363. deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_default(handle);
  364. handle->historyVector[1] = handle->stateConfVector[0];
  365. }
  366. /* 'default' enter sequence for state State8 */
  367. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State8_default(DeepHistory* handle)
  368. {
  369. /* 'default' enter sequence for state State8 */
  370. handle->stateConfVector[0] = DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8;
  371. handle->stateConfVectorPosition = 0;
  372. handle->historyVector[2] = handle->stateConfVector[0];
  373. }
  374. /* 'default' enter sequence for state State9 */
  375. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State9_default(DeepHistory* handle)
  376. {
  377. /* 'default' enter sequence for state State9 */
  378. handle->stateConfVector[0] = DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9;
  379. handle->stateConfVectorPosition = 0;
  380. handle->historyVector[2] = handle->stateConfVector[0];
  381. }
  382. /* 'default' enter sequence for state State5 */
  383. static void deepHistory_enseq_mainRegion_State2__region0_State5_default(DeepHistory* handle)
  384. {
  385. /* 'default' enter sequence for state State5 */
  386. handle->stateConfVector[0] = DeepHistory_mainRegion_State2__region0_State5;
  387. handle->stateConfVectorPosition = 0;
  388. handle->historyVector[0] = handle->stateConfVector[0];
  389. }
  390. /* 'default' enter sequence for region mainRegion */
  391. static void deepHistory_enseq_mainRegion_default(DeepHistory* handle)
  392. {
  393. /* 'default' enter sequence for region mainRegion */
  394. deepHistory_react_mainRegion__entry_Default(handle);
  395. }
  396. /* 'default' enter sequence for region null */
  397. static void deepHistory_enseq_mainRegion_State2__region0_default(DeepHistory* handle)
  398. {
  399. /* 'default' enter sequence for region null */
  400. deepHistory_react_mainRegion_State2__region0__entry_Default(handle);
  401. }
  402. /* deep enterSequence with history in child null */
  403. static void deepHistory_dhenseq_mainRegion_State2__region0(DeepHistory* handle)
  404. {
  405. /* deep enterSequence with history in child null */
  406. /* Handle deep history entry of null */
  407. switch(handle->historyVector[ 0 ])
  408. {
  409. case DeepHistory_mainRegion_State2__region0_a :
  410. {
  411. /* enterSequence with history in child a for leaf a */
  412. deepHistory_enseq_mainRegion_State2__region0_a_default(handle);
  413. break;
  414. }
  415. case DeepHistory_mainRegion_State2__region0_State4__region0_State6 :
  416. {
  417. /* enterSequence with history in child State4 for leaf State6 */
  418. deepHistory_dhenseq_mainRegion_State2__region0_State4__region0(handle);
  419. break;
  420. }
  421. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  422. {
  423. /* enterSequence with history in child State4 for leaf State8 */
  424. deepHistory_dhenseq_mainRegion_State2__region0_State4__region0(handle);
  425. break;
  426. }
  427. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  428. {
  429. /* enterSequence with history in child State4 for leaf State9 */
  430. deepHistory_dhenseq_mainRegion_State2__region0_State4__region0(handle);
  431. break;
  432. }
  433. case DeepHistory_mainRegion_State2__region0_State5 :
  434. {
  435. /* enterSequence with history in child State5 for leaf State5 */
  436. deepHistory_enseq_mainRegion_State2__region0_State5_default(handle);
  437. break;
  438. }
  439. default: break;
  440. }
  441. }
  442. /* 'default' enter sequence for region null */
  443. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_default(DeepHistory* handle)
  444. {
  445. /* 'default' enter sequence for region null */
  446. deepHistory_react_mainRegion_State2__region0_State4__region0__entry_Default(handle);
  447. }
  448. /* deep enterSequence with history in child null */
  449. static void deepHistory_dhenseq_mainRegion_State2__region0_State4__region0(DeepHistory* handle)
  450. {
  451. /* deep enterSequence with history in child null */
  452. /* Handle deep history entry of null */
  453. switch(handle->historyVector[ 1 ])
  454. {
  455. case DeepHistory_mainRegion_State2__region0_State4__region0_State6 :
  456. {
  457. /* enterSequence with history in child State6 for leaf State6 */
  458. deepHistory_enseq_mainRegion_State2__region0_State4__region0_State6_default(handle);
  459. break;
  460. }
  461. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  462. {
  463. /* enterSequence with history in child State7 for leaf State8 */
  464. deepHistory_dhenseq_mainRegion_State2__region0_State4__region0_State7__region0(handle);
  465. break;
  466. }
  467. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  468. {
  469. /* enterSequence with history in child State7 for leaf State9 */
  470. deepHistory_dhenseq_mainRegion_State2__region0_State4__region0_State7__region0(handle);
  471. break;
  472. }
  473. default: break;
  474. }
  475. }
  476. /* 'default' enter sequence for region null */
  477. static void deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_default(DeepHistory* handle)
  478. {
  479. /* 'default' enter sequence for region null */
  480. deepHistory_react_mainRegion_State2__region0_State4__region0_State7__region0__entry_Default(handle);
  481. }
  482. /* deep enterSequence with history in child null */
  483. static void deepHistory_dhenseq_mainRegion_State2__region0_State4__region0_State7__region0(DeepHistory* handle)
  484. {
  485. /* deep enterSequence with history in child null */
  486. /* Handle deep history entry of null */
  487. switch(handle->historyVector[ 2 ])
  488. {
  489. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  490. {
  491. /* enterSequence with history in child State8 for leaf State8 */
  492. deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State8_default(handle);
  493. break;
  494. }
  495. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  496. {
  497. /* enterSequence with history in child State9 for leaf State9 */
  498. deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State9_default(handle);
  499. break;
  500. }
  501. default: break;
  502. }
  503. }
  504. /* Default exit sequence for state State1 */
  505. static void deepHistory_exseq_mainRegion_State1(DeepHistory* handle)
  506. {
  507. /* Default exit sequence for state State1 */
  508. handle->stateConfVector[0] = DeepHistory_last_state;
  509. handle->stateConfVectorPosition = 0;
  510. }
  511. /* Default exit sequence for state State2 */
  512. static void deepHistory_exseq_mainRegion_State2(DeepHistory* handle)
  513. {
  514. /* Default exit sequence for state State2 */
  515. deepHistory_exseq_mainRegion_State2__region0(handle);
  516. }
  517. /* Default exit sequence for state a */
  518. static void deepHistory_exseq_mainRegion_State2__region0_a(DeepHistory* handle)
  519. {
  520. /* Default exit sequence for state a */
  521. handle->stateConfVector[0] = DeepHistory_last_state;
  522. handle->stateConfVectorPosition = 0;
  523. }
  524. /* Default exit sequence for state State4 */
  525. static void deepHistory_exseq_mainRegion_State2__region0_State4(DeepHistory* handle)
  526. {
  527. /* Default exit sequence for state State4 */
  528. deepHistory_exseq_mainRegion_State2__region0_State4__region0(handle);
  529. }
  530. /* Default exit sequence for state State6 */
  531. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0_State6(DeepHistory* handle)
  532. {
  533. /* Default exit sequence for state State6 */
  534. handle->stateConfVector[0] = DeepHistory_last_state;
  535. handle->stateConfVectorPosition = 0;
  536. }
  537. /* Default exit sequence for state State7 */
  538. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7(DeepHistory* handle)
  539. {
  540. /* Default exit sequence for state State7 */
  541. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0(handle);
  542. }
  543. /* Default exit sequence for state State8 */
  544. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(DeepHistory* handle)
  545. {
  546. /* Default exit sequence for state State8 */
  547. handle->stateConfVector[0] = DeepHistory_last_state;
  548. handle->stateConfVectorPosition = 0;
  549. }
  550. /* Default exit sequence for state State9 */
  551. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(DeepHistory* handle)
  552. {
  553. /* Default exit sequence for state State9 */
  554. handle->stateConfVector[0] = DeepHistory_last_state;
  555. handle->stateConfVectorPosition = 0;
  556. }
  557. /* Default exit sequence for state State5 */
  558. static void deepHistory_exseq_mainRegion_State2__region0_State5(DeepHistory* handle)
  559. {
  560. /* Default exit sequence for state State5 */
  561. handle->stateConfVector[0] = DeepHistory_last_state;
  562. handle->stateConfVectorPosition = 0;
  563. }
  564. /* Default exit sequence for region mainRegion */
  565. static void deepHistory_exseq_mainRegion(DeepHistory* handle)
  566. {
  567. /* Default exit sequence for region mainRegion */
  568. /* Handle exit of all possible states (of DeepHistory.mainRegion) at position 0... */
  569. switch(handle->stateConfVector[ 0 ])
  570. {
  571. case DeepHistory_mainRegion_State1 :
  572. {
  573. deepHistory_exseq_mainRegion_State1(handle);
  574. break;
  575. }
  576. case DeepHistory_mainRegion_State2__region0_a :
  577. {
  578. deepHistory_exseq_mainRegion_State2__region0_a(handle);
  579. break;
  580. }
  581. case DeepHistory_mainRegion_State2__region0_State4__region0_State6 :
  582. {
  583. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State6(handle);
  584. break;
  585. }
  586. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  587. {
  588. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  589. break;
  590. }
  591. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  592. {
  593. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  594. break;
  595. }
  596. case DeepHistory_mainRegion_State2__region0_State5 :
  597. {
  598. deepHistory_exseq_mainRegion_State2__region0_State5(handle);
  599. break;
  600. }
  601. default: break;
  602. }
  603. }
  604. /* Default exit sequence for region null */
  605. static void deepHistory_exseq_mainRegion_State2__region0(DeepHistory* handle)
  606. {
  607. /* Default exit sequence for region null */
  608. /* Handle exit of all possible states (of DeepHistory.mainRegion.State2._region0) at position 0... */
  609. switch(handle->stateConfVector[ 0 ])
  610. {
  611. case DeepHistory_mainRegion_State2__region0_a :
  612. {
  613. deepHistory_exseq_mainRegion_State2__region0_a(handle);
  614. break;
  615. }
  616. case DeepHistory_mainRegion_State2__region0_State4__region0_State6 :
  617. {
  618. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State6(handle);
  619. break;
  620. }
  621. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  622. {
  623. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  624. break;
  625. }
  626. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  627. {
  628. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  629. break;
  630. }
  631. case DeepHistory_mainRegion_State2__region0_State5 :
  632. {
  633. deepHistory_exseq_mainRegion_State2__region0_State5(handle);
  634. break;
  635. }
  636. default: break;
  637. }
  638. }
  639. /* Default exit sequence for region null */
  640. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0(DeepHistory* handle)
  641. {
  642. /* Default exit sequence for region null */
  643. /* Handle exit of all possible states (of DeepHistory.mainRegion.State2._region0.State4._region0) at position 0... */
  644. switch(handle->stateConfVector[ 0 ])
  645. {
  646. case DeepHistory_mainRegion_State2__region0_State4__region0_State6 :
  647. {
  648. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State6(handle);
  649. break;
  650. }
  651. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  652. {
  653. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  654. break;
  655. }
  656. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  657. {
  658. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  659. break;
  660. }
  661. default: break;
  662. }
  663. }
  664. /* Default exit sequence for region null */
  665. static void deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0(DeepHistory* handle)
  666. {
  667. /* Default exit sequence for region null */
  668. /* Handle exit of all possible states (of DeepHistory.mainRegion.State2._region0.State4._region0.State7._region0) at position 0... */
  669. switch(handle->stateConfVector[ 0 ])
  670. {
  671. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 :
  672. {
  673. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State8(handle);
  674. break;
  675. }
  676. case DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 :
  677. {
  678. deepHistory_exseq_mainRegion_State2__region0_State4__region0_State7__region0_State9(handle);
  679. break;
  680. }
  681. default: break;
  682. }
  683. }
  684. /* The reactions of state State1. */
  685. static void deepHistory_react_mainRegion_State1(DeepHistory* handle)
  686. {
  687. /* The reactions of state State1. */
  688. if (deepHistory_check_mainRegion_State1_tr0_tr0(handle) == bool_true)
  689. {
  690. deepHistory_effect_mainRegion_State1_tr0(handle);
  691. }
  692. }
  693. /* The reactions of state a. */
  694. static void deepHistory_react_mainRegion_State2__region0_a(DeepHistory* handle)
  695. {
  696. /* The reactions of state a. */
  697. if (deepHistory_check_mainRegion_State2_tr0_tr0(handle) == bool_true)
  698. {
  699. deepHistory_effect_mainRegion_State2_tr0(handle);
  700. } else
  701. {
  702. if (deepHistory_check_mainRegion_State2__region0_a_tr0_tr0(handle) == bool_true)
  703. {
  704. deepHistory_effect_mainRegion_State2__region0_a_tr0(handle);
  705. }
  706. }
  707. }
  708. /* The reactions of state State6. */
  709. static void deepHistory_react_mainRegion_State2__region0_State4__region0_State6(DeepHistory* handle)
  710. {
  711. /* The reactions of state State6. */
  712. if (deepHistory_check_mainRegion_State2_tr0_tr0(handle) == bool_true)
  713. {
  714. deepHistory_effect_mainRegion_State2_tr0(handle);
  715. } else
  716. {
  717. if (deepHistory_check_mainRegion_State2__region0_State4_tr0_tr0(handle) == bool_true)
  718. {
  719. deepHistory_effect_mainRegion_State2__region0_State4_tr0(handle);
  720. } else
  721. {
  722. if (deepHistory_check_mainRegion_State2__region0_State4__region0_State6_tr0_tr0(handle) == bool_true)
  723. {
  724. deepHistory_effect_mainRegion_State2__region0_State4__region0_State6_tr0(handle);
  725. }
  726. }
  727. }
  728. }
  729. /* The reactions of state State8. */
  730. static void deepHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State8(DeepHistory* handle)
  731. {
  732. /* The reactions of state State8. */
  733. if (deepHistory_check_mainRegion_State2_tr0_tr0(handle) == bool_true)
  734. {
  735. deepHistory_effect_mainRegion_State2_tr0(handle);
  736. } else
  737. {
  738. if (deepHistory_check_mainRegion_State2__region0_State4_tr0_tr0(handle) == bool_true)
  739. {
  740. deepHistory_effect_mainRegion_State2__region0_State4_tr0(handle);
  741. } else
  742. {
  743. if (deepHistory_check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0(handle) == bool_true)
  744. {
  745. deepHistory_effect_mainRegion_State2__region0_State4__region0_State7_tr0(handle);
  746. } else
  747. {
  748. if (deepHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0_tr0(handle) == bool_true)
  749. {
  750. deepHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0(handle);
  751. }
  752. }
  753. }
  754. }
  755. }
  756. /* The reactions of state State9. */
  757. static void deepHistory_react_mainRegion_State2__region0_State4__region0_State7__region0_State9(DeepHistory* handle)
  758. {
  759. /* The reactions of state State9. */
  760. if (deepHistory_check_mainRegion_State2_tr0_tr0(handle) == bool_true)
  761. {
  762. deepHistory_effect_mainRegion_State2_tr0(handle);
  763. } else
  764. {
  765. if (deepHistory_check_mainRegion_State2__region0_State4_tr0_tr0(handle) == bool_true)
  766. {
  767. deepHistory_effect_mainRegion_State2__region0_State4_tr0(handle);
  768. } else
  769. {
  770. if (deepHistory_check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0(handle) == bool_true)
  771. {
  772. deepHistory_effect_mainRegion_State2__region0_State4__region0_State7_tr0(handle);
  773. } else
  774. {
  775. if (deepHistory_check_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0_tr0(handle) == bool_true)
  776. {
  777. deepHistory_effect_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0(handle);
  778. }
  779. }
  780. }
  781. }
  782. }
  783. /* The reactions of state State5. */
  784. static void deepHistory_react_mainRegion_State2__region0_State5(DeepHistory* handle)
  785. {
  786. /* The reactions of state State5. */
  787. if (deepHistory_check_mainRegion_State2_tr0_tr0(handle) == bool_true)
  788. {
  789. deepHistory_effect_mainRegion_State2_tr0(handle);
  790. } else
  791. {
  792. }
  793. }
  794. /* Default react sequence for initial entry */
  795. static void deepHistory_react_mainRegion__entry_Default(DeepHistory* handle)
  796. {
  797. /* Default react sequence for initial entry */
  798. deepHistory_enseq_mainRegion_State1_default(handle);
  799. }
  800. /* Default react sequence for initial entry */
  801. static void deepHistory_react_mainRegion_State2__region0_State4__region0__entry_Default(DeepHistory* handle)
  802. {
  803. /* Default react sequence for initial entry */
  804. deepHistory_enseq_mainRegion_State2__region0_State4__region0_State6_default(handle);
  805. }
  806. /* Default react sequence for initial entry */
  807. static void deepHistory_react_mainRegion_State2__region0_State4__region0_State7__region0__entry_Default(DeepHistory* handle)
  808. {
  809. /* Default react sequence for initial entry */
  810. deepHistory_enseq_mainRegion_State2__region0_State4__region0_State7__region0_State8_default(handle);
  811. }
  812. /* Default react sequence for deep history entry */
  813. static void deepHistory_react_mainRegion_State2__region0__entry_Default(DeepHistory* handle)
  814. {
  815. /* Default react sequence for deep history entry */
  816. /* Enter the region with deep history */
  817. if (handle->historyVector[0] != DeepHistory_last_state)
  818. {
  819. deepHistory_dhenseq_mainRegion_State2__region0(handle);
  820. } else
  821. {
  822. deepHistory_enseq_mainRegion_State2__region0_a_default(handle);
  823. }
  824. }