ShallowHistoryWithDeepEntry.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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_main_region_Y,
  13. ShallowHistoryWithDeepEntry_main_region_Z,
  14. ShallowHistoryWithDeepEntry_main_region_Z__region0_A,
  15. ShallowHistoryWithDeepEntry_main_region_Z__region0_B,
  16. ShallowHistoryWithDeepEntry_main_region_Z__region0_B__region0_C,
  17. ShallowHistoryWithDeepEntry_last_state
  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. /*!
  32. * Type definition of the data structure for the ShallowHistoryWithDeepEntry state machine.
  33. * This data structure has to be allocated by the client code.
  34. */
  35. typedef struct
  36. {
  37. ShallowHistoryWithDeepEntryStates stateConfVector[SHALLOWHISTORYWITHDEEPENTRY_MAX_ORTHOGONAL_STATES];
  38. ShallowHistoryWithDeepEntryStates historyVector[SHALLOWHISTORYWITHDEEPENTRY_MAX_HISTORY_STATES];
  39. sc_ushort stateConfVectorPosition;
  40. ShallowHistoryWithDeepEntryIface iface;
  41. } ShallowHistoryWithDeepEntry;
  42. /*! Initializes the ShallowHistoryWithDeepEntry state machine data structures. Must be called before first usage.*/
  43. extern void shallowHistoryWithDeepEntry_init(ShallowHistoryWithDeepEntry* handle);
  44. /*! Activates the state machine */
  45. extern void shallowHistoryWithDeepEntry_enter(ShallowHistoryWithDeepEntry* handle);
  46. /*! Deactivates the state machine */
  47. extern void shallowHistoryWithDeepEntry_exit(ShallowHistoryWithDeepEntry* handle);
  48. /*! Performs a 'run to completion' step. */
  49. extern void shallowHistoryWithDeepEntry_runCycle(ShallowHistoryWithDeepEntry* handle);
  50. /*! Raises the in event 'toZ' that is defined in the default interface scope. */
  51. extern void shallowHistoryWithDeepEntryIface_raise_toZ(ShallowHistoryWithDeepEntry* handle);
  52. /*! Raises the in event 'toY' that is defined in the default interface scope. */
  53. extern void shallowHistoryWithDeepEntryIface_raise_toY(ShallowHistoryWithDeepEntry* handle);
  54. /*! Raises the in event 'toC' that is defined in the default interface scope. */
  55. extern void shallowHistoryWithDeepEntryIface_raise_toC(ShallowHistoryWithDeepEntry* handle);
  56. /*! Raises the in event 'toA' that is defined in the default interface scope. */
  57. extern void shallowHistoryWithDeepEntryIface_raise_toA(ShallowHistoryWithDeepEntry* handle);
  58. /*!
  59. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  60. * 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.
  61. */
  62. extern sc_boolean shallowHistoryWithDeepEntry_isActive(const ShallowHistoryWithDeepEntry* handle);
  63. /*!
  64. * Checks if all active states are final.
  65. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  66. */
  67. extern sc_boolean shallowHistoryWithDeepEntry_isFinal(const ShallowHistoryWithDeepEntry* handle);
  68. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  69. extern sc_boolean shallowHistoryWithDeepEntry_isStateActive(const ShallowHistoryWithDeepEntry* handle, ShallowHistoryWithDeepEntryStates state);
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #endif /* SHALLOWHISTORYWITHDEEPENTRY_H_ */