DeepHistory.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #ifndef DEEPHISTORY_H_
  2. #define DEEPHISTORY_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'DeepHistory'.
  8. */
  9. //! enumeration of all states
  10. typedef enum {
  11. DeepHistory_mainRegion_State1 ,
  12. DeepHistory_mainRegion_State2 ,
  13. DeepHistory_mainRegion_State2__region0_a ,
  14. DeepHistory_mainRegion_State2__region0_State4 ,
  15. DeepHistory_mainRegion_State2__region0_State4__region0_State6 ,
  16. DeepHistory_mainRegion_State2__region0_State4__region0_State7 ,
  17. DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State8 ,
  18. DeepHistory_mainRegion_State2__region0_State4__region0_State7__region0_State9 ,
  19. DeepHistory_mainRegion_State2__region0_State5 ,
  20. DeepHistory_last_state
  21. } DeepHistoryStates;
  22. //! Type definition of the data structure for the DeepHistoryIface interface scope.
  23. typedef struct {
  24. sc_boolean event1_raised;
  25. sc_boolean event2_raised;
  26. sc_boolean event3_raised;
  27. sc_boolean event4_raised;
  28. sc_boolean event5_raised;
  29. sc_boolean event6_raised;
  30. sc_boolean event7_raised;
  31. sc_boolean event8_raised;
  32. sc_boolean event9_raised;
  33. } DeepHistoryIface;
  34. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  35. #define DEEPHISTORY_MAX_ORTHOGONAL_STATES 1
  36. //! dimension of the state configuration vector for history states
  37. #define DEEPHISTORY_MAX_HISTORY_STATES 3
  38. /*! Type definition of the data structure for the DeepHistory state machine.
  39. This data structure has to be allocated by the client code. */
  40. typedef struct {
  41. DeepHistoryStates stateConfVector[DEEPHISTORY_MAX_ORTHOGONAL_STATES];
  42. DeepHistoryStates historyVector[DEEPHISTORY_MAX_HISTORY_STATES];
  43. sc_ushort stateConfVectorPosition;
  44. DeepHistoryIface iface;
  45. } DeepHistory;
  46. /*! Initializes the DeepHistory state machine data structures. Must be called before first usage.*/
  47. extern void deepHistory_init(DeepHistory* handle);
  48. /*! Activates the state machine */
  49. extern void deepHistory_enter(DeepHistory* handle);
  50. /*! Deactivates the state machine */
  51. extern void deepHistory_exit(DeepHistory* handle);
  52. /*! Performs a 'run to completion' step. */
  53. extern void deepHistory_runCycle(DeepHistory* handle);
  54. /*! Raises the in event 'event1' that is defined in the default interface scope. */
  55. extern void deepHistoryIface_raise_event1(DeepHistory* handle);
  56. /*! Raises the in event 'event2' that is defined in the default interface scope. */
  57. extern void deepHistoryIface_raise_event2(DeepHistory* handle);
  58. /*! Raises the in event 'event3' that is defined in the default interface scope. */
  59. extern void deepHistoryIface_raise_event3(DeepHistory* handle);
  60. /*! Raises the in event 'event4' that is defined in the default interface scope. */
  61. extern void deepHistoryIface_raise_event4(DeepHistory* handle);
  62. /*! Raises the in event 'event5' that is defined in the default interface scope. */
  63. extern void deepHistoryIface_raise_event5(DeepHistory* handle);
  64. /*! Raises the in event 'event6' that is defined in the default interface scope. */
  65. extern void deepHistoryIface_raise_event6(DeepHistory* handle);
  66. /*! Raises the in event 'event7' that is defined in the default interface scope. */
  67. extern void deepHistoryIface_raise_event7(DeepHistory* handle);
  68. /*! Raises the in event 'event8' that is defined in the default interface scope. */
  69. extern void deepHistoryIface_raise_event8(DeepHistory* handle);
  70. /*! Raises the in event 'event9' that is defined in the default interface scope. */
  71. extern void deepHistoryIface_raise_event9(DeepHistory* handle);
  72. /*! Checks if the specified state is active. */
  73. extern sc_boolean deepHistory_isActive(DeepHistory* handle, DeepHistoryStates state);
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif /* DEEPHISTORY_H_ */