TriggerGuardExpressions.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #ifndef TRIGGERGUARDEXPRESSIONS_H_
  2. #define TRIGGERGUARDEXPRESSIONS_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'TriggerGuardExpressions'.
  6. */
  7. class TriggerGuardExpressions : public StatemachineInterface
  8. {
  9. public:
  10. TriggerGuardExpressions();
  11. ~TriggerGuardExpressions();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_A,
  16. main_region_B,
  17. TriggerGuardExpressions_last_state
  18. } TriggerGuardExpressionsStates;
  19. //! Inner class for default interface scope.
  20. class DefaultSCI
  21. {
  22. public:
  23. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  24. void raise_e1();
  25. /*! Raises the in event 'e2' that is defined in the default interface scope. */
  26. void raise_e2();
  27. /*! Gets the value of the variable 'b' that is defined in the default interface scope. */
  28. sc_boolean get_b() const;
  29. /*! Sets the value of the variable 'b' that is defined in the default interface scope. */
  30. void set_b(sc_boolean value);
  31. private:
  32. friend class TriggerGuardExpressions;
  33. sc_boolean e1_raised;
  34. sc_boolean e2_raised;
  35. sc_boolean b;
  36. };
  37. /*! Returns an instance of the interface class 'DefaultSCI'. */
  38. DefaultSCI* getDefaultSCI();
  39. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  40. void raise_e1();
  41. /*! Raises the in event 'e2' that is defined in the default interface scope. */
  42. void raise_e2();
  43. /*! Gets the value of the variable 'b' that is defined in the default interface scope. */
  44. sc_boolean get_b() const;
  45. /*! Sets the value of the variable 'b' that is defined in the default interface scope. */
  46. void set_b(sc_boolean value);
  47. /*
  48. * Functions inherited from StatemachineInterface
  49. */
  50. virtual void init();
  51. virtual void enter();
  52. virtual void exit();
  53. virtual void runCycle();
  54. /*!
  55. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  56. * 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.
  57. */
  58. virtual sc_boolean isActive() const;
  59. /*!
  60. * Checks if all active states are final.
  61. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  62. */
  63. virtual sc_boolean isFinal() const;
  64. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  65. sc_boolean isStateActive(TriggerGuardExpressionsStates state) const;
  66. private:
  67. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  68. static const sc_integer maxOrthogonalStates = 1;
  69. TriggerGuardExpressionsStates stateConfVector[maxOrthogonalStates];
  70. sc_ushort stateConfVectorPosition;
  71. DefaultSCI iface;
  72. // prototypes of all internal functions
  73. sc_boolean check_main_region_A_tr0_tr0();
  74. sc_boolean check_main_region_B_tr0_tr0();
  75. void effect_main_region_A_tr0();
  76. void effect_main_region_B_tr0();
  77. void enseq_main_region_A_default();
  78. void enseq_main_region_B_default();
  79. void enseq_main_region_default();
  80. void exseq_main_region_A();
  81. void exseq_main_region_B();
  82. void exseq_main_region();
  83. void react_main_region_A();
  84. void react_main_region_B();
  85. void react_main_region__entry_Default();
  86. void clearInEvents();
  87. void clearOutEvents();
  88. };
  89. #endif /* TRIGGERGUARDEXPRESSIONS_H_ */