PriorityValues.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #ifndef PRIORITYVALUES_H_
  2. #define PRIORITYVALUES_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'PriorityValues'.
  6. */
  7. class PriorityValues : public StatemachineInterface
  8. {
  9. public:
  10. PriorityValues();
  11. ~PriorityValues();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. someRegion_A,
  16. someRegion_B,
  17. main_region_A,
  18. main_region_B,
  19. main_region_C,
  20. main_region_D,
  21. main_region_E,
  22. PriorityValues_last_state
  23. } PriorityValuesStates;
  24. //! Inner class for default interface scope.
  25. class DefaultSCI
  26. {
  27. public:
  28. /*! Raises the in event 'event1' that is defined in the default interface scope. */
  29. void raise_event1();
  30. /*! Raises the in event 'event2' that is defined in the default interface scope. */
  31. void raise_event2();
  32. private:
  33. friend class PriorityValues;
  34. sc_boolean event1_raised;
  35. sc_boolean event2_raised;
  36. };
  37. /*! Returns an instance of the interface class 'DefaultSCI'. */
  38. DefaultSCI* getDefaultSCI();
  39. /*! Raises the in event 'event1' that is defined in the default interface scope. */
  40. void raise_event1();
  41. /*! Raises the in event 'event2' that is defined in the default interface scope. */
  42. void raise_event2();
  43. /*
  44. * Functions inherited from StatemachineInterface
  45. */
  46. virtual void init();
  47. virtual void enter();
  48. virtual void exit();
  49. virtual void runCycle();
  50. /*!
  51. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  52. * 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.
  53. */
  54. virtual sc_boolean isActive() const;
  55. /*!
  56. * Checks if all active states are final.
  57. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  58. */
  59. virtual sc_boolean isFinal() const;
  60. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  61. sc_boolean isStateActive(PriorityValuesStates state) const;
  62. private:
  63. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  64. static const sc_integer maxOrthogonalStates = 2;
  65. PriorityValuesStates stateConfVector[maxOrthogonalStates];
  66. sc_ushort stateConfVectorPosition;
  67. DefaultSCI iface;
  68. // prototypes of all internal functions
  69. sc_boolean check_someRegion_A_tr0_tr0();
  70. sc_boolean check_main_region_A_tr0_tr0();
  71. sc_boolean check_main_region_A_tr1_tr1();
  72. sc_boolean check_main_region_A_tr2_tr2();
  73. sc_boolean check_main_region_A_tr3_tr3();
  74. void effect_someRegion_A_tr0();
  75. void effect_main_region_A_tr0();
  76. void effect_main_region_A_tr1();
  77. void effect_main_region_A_tr2();
  78. void effect_main_region_A_tr3();
  79. void enseq_someRegion_A_default();
  80. void enseq_someRegion_B_default();
  81. void enseq_main_region_A_default();
  82. void enseq_main_region_B_default();
  83. void enseq_main_region_C_default();
  84. void enseq_main_region_D_default();
  85. void enseq_main_region_E_default();
  86. void enseq_someRegion_default();
  87. void enseq_main_region_default();
  88. void exseq_someRegion_A();
  89. void exseq_someRegion_B();
  90. void exseq_main_region_A();
  91. void exseq_main_region_B();
  92. void exseq_main_region_C();
  93. void exseq_main_region_D();
  94. void exseq_main_region_E();
  95. void exseq_someRegion();
  96. void exseq_main_region();
  97. void react_someRegion_A();
  98. void react_someRegion_B();
  99. void react_main_region_A();
  100. void react_main_region_B();
  101. void react_main_region_C();
  102. void react_main_region_D();
  103. void react_main_region_E();
  104. void react_someRegion__entry_Default();
  105. void react_main_region__entry_Default();
  106. void clearInEvents();
  107. void clearOutEvents();
  108. };
  109. #endif /* PRIORITYVALUES_H_ */