EntryReactionAction.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. #ifndef ENTRYREACTIONACTION_H_
  2. #define ENTRYREACTIONACTION_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'EntryReactionAction'.
  6. */
  7. class EntryReactionAction : public StatemachineInterface
  8. {
  9. public:
  10. EntryReactionAction();
  11. ~EntryReactionAction();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. EntryReactionAction_r2_B,
  16. EntryReactionAction_r2_B_r_BA,
  17. EntryReactionAction_r2_B_r_BB,
  18. EntryReactionAction_r2_D,
  19. EntryReactionAction_r1_A,
  20. EntryReactionAction_last_state
  21. } EntryReactionActionStates;
  22. //! Inner class for default interface scope.
  23. class DefaultSCI
  24. {
  25. public:
  26. /*! Gets the value of the variable 'enteredR1' that is defined in the default interface scope. */
  27. sc_boolean get_enteredR1() const;
  28. /*! Sets the value of the variable 'enteredR1' that is defined in the default interface scope. */
  29. void set_enteredR1(sc_boolean value);
  30. /*! Gets the value of the variable 'enteredR2' that is defined in the default interface scope. */
  31. sc_boolean get_enteredR2() const;
  32. /*! Sets the value of the variable 'enteredR2' that is defined in the default interface scope. */
  33. void set_enteredR2(sc_boolean value);
  34. /*! Gets the value of the variable 'enteredBdefault' that is defined in the default interface scope. */
  35. sc_boolean get_enteredBdefault() const;
  36. /*! Sets the value of the variable 'enteredBdefault' that is defined in the default interface scope. */
  37. void set_enteredBdefault(sc_boolean value);
  38. /*! Gets the value of the variable 'enteredBother' that is defined in the default interface scope. */
  39. sc_boolean get_enteredBother() const;
  40. /*! Sets the value of the variable 'enteredBother' that is defined in the default interface scope. */
  41. void set_enteredBother(sc_boolean value);
  42. /*! Raises the in event 'b' that is defined in the default interface scope. */
  43. void raise_b();
  44. /*! Raises the in event 'd' that is defined in the default interface scope. */
  45. void raise_d();
  46. private:
  47. friend class EntryReactionAction;
  48. sc_boolean enteredR1;
  49. sc_boolean enteredR2;
  50. sc_boolean enteredBdefault;
  51. sc_boolean enteredBother;
  52. sc_boolean b_raised;
  53. sc_boolean d_raised;
  54. };
  55. /*! Returns an instance of the interface class 'DefaultSCI'. */
  56. DefaultSCI* getDefaultSCI();
  57. /*! Gets the value of the variable 'enteredR1' that is defined in the default interface scope. */
  58. sc_boolean get_enteredR1() const;
  59. /*! Sets the value of the variable 'enteredR1' that is defined in the default interface scope. */
  60. void set_enteredR1(sc_boolean value);
  61. /*! Gets the value of the variable 'enteredR2' that is defined in the default interface scope. */
  62. sc_boolean get_enteredR2() const;
  63. /*! Sets the value of the variable 'enteredR2' that is defined in the default interface scope. */
  64. void set_enteredR2(sc_boolean value);
  65. /*! Gets the value of the variable 'enteredBdefault' that is defined in the default interface scope. */
  66. sc_boolean get_enteredBdefault() const;
  67. /*! Sets the value of the variable 'enteredBdefault' that is defined in the default interface scope. */
  68. void set_enteredBdefault(sc_boolean value);
  69. /*! Gets the value of the variable 'enteredBother' that is defined in the default interface scope. */
  70. sc_boolean get_enteredBother() const;
  71. /*! Sets the value of the variable 'enteredBother' that is defined in the default interface scope. */
  72. void set_enteredBother(sc_boolean value);
  73. /*! Raises the in event 'b' that is defined in the default interface scope. */
  74. void raise_b();
  75. /*! Raises the in event 'd' that is defined in the default interface scope. */
  76. void raise_d();
  77. /*
  78. * Functions inherited from StatemachineInterface
  79. */
  80. virtual void init();
  81. virtual void enter();
  82. virtual void exit();
  83. virtual void runCycle();
  84. /*!
  85. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  86. * 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.
  87. */
  88. virtual sc_boolean isActive() const;
  89. /*!
  90. * Checks if all active states are final.
  91. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  92. */
  93. virtual sc_boolean isFinal() const;
  94. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  95. sc_boolean isStateActive(EntryReactionActionStates state) const;
  96. private:
  97. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  98. static const sc_integer maxOrthogonalStates = 2;
  99. //! dimension of the state configuration vector for history states
  100. static const sc_integer maxHistoryStates = 1;
  101. EntryReactionActionStates stateConfVector[maxOrthogonalStates];
  102. EntryReactionActionStates historyVector[maxHistoryStates];
  103. sc_ushort stateConfVectorPosition;
  104. DefaultSCI iface;
  105. // prototypes of all internal functions
  106. sc_boolean check_EntryReactionAction_r2_B_tr0_tr0();
  107. sc_boolean check_EntryReactionAction_r2_B_r_BA_tr0_tr0();
  108. sc_boolean check_EntryReactionAction_r2_B_r_BB_tr0_tr0();
  109. sc_boolean check_EntryReactionAction_r2_D_tr0_tr0();
  110. sc_boolean check_EntryReactionAction_r2_D_tr1_tr1();
  111. void effect_EntryReactionAction_r2_B_tr0();
  112. void effect_EntryReactionAction_r2_B_r_BA_tr0();
  113. void effect_EntryReactionAction_r2_B_r_BB_tr0();
  114. void effect_EntryReactionAction_r2_D_tr0();
  115. void effect_EntryReactionAction_r2_D_tr1();
  116. void enseq_EntryReactionAction_r2_B_default();
  117. void enseq_EntryReactionAction_r2_B_other();
  118. void enseq_EntryReactionAction_r2_B_r_BA_default();
  119. void enseq_EntryReactionAction_r2_B_r_BB_default();
  120. void enseq_EntryReactionAction_r2_D_default();
  121. void enseq_EntryReactionAction_r1_A_default();
  122. void enseq_EntryReactionAction_r2_default();
  123. void enseq_EntryReactionAction_r2_B_r_default();
  124. void enseq_EntryReactionAction_r2_B_r_other();
  125. void shenseq_EntryReactionAction_r2_B_r();
  126. void enseq_EntryReactionAction_r1_default();
  127. void exseq_EntryReactionAction_r2_B();
  128. void exseq_EntryReactionAction_r2_B_r_BA();
  129. void exseq_EntryReactionAction_r2_B_r_BB();
  130. void exseq_EntryReactionAction_r2_D();
  131. void exseq_EntryReactionAction_r1_A();
  132. void exseq_EntryReactionAction_r2();
  133. void exseq_EntryReactionAction_r2_B_r();
  134. void exseq_EntryReactionAction_r1();
  135. void react_EntryReactionAction_r2_B_r_BA();
  136. void react_EntryReactionAction_r2_B_r_BB();
  137. void react_EntryReactionAction_r2_D();
  138. void react_EntryReactionAction_r1_A();
  139. void react_EntryReactionAction_r2_default();
  140. void react_EntryReactionAction_r2_B_r_default();
  141. void react_EntryReactionAction_r2_B_r_other();
  142. void react_EntryReactionAction_r1__entry_Default();
  143. void clearInEvents();
  144. void clearOutEvents();
  145. };
  146. #endif /* ENTRYREACTIONACTION_H_ */