ShallowHistoryWithDeepEntry.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #ifndef SHALLOWHISTORYWITHDEEPENTRY_H_
  2. #define SHALLOWHISTORYWITHDEEPENTRY_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'ShallowHistoryWithDeepEntry'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. ShallowHistoryWithDeepEntry_last_state,
  13. ShallowHistoryWithDeepEntry_main_region_Y,
  14. ShallowHistoryWithDeepEntry_main_region_Z,
  15. ShallowHistoryWithDeepEntry_main_region_Z__region0_A,
  16. ShallowHistoryWithDeepEntry_main_region_Z__region0_B,
  17. ShallowHistoryWithDeepEntry_main_region_Z__region0_B__region0_C
  18. } ShallowHistoryWithDeepEntryStates;
  19. /*! Type definition of the data structure for the ShallowHistoryWithDeepEntryIface interface scope. */
  20. typedef struct
  21. {
  22. sc_boolean toZ_raised;
  23. sc_boolean toY_raised;
  24. sc_boolean toC_raised;
  25. sc_boolean toA_raised;
  26. } ShallowHistoryWithDeepEntryIface;
  27. /*! Define dimension of the state configuration vector for orthogonal states. */
  28. #define SHALLOWHISTORYWITHDEEPENTRY_MAX_ORTHOGONAL_STATES 1
  29. /*! Define dimension of the state configuration vector for history states. */
  30. #define SHALLOWHISTORYWITHDEEPENTRY_MAX_HISTORY_STATES 1
  31. /*! Define indices of states in the StateConfVector */
  32. #define SCVI_SHALLOWHISTORYWITHDEEPENTRY_MAIN_REGION_Y 0
  33. #define SCVI_SHALLOWHISTORYWITHDEEPENTRY_MAIN_REGION_Z 0
  34. #define SCVI_SHALLOWHISTORYWITHDEEPENTRY_MAIN_REGION_Z__REGION0_A 0
  35. #define SCVI_SHALLOWHISTORYWITHDEEPENTRY_MAIN_REGION_Z__REGION0_B 0
  36. #define SCVI_SHALLOWHISTORYWITHDEEPENTRY_MAIN_REGION_Z__REGION0_B__REGION0_C 0
  37. /*!
  38. * Type definition of the data structure for the ShallowHistoryWithDeepEntry state machine.
  39. * This data structure has to be allocated by the client code.
  40. */
  41. typedef struct
  42. {
  43. ShallowHistoryWithDeepEntryStates stateConfVector[SHALLOWHISTORYWITHDEEPENTRY_MAX_ORTHOGONAL_STATES];
  44. ShallowHistoryWithDeepEntryStates historyVector[SHALLOWHISTORYWITHDEEPENTRY_MAX_HISTORY_STATES];
  45. sc_ushort stateConfVectorPosition;
  46. ShallowHistoryWithDeepEntryIface iface;
  47. } ShallowHistoryWithDeepEntry;
  48. /*! Initializes the ShallowHistoryWithDeepEntry state machine data structures. Must be called before first usage.*/
  49. extern void shallowHistoryWithDeepEntry_init(ShallowHistoryWithDeepEntry* handle);
  50. /*! Activates the state machine */
  51. extern void shallowHistoryWithDeepEntry_enter(ShallowHistoryWithDeepEntry* handle);
  52. /*! Deactivates the state machine */
  53. extern void shallowHistoryWithDeepEntry_exit(ShallowHistoryWithDeepEntry* handle);
  54. /*! Performs a 'run to completion' step. */
  55. extern void shallowHistoryWithDeepEntry_runCycle(ShallowHistoryWithDeepEntry* handle);
  56. /*! Raises the in event 'toZ' that is defined in the default interface scope. */
  57. extern void shallowHistoryWithDeepEntryIface_raise_toZ(ShallowHistoryWithDeepEntry* handle);
  58. /*! Raises the in event 'toY' that is defined in the default interface scope. */
  59. extern void shallowHistoryWithDeepEntryIface_raise_toY(ShallowHistoryWithDeepEntry* handle);
  60. /*! Raises the in event 'toC' that is defined in the default interface scope. */
  61. extern void shallowHistoryWithDeepEntryIface_raise_toC(ShallowHistoryWithDeepEntry* handle);
  62. /*! Raises the in event 'toA' that is defined in the default interface scope. */
  63. extern void shallowHistoryWithDeepEntryIface_raise_toA(ShallowHistoryWithDeepEntry* handle);
  64. /*!
  65. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  66. * A state machine is active if it was entered. It is inactive if it has not been entered at all or if it has been exited.
  67. */
  68. extern sc_boolean shallowHistoryWithDeepEntry_isActive(const ShallowHistoryWithDeepEntry* handle);
  69. /*!
  70. * Checks if all active states are final.
  71. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  72. */
  73. extern sc_boolean shallowHistoryWithDeepEntry_isFinal(const ShallowHistoryWithDeepEntry* handle);
  74. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  75. extern sc_boolean shallowHistoryWithDeepEntry_isStateActive(const ShallowHistoryWithDeepEntry* handle, ShallowHistoryWithDeepEntryStates state);
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif /* SHALLOWHISTORYWITHDEEPENTRY_H_ */