BooleanExpressions.h 6.6 KB

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