DeepEntry.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. #ifndef DEEPENTRY_H_
  2. #define DEEPENTRY_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'DeepEntry'.
  6. */
  7. class DeepEntry : public StatemachineInterface
  8. {
  9. public:
  10. DeepEntry();
  11. ~DeepEntry();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. r_A,
  16. r_A_r_B,
  17. r2_B,
  18. r2_B_r_BA,
  19. r2_B_r_BA_r_BAA,
  20. r2_B_r_BB,
  21. r2_C,
  22. r3_D,
  23. r3_D_r_DA,
  24. r3_D_r_DA_r_DAA,
  25. DeepEntry_last_state
  26. } DeepEntryStates;
  27. //! Inner class for default interface scope.
  28. class DefaultSCI
  29. {
  30. public:
  31. /*! Gets the value of the variable 'x' that is defined in the default interface scope. */
  32. sc_integer get_x() const;
  33. /*! Sets the value of the variable 'x' that is defined in the default interface scope. */
  34. void set_x(sc_integer value);
  35. /*! Gets the value of the variable 'y' that is defined in the default interface scope. */
  36. sc_integer get_y() const;
  37. /*! Sets the value of the variable 'y' that is defined in the default interface scope. */
  38. void set_y(sc_integer value);
  39. /*! Gets the value of the variable 'z' that is defined in the default interface scope. */
  40. sc_integer get_z() const;
  41. /*! Sets the value of the variable 'z' that is defined in the default interface scope. */
  42. void set_z(sc_integer value);
  43. /*! Raises the in event 'e' that is defined in the default interface scope. */
  44. void raise_e();
  45. /*! Raises the in event 'f' that is defined in the default interface scope. */
  46. void raise_f();
  47. private:
  48. friend class DeepEntry;
  49. sc_integer x;
  50. sc_integer y;
  51. sc_integer z;
  52. sc_boolean e_raised;
  53. sc_boolean f_raised;
  54. };
  55. /*! Returns an instance of the interface class 'DefaultSCI'. */
  56. DefaultSCI* getDefaultSCI();
  57. /*! Gets the value of the variable 'x' that is defined in the default interface scope. */
  58. sc_integer get_x() const;
  59. /*! Sets the value of the variable 'x' that is defined in the default interface scope. */
  60. void set_x(sc_integer value);
  61. /*! Gets the value of the variable 'y' that is defined in the default interface scope. */
  62. sc_integer get_y() const;
  63. /*! Sets the value of the variable 'y' that is defined in the default interface scope. */
  64. void set_y(sc_integer value);
  65. /*! Gets the value of the variable 'z' that is defined in the default interface scope. */
  66. sc_integer get_z() const;
  67. /*! Sets the value of the variable 'z' that is defined in the default interface scope. */
  68. void set_z(sc_integer value);
  69. /*! Raises the in event 'e' that is defined in the default interface scope. */
  70. void raise_e();
  71. /*! Raises the in event 'f' that is defined in the default interface scope. */
  72. void raise_f();
  73. /*
  74. * Functions inherited from StatemachineInterface
  75. */
  76. virtual void init();
  77. virtual void enter();
  78. virtual void exit();
  79. virtual void runCycle();
  80. /*!
  81. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  82. * 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.
  83. */
  84. virtual sc_boolean isActive() const;
  85. /*!
  86. * Checks if all active states are final.
  87. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  88. */
  89. virtual sc_boolean isFinal() const;
  90. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  91. sc_boolean isStateActive(DeepEntryStates state) const;
  92. private:
  93. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  94. static const sc_integer maxOrthogonalStates = 3;
  95. //! dimension of the state configuration vector for history states
  96. static const sc_integer maxHistoryStates = 4;
  97. DeepEntryStates stateConfVector[maxOrthogonalStates];
  98. DeepEntryStates historyVector[maxHistoryStates];
  99. sc_ushort stateConfVectorPosition;
  100. DefaultSCI iface;
  101. // prototypes of all internal functions
  102. sc_boolean check_r2_B_tr0_tr0();
  103. sc_boolean check_r2_B_r_BA_tr0_tr0();
  104. sc_boolean check_r2_C_tr0_tr0();
  105. void effect_r2_B_tr0();
  106. void effect_r2_B_r_BA_tr0();
  107. void effect_r2_C_tr0();
  108. void enact_r_A();
  109. void enact_r2_B_r_BA();
  110. void enact_r3_D();
  111. void enact_r3_D_r_DA();
  112. void enseq_r_A_r_B_default();
  113. void enseq_r2_B_default();
  114. void enseq_r2_B_r_BA_default();
  115. void enseq_r2_B_r_BA_r_BAA_default();
  116. void enseq_r2_B_r_BB_default();
  117. void enseq_r2_C_default();
  118. void enseq_r3_D_r_DA_r_DAA_default();
  119. void enseq_r_default();
  120. void enseq_r2_default();
  121. void enseq_r2_B_r_default();
  122. void shenseq_r2_B_r();
  123. void enseq_r2_B_r_BA_r_default();
  124. void enseq_r3_default();
  125. void dhenseq_r3();
  126. void dhenseq_r3_D_r();
  127. void dhenseq_r3_D_r_DA_r();
  128. void exseq_r_A_r_B();
  129. void exseq_r2_B();
  130. void exseq_r2_B_r_BA();
  131. void exseq_r2_B_r_BA_r_BAA();
  132. void exseq_r2_B_r_BB();
  133. void exseq_r2_C();
  134. void exseq_r3_D_r_DA_r_DAA();
  135. void exseq_r();
  136. void exseq_r_A_r();
  137. void exseq_r2();
  138. void exseq_r2_B_r();
  139. void exseq_r2_B_r_BA_r();
  140. void exseq_r3();
  141. void exseq_r3_D_r();
  142. void exseq_r3_D_r_DA_r();
  143. void react_r_A_r_B();
  144. void react_r2_B_r_BA_r_BAA();
  145. void react_r2_B_r_BB();
  146. void react_r2_C();
  147. void react_r3_D_r_DA_r_DAA();
  148. void react_r__entry_Default();
  149. void react_r2_B_r__entry_Default();
  150. void react_r2_B_r_BA_r__entry_Default();
  151. void react_r2__entry_Default();
  152. void react_r3__entry_Default();
  153. void clearInEvents();
  154. void clearOutEvents();
  155. };
  156. #endif /* DEEPENTRY_H_ */