TriggerExpressionPrecedence.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. #ifndef TRIGGEREXPRESSIONPRECEDENCE_H_
  2. #define TRIGGEREXPRESSIONPRECEDENCE_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'TriggerExpressionPrecedence'.
  6. */
  7. class TriggerExpressionPrecedence : public StatemachineInterface
  8. {
  9. public:
  10. TriggerExpressionPrecedence();
  11. ~TriggerExpressionPrecedence();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. TriggerExpressionPrecedence_main_region_A,
  16. TriggerExpressionPrecedence_last_state
  17. } TriggerExpressionPrecedenceStates;
  18. //! Inner class for default interface scope.
  19. class DefaultSCI
  20. {
  21. public:
  22. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  23. void raise_e1();
  24. /*! Raises the in event 'e2' that is defined in the default interface scope. */
  25. void raise_e2();
  26. /*! Gets the value of the variable 'c1' that is defined in the default interface scope. */
  27. sc_boolean get_c1() const;
  28. /*! Sets the value of the variable 'c1' that is defined in the default interface scope. */
  29. void set_c1(sc_boolean value);
  30. /*! Gets the value of the variable 'c2' that is defined in the default interface scope. */
  31. sc_boolean get_c2() const;
  32. /*! Sets the value of the variable 'c2' that is defined in the default interface scope. */
  33. void set_c2(sc_boolean value);
  34. /*! Gets the value of the variable 'e1_transition' that is defined in the default interface scope. */
  35. sc_boolean get_e1_transition() const;
  36. /*! Sets the value of the variable 'e1_transition' that is defined in the default interface scope. */
  37. void set_e1_transition(sc_boolean value);
  38. /*! Gets the value of the variable 'e2_transition' that is defined in the default interface scope. */
  39. sc_boolean get_e2_transition() const;
  40. /*! Sets the value of the variable 'e2_transition' that is defined in the default interface scope. */
  41. void set_e2_transition(sc_boolean value);
  42. private:
  43. friend class TriggerExpressionPrecedence;
  44. sc_boolean e1_raised;
  45. sc_boolean e2_raised;
  46. sc_boolean c1;
  47. sc_boolean c2;
  48. sc_boolean e1_transition;
  49. sc_boolean e2_transition;
  50. };
  51. /*! Returns an instance of the interface class 'DefaultSCI'. */
  52. DefaultSCI* getDefaultSCI();
  53. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  54. void raise_e1();
  55. /*! Raises the in event 'e2' that is defined in the default interface scope. */
  56. void raise_e2();
  57. /*! Gets the value of the variable 'c1' that is defined in the default interface scope. */
  58. sc_boolean get_c1() const;
  59. /*! Sets the value of the variable 'c1' that is defined in the default interface scope. */
  60. void set_c1(sc_boolean value);
  61. /*! Gets the value of the variable 'c2' that is defined in the default interface scope. */
  62. sc_boolean get_c2() const;
  63. /*! Sets the value of the variable 'c2' that is defined in the default interface scope. */
  64. void set_c2(sc_boolean value);
  65. /*! Gets the value of the variable 'e1_transition' that is defined in the default interface scope. */
  66. sc_boolean get_e1_transition() const;
  67. /*! Sets the value of the variable 'e1_transition' that is defined in the default interface scope. */
  68. void set_e1_transition(sc_boolean value);
  69. /*! Gets the value of the variable 'e2_transition' that is defined in the default interface scope. */
  70. sc_boolean get_e2_transition() const;
  71. /*! Sets the value of the variable 'e2_transition' that is defined in the default interface scope. */
  72. void set_e2_transition(sc_boolean value);
  73. /*
  74. * Functions inherited from StatemachineInterface
  75. */
  76. virtual void init();
  77. virtual void enter();
  78. virtual void exit();
  79. virtual void runCycle();
  80. /*!
  81. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  82. * 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.
  83. */
  84. virtual sc_boolean isActive() const;
  85. /*!
  86. * Checks if all active states are final.
  87. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  88. */
  89. virtual sc_boolean isFinal() const;
  90. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  91. sc_boolean isStateActive(TriggerExpressionPrecedenceStates state) const;
  92. private:
  93. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  94. static const sc_integer maxOrthogonalStates = 1;
  95. TriggerExpressionPrecedenceStates stateConfVector[maxOrthogonalStates];
  96. sc_ushort stateConfVectorPosition;
  97. DefaultSCI iface;
  98. // prototypes of all internal functions
  99. sc_boolean check_TriggerExpressionPrecedence_main_region_A_tr0_tr0();
  100. sc_boolean check_TriggerExpressionPrecedence_main_region_A_tr1_tr1();
  101. void effect_TriggerExpressionPrecedence_main_region_A_tr0();
  102. void effect_TriggerExpressionPrecedence_main_region_A_tr1();
  103. void enseq_TriggerExpressionPrecedence_main_region_A_default();
  104. void enseq_TriggerExpressionPrecedence_main_region_default();
  105. void exseq_TriggerExpressionPrecedence_main_region_A();
  106. void exseq_TriggerExpressionPrecedence_main_region();
  107. void react_TriggerExpressionPrecedence_main_region_A();
  108. void react_TriggerExpressionPrecedence_main_region__entry_Default();
  109. void clearInEvents();
  110. void clearOutEvents();
  111. };
  112. #endif /* TRIGGEREXPRESSIONPRECEDENCE_H_ */