ValuedEvents.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. #ifndef VALUEDEVENTS_H_
  2. #define VALUEDEVENTS_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'ValuedEvents'.
  6. */
  7. class ValuedEvents : public StatemachineInterface
  8. {
  9. public:
  10. ValuedEvents();
  11. ~ValuedEvents();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region1_A,
  16. integer_region_B,
  17. integer_region_C,
  18. integer_region_D,
  19. boolean_region_B,
  20. boolean_region_C,
  21. boolean_region_D,
  22. real_region_B,
  23. real_region_C,
  24. real_region_D,
  25. string_region_B,
  26. string_region_C,
  27. string_region_D,
  28. ValuedEvents_last_state
  29. } ValuedEventsStates;
  30. //! Inner class for default interface scope.
  31. class DefaultSCI
  32. {
  33. public:
  34. /*! Raises the in event 'integerEvent' that is defined in the default interface scope. */
  35. void raise_integerEvent(sc_integer value);
  36. /*! Gets the value of the variable 'myInt' that is defined in the default interface scope. */
  37. sc_integer get_myInt() const;
  38. /*! Sets the value of the variable 'myInt' that is defined in the default interface scope. */
  39. void set_myInt(sc_integer value);
  40. /*! Raises the in event 'booleanEvent' that is defined in the default interface scope. */
  41. void raise_booleanEvent(sc_boolean value);
  42. /*! Gets the value of the variable 'myBool' that is defined in the default interface scope. */
  43. sc_boolean get_myBool() const;
  44. /*! Sets the value of the variable 'myBool' that is defined in the default interface scope. */
  45. void set_myBool(sc_boolean value);
  46. /*! Raises the in event 'realEvent' that is defined in the default interface scope. */
  47. void raise_realEvent(sc_real value);
  48. /*! Gets the value of the variable 'myReal' that is defined in the default interface scope. */
  49. sc_real get_myReal() const;
  50. /*! Sets the value of the variable 'myReal' that is defined in the default interface scope. */
  51. void set_myReal(sc_real value);
  52. /*! Raises the in event 'stringEvent' that is defined in the default interface scope. */
  53. void raise_stringEvent(sc_string value);
  54. /*! Gets the value of the variable 'myString' that is defined in the default interface scope. */
  55. sc_string get_myString() const;
  56. /*! Sets the value of the variable 'myString' that is defined in the default interface scope. */
  57. void set_myString(sc_string value);
  58. private:
  59. friend class ValuedEvents;
  60. sc_boolean integerEvent_raised;
  61. sc_integer integerEvent_value;
  62. sc_integer myInt;
  63. sc_boolean booleanEvent_raised;
  64. sc_boolean booleanEvent_value;
  65. sc_boolean myBool;
  66. sc_boolean realEvent_raised;
  67. sc_real realEvent_value;
  68. sc_real myReal;
  69. sc_boolean stringEvent_raised;
  70. sc_string stringEvent_value;
  71. sc_string myString;
  72. };
  73. /*! Returns an instance of the interface class 'DefaultSCI'. */
  74. DefaultSCI* getDefaultSCI();
  75. /*! Raises the in event 'integerEvent' that is defined in the default interface scope. */
  76. void raise_integerEvent(sc_integer value);
  77. /*! Gets the value of the variable 'myInt' that is defined in the default interface scope. */
  78. sc_integer get_myInt() const;
  79. /*! Sets the value of the variable 'myInt' that is defined in the default interface scope. */
  80. void set_myInt(sc_integer value);
  81. /*! Raises the in event 'booleanEvent' that is defined in the default interface scope. */
  82. void raise_booleanEvent(sc_boolean value);
  83. /*! Gets the value of the variable 'myBool' that is defined in the default interface scope. */
  84. sc_boolean get_myBool() const;
  85. /*! Sets the value of the variable 'myBool' that is defined in the default interface scope. */
  86. void set_myBool(sc_boolean value);
  87. /*! Raises the in event 'realEvent' that is defined in the default interface scope. */
  88. void raise_realEvent(sc_real value);
  89. /*! Gets the value of the variable 'myReal' that is defined in the default interface scope. */
  90. sc_real get_myReal() const;
  91. /*! Sets the value of the variable 'myReal' that is defined in the default interface scope. */
  92. void set_myReal(sc_real value);
  93. /*! Raises the in event 'stringEvent' that is defined in the default interface scope. */
  94. void raise_stringEvent(sc_string value);
  95. /*! Gets the value of the variable 'myString' that is defined in the default interface scope. */
  96. sc_string get_myString() const;
  97. /*! Sets the value of the variable 'myString' that is defined in the default interface scope. */
  98. void set_myString(sc_string value);
  99. /*
  100. * Functions inherited from StatemachineInterface
  101. */
  102. virtual void init();
  103. virtual void enter();
  104. virtual void exit();
  105. virtual void runCycle();
  106. /*!
  107. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  108. * 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.
  109. */
  110. virtual sc_boolean isActive() const;
  111. /*!
  112. * Checks if all active states are final.
  113. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  114. */
  115. virtual sc_boolean isFinal() const;
  116. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  117. sc_boolean isStateActive(ValuedEventsStates state) const;
  118. private:
  119. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  120. static const sc_integer maxOrthogonalStates = 5;
  121. ValuedEventsStates stateConfVector[maxOrthogonalStates];
  122. sc_ushort stateConfVectorPosition;
  123. DefaultSCI iface;
  124. // prototypes of all internal functions
  125. sc_boolean check_integer_region_B_tr0_tr0();
  126. sc_boolean check_integer_region_C_tr0_tr0();
  127. sc_boolean check_boolean_region_B_tr0_tr0();
  128. sc_boolean check_boolean_region_C_tr0_tr0();
  129. sc_boolean check_real_region_B_tr0_tr0();
  130. sc_boolean check_real_region_C_tr0_tr0();
  131. sc_boolean check_string_region_B_tr0_tr0();
  132. sc_boolean check_string_region_C_tr0_tr0();
  133. void effect_integer_region_B_tr0();
  134. void effect_integer_region_C_tr0();
  135. void effect_boolean_region_B_tr0();
  136. void effect_boolean_region_C_tr0();
  137. void effect_real_region_B_tr0();
  138. void effect_real_region_C_tr0();
  139. void effect_string_region_B_tr0();
  140. void effect_string_region_C_tr0();
  141. void enact_main_region1_A();
  142. void enseq_main_region1_A_default();
  143. void enseq_integer_region_B_default();
  144. void enseq_integer_region_C_default();
  145. void enseq_integer_region_D_default();
  146. void enseq_boolean_region_B_default();
  147. void enseq_boolean_region_C_default();
  148. void enseq_boolean_region_D_default();
  149. void enseq_real_region_B_default();
  150. void enseq_real_region_C_default();
  151. void enseq_real_region_D_default();
  152. void enseq_string_region_B_default();
  153. void enseq_string_region_C_default();
  154. void enseq_string_region_D_default();
  155. void enseq_main_region1_default();
  156. void enseq_integer_region_default();
  157. void enseq_boolean_region_default();
  158. void enseq_real_region_default();
  159. void enseq_string_region_default();
  160. void exseq_main_region1_A();
  161. void exseq_integer_region_B();
  162. void exseq_integer_region_C();
  163. void exseq_integer_region_D();
  164. void exseq_boolean_region_B();
  165. void exseq_boolean_region_C();
  166. void exseq_boolean_region_D();
  167. void exseq_real_region_B();
  168. void exseq_real_region_C();
  169. void exseq_real_region_D();
  170. void exseq_string_region_B();
  171. void exseq_string_region_C();
  172. void exseq_string_region_D();
  173. void exseq_main_region1();
  174. void exseq_integer_region();
  175. void exseq_boolean_region();
  176. void exseq_real_region();
  177. void exseq_string_region();
  178. void react_main_region1_A();
  179. void react_integer_region_B();
  180. void react_integer_region_C();
  181. void react_integer_region_D();
  182. void react_boolean_region_B();
  183. void react_boolean_region_C();
  184. void react_boolean_region_D();
  185. void react_real_region_B();
  186. void react_real_region_C();
  187. void react_real_region_D();
  188. void react_string_region_B();
  189. void react_string_region_C();
  190. void react_string_region_D();
  191. void react_main_region1__entry_Default();
  192. void react_integer_region__entry_Default();
  193. void react_boolean_region__entry_Default();
  194. void react_real_region__entry_Default();
  195. void react_string_region__entry_Default();
  196. void clearInEvents();
  197. void clearOutEvents();
  198. };
  199. #endif /* VALUEDEVENTS_H_ */