ConstOnlyDefaultScope.h 4.0 KB

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