BitExpressions.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. #ifndef BITEXPRESSIONS_H_
  2. #define BITEXPRESSIONS_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'BitExpressions'.
  6. */
  7. class BitExpressions : public StatemachineInterface
  8. {
  9. public:
  10. BitExpressions();
  11. ~BitExpressions();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_StateA,
  16. main_region_StateB,
  17. BitExpressions_last_state
  18. } BitExpressionsStates;
  19. //! Inner class for default interface scope.
  20. class DefaultSCI
  21. {
  22. public:
  23. /*! Gets the value of the variable 'myBit1' that is defined in the default interface scope. */
  24. sc_integer get_myBit1() const;
  25. /*! Sets the value of the variable 'myBit1' that is defined in the default interface scope. */
  26. void set_myBit1(sc_integer value);
  27. /*! Gets the value of the variable 'myBit2' that is defined in the default interface scope. */
  28. sc_integer get_myBit2() const;
  29. /*! Sets the value of the variable 'myBit2' that is defined in the default interface scope. */
  30. void set_myBit2(sc_integer value);
  31. /*! Gets the value of the variable 'leftBitshift' that is defined in the default interface scope. */
  32. sc_integer get_leftBitshift() const;
  33. /*! Sets the value of the variable 'leftBitshift' that is defined in the default interface scope. */
  34. void set_leftBitshift(sc_integer value);
  35. /*! Gets the value of the variable 'rightBitshift' that is defined in the default interface scope. */
  36. sc_integer get_rightBitshift() const;
  37. /*! Sets the value of the variable 'rightBitshift' that is defined in the default interface scope. */
  38. void set_rightBitshift(sc_integer value);
  39. /*! Gets the value of the variable 'complementBitshift' that is defined in the default interface scope. */
  40. sc_integer get_complementBitshift() const;
  41. /*! Sets the value of the variable 'complementBitshift' that is defined in the default interface scope. */
  42. void set_complementBitshift(sc_integer value);
  43. /*! Gets the value of the variable 'bitwiseAnd' that is defined in the default interface scope. */
  44. sc_integer get_bitwiseAnd() const;
  45. /*! Sets the value of the variable 'bitwiseAnd' that is defined in the default interface scope. */
  46. void set_bitwiseAnd(sc_integer value);
  47. /*! Gets the value of the variable 'bitwiseOr' that is defined in the default interface scope. */
  48. sc_integer get_bitwiseOr() const;
  49. /*! Sets the value of the variable 'bitwiseOr' that is defined in the default interface scope. */
  50. void set_bitwiseOr(sc_integer value);
  51. /*! Gets the value of the variable 'bitwiseXor' that is defined in the default interface scope. */
  52. sc_integer get_bitwiseXor() const;
  53. /*! Sets the value of the variable 'bitwiseXor' that is defined in the default interface scope. */
  54. void set_bitwiseXor(sc_integer value);
  55. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  56. void raise_e1();
  57. private:
  58. friend class BitExpressions;
  59. sc_integer myBit1;
  60. sc_integer myBit2;
  61. sc_integer leftBitshift;
  62. sc_integer rightBitshift;
  63. sc_integer complementBitshift;
  64. sc_integer bitwiseAnd;
  65. sc_integer bitwiseOr;
  66. sc_integer bitwiseXor;
  67. sc_boolean e1_raised;
  68. };
  69. /*! Returns an instance of the interface class 'DefaultSCI'. */
  70. DefaultSCI* getDefaultSCI();
  71. /*! Gets the value of the variable 'myBit1' that is defined in the default interface scope. */
  72. sc_integer get_myBit1() const;
  73. /*! Sets the value of the variable 'myBit1' that is defined in the default interface scope. */
  74. void set_myBit1(sc_integer value);
  75. /*! Gets the value of the variable 'myBit2' that is defined in the default interface scope. */
  76. sc_integer get_myBit2() const;
  77. /*! Sets the value of the variable 'myBit2' that is defined in the default interface scope. */
  78. void set_myBit2(sc_integer value);
  79. /*! Gets the value of the variable 'leftBitshift' that is defined in the default interface scope. */
  80. sc_integer get_leftBitshift() const;
  81. /*! Sets the value of the variable 'leftBitshift' that is defined in the default interface scope. */
  82. void set_leftBitshift(sc_integer value);
  83. /*! Gets the value of the variable 'rightBitshift' that is defined in the default interface scope. */
  84. sc_integer get_rightBitshift() const;
  85. /*! Sets the value of the variable 'rightBitshift' that is defined in the default interface scope. */
  86. void set_rightBitshift(sc_integer value);
  87. /*! Gets the value of the variable 'complementBitshift' that is defined in the default interface scope. */
  88. sc_integer get_complementBitshift() const;
  89. /*! Sets the value of the variable 'complementBitshift' that is defined in the default interface scope. */
  90. void set_complementBitshift(sc_integer value);
  91. /*! Gets the value of the variable 'bitwiseAnd' that is defined in the default interface scope. */
  92. sc_integer get_bitwiseAnd() const;
  93. /*! Sets the value of the variable 'bitwiseAnd' that is defined in the default interface scope. */
  94. void set_bitwiseAnd(sc_integer value);
  95. /*! Gets the value of the variable 'bitwiseOr' that is defined in the default interface scope. */
  96. sc_integer get_bitwiseOr() const;
  97. /*! Sets the value of the variable 'bitwiseOr' that is defined in the default interface scope. */
  98. void set_bitwiseOr(sc_integer value);
  99. /*! Gets the value of the variable 'bitwiseXor' that is defined in the default interface scope. */
  100. sc_integer get_bitwiseXor() const;
  101. /*! Sets the value of the variable 'bitwiseXor' that is defined in the default interface scope. */
  102. void set_bitwiseXor(sc_integer value);
  103. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  104. void raise_e1();
  105. /*
  106. * Functions inherited from StatemachineInterface
  107. */
  108. virtual void init();
  109. virtual void enter();
  110. virtual void exit();
  111. virtual void runCycle();
  112. /*!
  113. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  114. * 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.
  115. */
  116. virtual sc_boolean isActive() const;
  117. /*!
  118. * Checks if all active states are final.
  119. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  120. */
  121. virtual sc_boolean isFinal() const;
  122. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  123. sc_boolean isStateActive(BitExpressionsStates state) const;
  124. private:
  125. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  126. static const sc_integer maxOrthogonalStates = 1;
  127. BitExpressionsStates stateConfVector[maxOrthogonalStates];
  128. sc_ushort stateConfVectorPosition;
  129. DefaultSCI iface;
  130. // prototypes of all internal functions
  131. sc_boolean check_main_region_StateA_tr0_tr0();
  132. void effect_main_region_StateA_tr0();
  133. void enact_main_region_StateA();
  134. void enact_main_region_StateB();
  135. void enseq_main_region_StateA_default();
  136. void enseq_main_region_StateB_default();
  137. void enseq_main_region_default();
  138. void exseq_main_region_StateA();
  139. void exseq_main_region_StateB();
  140. void exseq_main_region();
  141. void react_main_region_StateA();
  142. void react_main_region_StateB();
  143. void react_main_region__entry_Default();
  144. void clearInEvents();
  145. void clearOutEvents();
  146. };
  147. #endif /* BITEXPRESSIONS_H_ */