NamedInterfaceAccess.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. #ifndef NAMEDINTERFACEACCESS_H_
  2. #define NAMEDINTERFACEACCESS_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'NamedInterfaceAccess'.
  6. */
  7. class NamedInterfaceAccess : public StatemachineInterface
  8. {
  9. public:
  10. NamedInterfaceAccess();
  11. ~NamedInterfaceAccess();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. region_1_Idle,
  16. region_1_Number1Pressed,
  17. region_1_Number2Pressed,
  18. region_1_Number3Pressed,
  19. _region1_Closed,
  20. _region1_Open,
  21. NamedInterfaceAccess_last_state
  22. } NamedInterfaceAccessStates;
  23. //! Inner class for Safe interface scope.
  24. class SCI_Safe
  25. {
  26. public:
  27. /*! Checks if the out event 'open' that is defined in the interface scope 'Safe' has been raised. */
  28. sc_boolean isRaised_open() const;
  29. /*! Checks if the out event 'close' that is defined in the interface scope 'Safe' has been raised. */
  30. sc_boolean isRaised_close() const;
  31. private:
  32. friend class NamedInterfaceAccess;
  33. sc_boolean open_raised;
  34. sc_boolean close_raised;
  35. };
  36. /*! Returns an instance of the interface class 'SCI_Safe'. */
  37. SCI_Safe* getSCI_Safe();
  38. //! Inner class for User interface scope.
  39. class SCI_User
  40. {
  41. public:
  42. /*! Raises the in event 'numberPressed' that is defined in the interface scope 'User'. */
  43. void raise_numberPressed(sc_integer value);
  44. /*! Raises the in event 'reset' that is defined in the interface scope 'User'. */
  45. void raise_reset();
  46. private:
  47. friend class NamedInterfaceAccess;
  48. sc_boolean numberPressed_raised;
  49. sc_integer numberPressed_value;
  50. sc_boolean reset_raised;
  51. };
  52. /*! Returns an instance of the interface class 'SCI_User'. */
  53. SCI_User* getSCI_User();
  54. /*
  55. * Functions inherited from StatemachineInterface
  56. */
  57. virtual void init();
  58. virtual void enter();
  59. virtual void exit();
  60. virtual void runCycle();
  61. /*!
  62. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  63. * 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.
  64. */
  65. virtual sc_boolean isActive() const;
  66. /*!
  67. * Checks if all active states are final.
  68. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  69. */
  70. virtual sc_boolean isFinal() const;
  71. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  72. sc_boolean isStateActive(NamedInterfaceAccessStates state) const;
  73. private:
  74. //! Inner class for internal interface scope.
  75. class InternalSCI
  76. {
  77. public:
  78. /*! Gets the value of the variable 'number1' that is defined in the internal scope. */
  79. sc_integer get_number1() const;
  80. /*! Sets the value of the variable 'number1' that is defined in the internal scope. */
  81. void set_number1(sc_integer value);
  82. /*! Gets the value of the variable 'number2' that is defined in the internal scope. */
  83. sc_integer get_number2() const;
  84. /*! Sets the value of the variable 'number2' that is defined in the internal scope. */
  85. void set_number2(sc_integer value);
  86. /*! Gets the value of the variable 'number3' that is defined in the internal scope. */
  87. sc_integer get_number3() const;
  88. /*! Sets the value of the variable 'number3' that is defined in the internal scope. */
  89. void set_number3(sc_integer value);
  90. private:
  91. friend class NamedInterfaceAccess;
  92. sc_integer number1;
  93. sc_integer number2;
  94. sc_integer number3;
  95. };
  96. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  97. static const sc_integer maxOrthogonalStates = 2;
  98. NamedInterfaceAccessStates stateConfVector[maxOrthogonalStates];
  99. sc_ushort stateConfVectorPosition;
  100. SCI_Safe ifaceSafe;
  101. SCI_User ifaceUser;
  102. InternalSCI ifaceInternalSCI;
  103. // prototypes of all internal functions
  104. sc_boolean check_region_1_Idle_tr0_tr0();
  105. sc_boolean check_region_1_Number1Pressed_tr0_tr0();
  106. sc_boolean check_region_1_Number1Pressed_tr1_tr1();
  107. sc_boolean check_region_1_Number2Pressed_tr0_tr0();
  108. sc_boolean check_region_1_Number2Pressed_tr1_tr1();
  109. sc_boolean check_region_1_Number3Pressed_tr0_tr0();
  110. sc_boolean check__region1_Closed_tr0_tr0();
  111. sc_boolean check__region1_Open_tr0_tr0();
  112. void effect_region_1_Idle_tr0();
  113. void effect_region_1_Number1Pressed_tr0();
  114. void effect_region_1_Number1Pressed_tr1();
  115. void effect_region_1_Number2Pressed_tr0();
  116. void effect_region_1_Number2Pressed_tr1();
  117. void effect_region_1_Number3Pressed_tr0();
  118. void effect__region1_Closed_tr0();
  119. void effect__region1_Open_tr0();
  120. void enact_region_1_Idle();
  121. void enact_region_1_Number3Pressed();
  122. void enseq_region_1_Idle_default();
  123. void enseq_region_1_Number1Pressed_default();
  124. void enseq_region_1_Number2Pressed_default();
  125. void enseq_region_1_Number3Pressed_default();
  126. void enseq__region1_Closed_default();
  127. void enseq__region1_Open_default();
  128. void enseq_region_1_default();
  129. void enseq__region1_default();
  130. void exseq_region_1_Idle();
  131. void exseq_region_1_Number1Pressed();
  132. void exseq_region_1_Number2Pressed();
  133. void exseq_region_1_Number3Pressed();
  134. void exseq__region1_Closed();
  135. void exseq__region1_Open();
  136. void exseq_region_1();
  137. void exseq__region1();
  138. void react_region_1_Idle();
  139. void react_region_1_Number1Pressed();
  140. void react_region_1_Number2Pressed();
  141. void react_region_1_Number3Pressed();
  142. void react__region1_Closed();
  143. void react__region1_Open();
  144. void react_region_1__entry_Default();
  145. void react__region1__entry_Default();
  146. void clearInEvents();
  147. void clearOutEvents();
  148. };
  149. #endif /* NAMEDINTERFACEACCESS_H_ */