CastExpressions.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #ifndef CASTEXPRESSIONS_H_
  2. #define CASTEXPRESSIONS_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'CastExpressions'.
  6. */
  7. class CastExpressions : public StatemachineInterface
  8. {
  9. public:
  10. CastExpressions();
  11. ~CastExpressions();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_A,
  16. main_region_B,
  17. main_region_C,
  18. CastExpressions_last_state
  19. } CastExpressionsStates;
  20. //! Inner class for default interface scope.
  21. class DefaultSCI
  22. {
  23. public:
  24. /*! Gets the value of the variable 'realValue' that is defined in the default interface scope. */
  25. sc_real get_realValue() const;
  26. /*! Sets the value of the variable 'realValue' that is defined in the default interface scope. */
  27. void set_realValue(sc_real value);
  28. /*! Gets the value of the variable 'intValue' that is defined in the default interface scope. */
  29. sc_integer get_intValue() const;
  30. /*! Sets the value of the variable 'intValue' that is defined in the default interface scope. */
  31. void set_intValue(sc_integer value);
  32. private:
  33. friend class CastExpressions;
  34. sc_real realValue;
  35. sc_integer intValue;
  36. };
  37. /*! Returns an instance of the interface class 'DefaultSCI'. */
  38. DefaultSCI* getDefaultSCI();
  39. /*! Gets the value of the variable 'realValue' that is defined in the default interface scope. */
  40. sc_real get_realValue() const;
  41. /*! Sets the value of the variable 'realValue' that is defined in the default interface scope. */
  42. void set_realValue(sc_real value);
  43. /*! Gets the value of the variable 'intValue' that is defined in the default interface scope. */
  44. sc_integer get_intValue() const;
  45. /*! Sets the value of the variable 'intValue' that is defined in the default interface scope. */
  46. void set_intValue(sc_integer value);
  47. /*
  48. * Functions inherited from StatemachineInterface
  49. */
  50. virtual void init();
  51. virtual void enter();
  52. virtual void exit();
  53. virtual void runCycle();
  54. /*!
  55. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  56. * 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.
  57. */
  58. virtual sc_boolean isActive() const;
  59. /*!
  60. * Checks if all active states are final.
  61. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  62. */
  63. virtual sc_boolean isFinal() const;
  64. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  65. sc_boolean isStateActive(CastExpressionsStates state) const;
  66. private:
  67. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  68. static const sc_integer maxOrthogonalStates = 1;
  69. CastExpressionsStates stateConfVector[maxOrthogonalStates];
  70. sc_ushort stateConfVectorPosition;
  71. DefaultSCI iface;
  72. // prototypes of all internal functions
  73. sc_boolean check_main_region_A_tr0_tr0();
  74. sc_boolean check_main_region_B_tr0_tr0();
  75. void effect_main_region_A_tr0();
  76. void effect_main_region_B_tr0();
  77. void enact_main_region_B();
  78. void enact_main_region_C();
  79. void enseq_main_region_A_default();
  80. void enseq_main_region_B_default();
  81. void enseq_main_region_C_default();
  82. void enseq_main_region_default();
  83. void exseq_main_region_A();
  84. void exseq_main_region_B();
  85. void exseq_main_region_C();
  86. void exseq_main_region();
  87. void react_main_region_A();
  88. void react_main_region_B();
  89. void react_main_region_C();
  90. void react_main_region__entry_Default();
  91. void clearInEvents();
  92. void clearOutEvents();
  93. };
  94. #endif /* CASTEXPRESSIONS_H_ */