ConstOnlyInternalScope.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #ifndef CONSTONLYINTERNALSCOPE_H_
  2. #define CONSTONLYINTERNALSCOPE_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'ConstOnlyInternalScope'.
  6. */
  7. class ConstOnlyInternalScope : public StatemachineInterface
  8. {
  9. public:
  10. ConstOnlyInternalScope();
  11. ~ConstOnlyInternalScope();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. ConstOnlyInternalScope_main_region_A,
  16. ConstOnlyInternalScope_main_region_B,
  17. ConstOnlyInternalScope_main_region_C,
  18. ConstOnlyInternalScope_last_state
  19. } ConstOnlyInternalScopeStates;
  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 ConstOnlyInternalScope;
  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. /*
  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(ConstOnlyInternalScopeStates state) const;
  54. private:
  55. //! Inner class for internal interface scope.
  56. class InternalSCI
  57. {
  58. public:
  59. /*! Gets the value of the variable 'B' that is defined in the internal scope. */
  60. const sc_integer get_b() const;
  61. /*! Gets the value of the variable 'C' that is defined in the internal scope. */
  62. const sc_integer get_c() const;
  63. private:
  64. friend class ConstOnlyInternalScope;
  65. static const sc_integer B;
  66. static const sc_integer C;
  67. };
  68. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  69. static const sc_integer maxOrthogonalStates = 1;
  70. ConstOnlyInternalScopeStates stateConfVector[maxOrthogonalStates];
  71. sc_ushort stateConfVectorPosition;
  72. DefaultSCI iface;
  73. InternalSCI ifaceInternalSCI;
  74. // prototypes of all internal functions
  75. sc_boolean check_ConstOnlyInternalScope_main_region_A_tr0_tr0();
  76. sc_boolean check_ConstOnlyInternalScope_main_region_A_tr1_tr1();
  77. void effect_ConstOnlyInternalScope_main_region_A_tr0();
  78. void effect_ConstOnlyInternalScope_main_region_A_tr1();
  79. void enseq_ConstOnlyInternalScope_main_region_A_default();
  80. void enseq_ConstOnlyInternalScope_main_region_B_default();
  81. void enseq_ConstOnlyInternalScope_main_region_C_default();
  82. void enseq_ConstOnlyInternalScope_main_region_default();
  83. void exseq_ConstOnlyInternalScope_main_region_A();
  84. void exseq_ConstOnlyInternalScope_main_region_B();
  85. void exseq_ConstOnlyInternalScope_main_region_C();
  86. void exseq_ConstOnlyInternalScope_main_region();
  87. void react_ConstOnlyInternalScope_main_region_A();
  88. void react_ConstOnlyInternalScope_main_region_B();
  89. void react_ConstOnlyInternalScope_main_region_C();
  90. void react_ConstOnlyInternalScope_main_region__entry_Default();
  91. void clearInEvents();
  92. void clearOutEvents();
  93. };
  94. #endif /* CONSTONLYINTERNALSCOPE_H_ */