ShallowHistoryWithDeepEntry.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #ifndef SHALLOWHISTORYWITHDEEPENTRY_H_
  2. #define SHALLOWHISTORYWITHDEEPENTRY_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'ShallowHistoryWithDeepEntry'.
  6. */
  7. class ShallowHistoryWithDeepEntry : public StatemachineInterface
  8. {
  9. public:
  10. ShallowHistoryWithDeepEntry();
  11. ~ShallowHistoryWithDeepEntry();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_Y,
  16. main_region_Z,
  17. main_region_Z__region0_A,
  18. main_region_Z__region0_B,
  19. main_region_Z__region0_B__region0_C,
  20. ShallowHistoryWithDeepEntry_last_state
  21. } ShallowHistoryWithDeepEntryStates;
  22. //! Inner class for default interface scope.
  23. class DefaultSCI
  24. {
  25. public:
  26. /*! Raises the in event 'toZ' that is defined in the default interface scope. */
  27. void raise_toZ();
  28. /*! Raises the in event 'toY' that is defined in the default interface scope. */
  29. void raise_toY();
  30. /*! Raises the in event 'toC' that is defined in the default interface scope. */
  31. void raise_toC();
  32. /*! Raises the in event 'toA' that is defined in the default interface scope. */
  33. void raise_toA();
  34. private:
  35. friend class ShallowHistoryWithDeepEntry;
  36. sc_boolean toZ_raised;
  37. sc_boolean toY_raised;
  38. sc_boolean toC_raised;
  39. sc_boolean toA_raised;
  40. };
  41. /*! Returns an instance of the interface class 'DefaultSCI'. */
  42. DefaultSCI* getDefaultSCI();
  43. /*! Raises the in event 'toZ' that is defined in the default interface scope. */
  44. void raise_toZ();
  45. /*! Raises the in event 'toY' that is defined in the default interface scope. */
  46. void raise_toY();
  47. /*! Raises the in event 'toC' that is defined in the default interface scope. */
  48. void raise_toC();
  49. /*! Raises the in event 'toA' that is defined in the default interface scope. */
  50. void raise_toA();
  51. /*
  52. * Functions inherited from StatemachineInterface
  53. */
  54. virtual void init();
  55. virtual void enter();
  56. virtual void exit();
  57. virtual void runCycle();
  58. /*!
  59. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  60. * A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
  61. */
  62. virtual sc_boolean isActive() const;
  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. virtual sc_boolean isFinal() const;
  68. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  69. sc_boolean isStateActive(ShallowHistoryWithDeepEntryStates state) const;
  70. private:
  71. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  72. static const sc_integer maxOrthogonalStates = 1;
  73. //! dimension of the state configuration vector for history states
  74. static const sc_integer maxHistoryStates = 1;
  75. ShallowHistoryWithDeepEntryStates stateConfVector[maxOrthogonalStates];
  76. ShallowHistoryWithDeepEntryStates historyVector[maxHistoryStates];
  77. sc_ushort stateConfVectorPosition;
  78. DefaultSCI iface;
  79. // prototypes of all internal functions
  80. sc_boolean check_main_region_Y_tr0_tr0();
  81. sc_boolean check_main_region_Y_tr1_tr1();
  82. sc_boolean check_main_region_Z_tr0_tr0();
  83. sc_boolean check_main_region_Z__region0_A_tr0_tr0();
  84. sc_boolean check_main_region_Z__region0_B__region0_C_tr0_tr0();
  85. void effect_main_region_Y_tr0();
  86. void effect_main_region_Y_tr1();
  87. void effect_main_region_Z_tr0();
  88. void effect_main_region_Z__region0_A_tr0();
  89. void effect_main_region_Z__region0_B__region0_C_tr0();
  90. void enseq_main_region_Y_default();
  91. void enseq_main_region_Z_default();
  92. void enseq_main_region_Z__region0_A_default();
  93. void enseq_main_region_Z__region0_B_default();
  94. void enseq_main_region_Z__region0_B__region0_C_default();
  95. void enseq_main_region_default();
  96. void enseq_main_region_Z__region0_default();
  97. void shenseq_main_region_Z__region0();
  98. void enseq_main_region_Z__region0_B__region0_default();
  99. void exseq_main_region_Y();
  100. void exseq_main_region_Z();
  101. void exseq_main_region_Z__region0_A();
  102. void exseq_main_region_Z__region0_B();
  103. void exseq_main_region_Z__region0_B__region0_C();
  104. void exseq_main_region();
  105. void exseq_main_region_Z__region0();
  106. void exseq_main_region_Z__region0_B__region0();
  107. void react_main_region_Y();
  108. void react_main_region_Z__region0_A();
  109. void react_main_region_Z__region0_B__region0_C();
  110. void react_main_region__entry_Default();
  111. void react_main_region_Z__region0__entry_Default();
  112. void react_main_region_Z__region0_B__region0__entry_Default();
  113. void clearInEvents();
  114. void clearOutEvents();
  115. };
  116. #endif /* SHALLOWHISTORYWITHDEEPENTRY_H_ */