ConstOnlyNamedScope.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #ifndef CONSTONLYNAMEDSCOPE_H_
  2. #define CONSTONLYNAMEDSCOPE_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'ConstOnlyNamedScope'.
  6. */
  7. class ConstOnlyNamedScope : public StatemachineInterface
  8. {
  9. public:
  10. ConstOnlyNamedScope();
  11. ~ConstOnlyNamedScope();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. ConstOnlyNamedScope_main_region_A,
  16. ConstOnlyNamedScope_main_region_B,
  17. ConstOnlyNamedScope_main_region_C,
  18. ConstOnlyNamedScope_last_state
  19. } ConstOnlyNamedScopeStates;
  20. //! Inner class for default interface scope.
  21. class DefaultSCI
  22. {
  23. public:
  24. /*! Raises the in event 'e' that is defined in the default interface scope. */
  25. void raise_e(sc_integer value);
  26. private:
  27. friend class ConstOnlyNamedScope;
  28. sc_boolean e_raised;
  29. sc_integer e_value;
  30. };
  31. /*! Returns an instance of the interface class 'DefaultSCI'. */
  32. DefaultSCI* getDefaultSCI();
  33. /*! Raises the in event 'e' that is defined in the default interface scope. */
  34. void raise_e(sc_integer value);
  35. //! Inner class for A interface scope.
  36. class SCI_A
  37. {
  38. public:
  39. /*! Gets the value of the variable 'B' that is defined in the interface scope 'A'. */
  40. const sc_integer get_b() const;
  41. /*! Gets the value of the variable 'C' that is defined in the interface scope 'A'. */
  42. const sc_integer get_c() const;
  43. private:
  44. friend class ConstOnlyNamedScope;
  45. static const sc_integer B;
  46. static const sc_integer C;
  47. };
  48. /*! Returns an instance of the interface class 'SCI_A'. */
  49. SCI_A* getSCI_A();
  50. /*
  51. * Functions inherited from StatemachineInterface
  52. */
  53. virtual void init();
  54. virtual void enter();
  55. virtual void exit();
  56. virtual void runCycle();
  57. /*!
  58. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  59. * 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.
  60. */
  61. virtual sc_boolean isActive() const;
  62. /*!
  63. * Checks if all active states are final.
  64. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  65. */
  66. virtual sc_boolean isFinal() const;
  67. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  68. sc_boolean isStateActive(ConstOnlyNamedScopeStates state) const;
  69. private:
  70. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  71. static const sc_integer maxOrthogonalStates = 1;
  72. ConstOnlyNamedScopeStates stateConfVector[maxOrthogonalStates];
  73. sc_ushort stateConfVectorPosition;
  74. DefaultSCI iface;
  75. SCI_A ifaceA;
  76. // prototypes of all internal functions
  77. sc_boolean check_ConstOnlyNamedScope_main_region_A_tr0_tr0();
  78. sc_boolean check_ConstOnlyNamedScope_main_region_A_tr1_tr1();
  79. void effect_ConstOnlyNamedScope_main_region_A_tr0();
  80. void effect_ConstOnlyNamedScope_main_region_A_tr1();
  81. void enseq_ConstOnlyNamedScope_main_region_A_default();
  82. void enseq_ConstOnlyNamedScope_main_region_B_default();
  83. void enseq_ConstOnlyNamedScope_main_region_C_default();
  84. void enseq_ConstOnlyNamedScope_main_region_default();
  85. void exseq_ConstOnlyNamedScope_main_region_A();
  86. void exseq_ConstOnlyNamedScope_main_region_B();
  87. void exseq_ConstOnlyNamedScope_main_region_C();
  88. void exseq_ConstOnlyNamedScope_main_region();
  89. void react_ConstOnlyNamedScope_main_region_A();
  90. void react_ConstOnlyNamedScope_main_region_B();
  91. void react_ConstOnlyNamedScope_main_region_C();
  92. void react_ConstOnlyNamedScope_main_region__entry_Default();
  93. void clearInEvents();
  94. void clearOutEvents();
  95. };
  96. #endif /* CONSTONLYNAMEDSCOPE_H_ */