SameNameDifferentRegion.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #ifndef SAMENAMEDIFFERENTREGION_H_
  2. #define SAMENAMEDIFFERENTREGION_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'SameNameDifferentRegion'.
  6. */
  7. class SameNameDifferentRegion : public StatemachineInterface
  8. {
  9. public:
  10. SameNameDifferentRegion();
  11. ~SameNameDifferentRegion();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_StateA,
  16. main_region_StateB,
  17. main_region_StateB_r1_StateA,
  18. main_region_StateB_r1_StateB,
  19. SameNameDifferentRegion_last_state
  20. } SameNameDifferentRegionStates;
  21. //! Inner class for default interface scope.
  22. class DefaultSCI
  23. {
  24. public:
  25. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  26. void raise_e1();
  27. private:
  28. friend class SameNameDifferentRegion;
  29. sc_boolean e1_raised;
  30. };
  31. /*! Returns an instance of the interface class 'DefaultSCI'. */
  32. DefaultSCI* getDefaultSCI();
  33. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  34. void raise_e1();
  35. /*
  36. * Functions inherited from StatemachineInterface
  37. */
  38. virtual void init();
  39. virtual void enter();
  40. virtual void exit();
  41. virtual void runCycle();
  42. /*!
  43. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  44. * 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.
  45. */
  46. virtual sc_boolean isActive() const;
  47. /*!
  48. * Checks if all active states are final.
  49. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  50. */
  51. virtual sc_boolean isFinal() const;
  52. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  53. sc_boolean isStateActive(SameNameDifferentRegionStates state) const;
  54. private:
  55. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  56. static const sc_integer maxOrthogonalStates = 1;
  57. SameNameDifferentRegionStates stateConfVector[maxOrthogonalStates];
  58. sc_ushort stateConfVectorPosition;
  59. DefaultSCI iface;
  60. // prototypes of all internal functions
  61. sc_boolean check_main_region_StateA_tr0_tr0();
  62. sc_boolean check_main_region_StateB_r1_StateA_tr0_tr0();
  63. void effect_main_region_StateA_tr0();
  64. void effect_main_region_StateB_r1_StateA_tr0();
  65. void enseq_main_region_StateA_default();
  66. void enseq_main_region_StateB_default();
  67. void enseq_main_region_StateB_r1_StateA_default();
  68. void enseq_main_region_StateB_r1_StateB_default();
  69. void enseq_main_region_default();
  70. void enseq_main_region_StateB_r1_default();
  71. void exseq_main_region_StateA();
  72. void exseq_main_region_StateB_r1_StateA();
  73. void exseq_main_region_StateB_r1_StateB();
  74. void exseq_main_region();
  75. void exseq_main_region_StateB_r1();
  76. void react_main_region_StateA();
  77. void react_main_region_StateB_r1_StateA();
  78. void react_main_region_StateB_r1_StateB();
  79. void react_main_region__entry_Default();
  80. void react_main_region_StateB_r1__entry_Default();
  81. void clearInEvents();
  82. void clearOutEvents();
  83. };
  84. #endif /* SAMENAMEDIFFERENTREGION_H_ */