123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424 |
- #ifndef DECLARATIONS_H_
- #define DECLARATIONS_H_
- #include "sc_types.h"
- #include "StatemachineInterface.h"
- /*! \file Header of the state machine 'Declarations'.
- */
- class Declarations : public StatemachineInterface
- {
-
- public:
-
- Declarations();
-
- ~Declarations();
-
- /*! Enumeration of all states */
- typedef enum
- {
- main_region_A,
- main_region_B,
- Declarations_last_state
- } DeclarationsStates;
-
- //! Inner class for default interface scope.
- class DefaultSCI
- {
-
- public:
- /*! Raises the in event 'evA' that is defined in the default interface scope. */
- void raise_evA();
-
- /*! Checks if the out event 'evB' that is defined in the default interface scope has been raised. */
- sc_boolean isRaised_evB() const;
-
- /*! Raises the in event 'evC' that is defined in the default interface scope. */
- void raise_evC(sc_boolean value);
-
- /*! Checks if the out event 'evD' that is defined in the default interface scope has been raised. */
- sc_boolean isRaised_evD() const;
-
- /*! Gets the value of the out event 'evD' that is defined in the default interface scope. */
- sc_integer get_evD_value() const;
-
- /*! Raises the in event 'evE' that is defined in the default interface scope. */
- void raise_evE(sc_real value);
-
- /*! Checks if the out event 'evF' that is defined in the default interface scope has been raised. */
- sc_boolean isRaised_evF() const;
-
- /*! Gets the value of the out event 'evF' that is defined in the default interface scope. */
- sc_string get_evF_value() const;
-
- /*! Gets the value of the variable 'varA' that is defined in the default interface scope. */
- sc_boolean get_varA() const;
-
- /*! Sets the value of the variable 'varA' that is defined in the default interface scope. */
- void set_varA(sc_boolean value);
-
- /*! Gets the value of the variable 'varB' that is defined in the default interface scope. */
- sc_integer get_varB() const;
-
- /*! Sets the value of the variable 'varB' that is defined in the default interface scope. */
- void set_varB(sc_integer value);
-
- /*! Gets the value of the variable 'varC' that is defined in the default interface scope. */
- sc_real get_varC() const;
-
- /*! Sets the value of the variable 'varC' that is defined in the default interface scope. */
- void set_varC(sc_real value);
-
- /*! Gets the value of the variable 'varD' that is defined in the default interface scope. */
- sc_string get_varD() const;
-
- /*! Sets the value of the variable 'varD' that is defined in the default interface scope. */
- void set_varD(sc_string value);
-
- /*! Gets the value of the variable 'varE' that is defined in the default interface scope. */
- sc_integer get_varE() const;
-
- /*! Sets the value of the variable 'varE' that is defined in the default interface scope. */
- void set_varE(sc_integer value);
-
-
- private:
- friend class Declarations;
- sc_boolean evA_raised;
- sc_boolean evB_raised;
- sc_boolean evC_raised;
- sc_boolean evC_value;
- sc_boolean evD_raised;
- sc_integer evD_value;
- sc_boolean evE_raised;
- sc_real evE_value;
- sc_boolean evF_raised;
- sc_string evF_value;
- sc_boolean varA;
- sc_integer varB;
- sc_real varC;
- sc_string varD;
- sc_integer varE;
- };
-
-
- /*! Returns an instance of the interface class 'DefaultSCI'. */
- DefaultSCI* getDefaultSCI();
-
- /*! Raises the in event 'evA' that is defined in the default interface scope. */
- void raise_evA();
-
- /*! Checks if the out event 'evB' that is defined in the default interface scope has been raised. */
- sc_boolean isRaised_evB() const;
-
- /*! Raises the in event 'evC' that is defined in the default interface scope. */
- void raise_evC(sc_boolean value);
-
- /*! Checks if the out event 'evD' that is defined in the default interface scope has been raised. */
- sc_boolean isRaised_evD() const;
-
- /*! Gets the value of the out event 'evD' that is defined in the default interface scope. */
- sc_integer get_evD_value() const;
-
- /*! Raises the in event 'evE' that is defined in the default interface scope. */
- void raise_evE(sc_real value);
-
- /*! Checks if the out event 'evF' that is defined in the default interface scope has been raised. */
- sc_boolean isRaised_evF() const;
-
- /*! Gets the value of the out event 'evF' that is defined in the default interface scope. */
- sc_string get_evF_value() const;
-
- /*! Gets the value of the variable 'varA' that is defined in the default interface scope. */
- sc_boolean get_varA() const;
-
- /*! Sets the value of the variable 'varA' that is defined in the default interface scope. */
- void set_varA(sc_boolean value);
-
- /*! Gets the value of the variable 'varB' that is defined in the default interface scope. */
- sc_integer get_varB() const;
-
- /*! Sets the value of the variable 'varB' that is defined in the default interface scope. */
- void set_varB(sc_integer value);
-
- /*! Gets the value of the variable 'varC' that is defined in the default interface scope. */
- sc_real get_varC() const;
-
- /*! Sets the value of the variable 'varC' that is defined in the default interface scope. */
- void set_varC(sc_real value);
-
- /*! Gets the value of the variable 'varD' that is defined in the default interface scope. */
- sc_string get_varD() const;
-
- /*! Sets the value of the variable 'varD' that is defined in the default interface scope. */
- void set_varD(sc_string value);
-
- /*! Gets the value of the variable 'varE' that is defined in the default interface scope. */
- sc_integer get_varE() const;
-
- /*! Sets the value of the variable 'varE' that is defined in the default interface scope. */
- void set_varE(sc_integer value);
-
- //! Inner class for ifA interface scope.
- class SCI_IfA
- {
-
- public:
- /*! Raises the in event 'evA' that is defined in the interface scope 'ifA'. */
- void raise_evA();
-
- /*! Checks if the out event 'evB' that is defined in the interface scope 'ifA' has been raised. */
- sc_boolean isRaised_evB() const;
-
- /*! Raises the in event 'evC' that is defined in the interface scope 'ifA'. */
- void raise_evC(sc_boolean value);
-
- /*! Checks if the out event 'evD' that is defined in the interface scope 'ifA' has been raised. */
- sc_boolean isRaised_evD() const;
-
- /*! Gets the value of the out event 'evD' that is defined in the interface scope 'ifA'. */
- sc_integer get_evD_value() const;
-
- /*! Raises the in event 'evE' that is defined in the interface scope 'ifA'. */
- void raise_evE(sc_real value);
-
- /*! Checks if the out event 'evF' that is defined in the interface scope 'ifA' has been raised. */
- sc_boolean isRaised_evF() const;
-
- /*! Gets the value of the out event 'evF' that is defined in the interface scope 'ifA'. */
- sc_string get_evF_value() const;
-
- /*! Gets the value of the variable 'varA' that is defined in the interface scope 'ifA'. */
- sc_boolean get_varA() const;
-
- /*! Sets the value of the variable 'varA' that is defined in the interface scope 'ifA'. */
- void set_varA(sc_boolean value);
-
- /*! Gets the value of the variable 'varB' that is defined in the interface scope 'ifA'. */
- sc_integer get_varB() const;
-
- /*! Sets the value of the variable 'varB' that is defined in the interface scope 'ifA'. */
- void set_varB(sc_integer value);
-
- /*! Gets the value of the variable 'varC' that is defined in the interface scope 'ifA'. */
- sc_real get_varC() const;
-
- /*! Sets the value of the variable 'varC' that is defined in the interface scope 'ifA'. */
- void set_varC(sc_real value);
-
- /*! Gets the value of the variable 'varD' that is defined in the interface scope 'ifA'. */
- sc_string get_varD() const;
-
- /*! Sets the value of the variable 'varD' that is defined in the interface scope 'ifA'. */
- void set_varD(sc_string value);
-
- /*! Gets the value of the variable 'varE' that is defined in the interface scope 'ifA'. */
- sc_integer get_varE() const;
-
- /*! Sets the value of the variable 'varE' that is defined in the interface scope 'ifA'. */
- void set_varE(sc_integer value);
-
-
- private:
- friend class Declarations;
- sc_boolean evA_raised;
- sc_boolean evB_raised;
- sc_boolean evC_raised;
- sc_boolean evC_value;
- sc_boolean evD_raised;
- sc_integer evD_value;
- sc_boolean evE_raised;
- sc_real evE_value;
- sc_boolean evF_raised;
- sc_string evF_value;
- sc_boolean varA;
- sc_integer varB;
- sc_real varC;
- sc_string varD;
- sc_integer varE;
- };
-
-
- /*! Returns an instance of the interface class 'SCI_IfA'. */
- SCI_IfA* getSCI_IfA();
-
-
-
- /*
- * Functions inherited from StatemachineInterface
- */
- virtual void init();
-
- virtual void enter();
-
- virtual void exit();
-
- virtual void runCycle();
-
- /*!
- * Checks if the state machine is active (until 2.4.1 this method was used for states).
- * 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.
- */
- virtual sc_boolean isActive() const;
-
-
- /*!
- * Checks if all active states are final.
- * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
- */
- virtual sc_boolean isFinal() const;
-
-
- /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
- sc_boolean isStateActive(DeclarationsStates state) const;
-
- private:
-
- //! Inner class for internal interface scope.
- class InternalSCI
- {
-
- public:
- /*! Raises the in event 'evInA' that is defined in the internal scope. */
- void raise_evInA();
-
- /*! Checks if the out event 'evInA' that is defined in the internal scope has been raised. */
- sc_boolean isRaised_evInA() const;
-
- /*! Raises the in event 'evInB' that is defined in the internal scope. */
- void raise_evInB();
-
- /*! Checks if the out event 'evInB' that is defined in the internal scope has been raised. */
- sc_boolean isRaised_evInB() const;
-
- /*! Raises the in event 'evInC' that is defined in the internal scope. */
- void raise_evInC(sc_boolean value);
-
- /*! Checks if the out event 'evInC' that is defined in the internal scope has been raised. */
- sc_boolean isRaised_evInC() const;
-
- /*! Gets the value of the out event 'evInC' that is defined in the internal scope. */
- sc_boolean get_evInC_value() const;
-
- /*! Raises the in event 'evInD' that is defined in the internal scope. */
- void raise_evInD(sc_integer value);
-
- /*! Checks if the out event 'evInD' that is defined in the internal scope has been raised. */
- sc_boolean isRaised_evInD() const;
-
- /*! Gets the value of the out event 'evInD' that is defined in the internal scope. */
- sc_integer get_evInD_value() const;
-
- /*! Raises the in event 'evInE' that is defined in the internal scope. */
- void raise_evInE(sc_real value);
-
- /*! Checks if the out event 'evInE' that is defined in the internal scope has been raised. */
- sc_boolean isRaised_evInE() const;
-
- /*! Gets the value of the out event 'evInE' that is defined in the internal scope. */
- sc_real get_evInE_value() const;
-
- /*! Raises the in event 'evInF' that is defined in the internal scope. */
- void raise_evInF(sc_string value);
-
- /*! Checks if the out event 'evInF' that is defined in the internal scope has been raised. */
- sc_boolean isRaised_evInF() const;
-
- /*! Gets the value of the out event 'evInF' that is defined in the internal scope. */
- sc_string get_evInF_value() const;
-
- /*! Gets the value of the variable 'varInA' that is defined in the internal scope. */
- sc_boolean get_varInA() const;
-
- /*! Sets the value of the variable 'varInA' that is defined in the internal scope. */
- void set_varInA(sc_boolean value);
-
- /*! Gets the value of the variable 'varInB' that is defined in the internal scope. */
- sc_integer get_varInB() const;
-
- /*! Sets the value of the variable 'varInB' that is defined in the internal scope. */
- void set_varInB(sc_integer value);
-
- /*! Gets the value of the variable 'varInC' that is defined in the internal scope. */
- sc_real get_varInC() const;
-
- /*! Sets the value of the variable 'varInC' that is defined in the internal scope. */
- void set_varInC(sc_real value);
-
- /*! Gets the value of the variable 'varInD' that is defined in the internal scope. */
- sc_string get_varInD() const;
-
- /*! Sets the value of the variable 'varInD' that is defined in the internal scope. */
- void set_varInD(sc_string value);
-
- /*! Gets the value of the variable 'varInE' that is defined in the internal scope. */
- sc_integer get_varInE() const;
-
- /*! Sets the value of the variable 'varInE' that is defined in the internal scope. */
- void set_varInE(sc_integer value);
-
-
- private:
- friend class Declarations;
- sc_boolean evInA_raised;
- sc_boolean evInB_raised;
- sc_boolean evInC_raised;
- sc_boolean evInC_value;
- sc_boolean evInD_raised;
- sc_integer evInD_value;
- sc_boolean evInE_raised;
- sc_real evInE_value;
- sc_boolean evInF_raised;
- sc_string evInF_value;
- sc_boolean varInA;
- sc_integer varInB;
- sc_real varInC;
- sc_string varInD;
- sc_integer varInE;
- };
-
- //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
- static const sc_integer maxOrthogonalStates = 1;
-
-
- DeclarationsStates stateConfVector[maxOrthogonalStates];
-
- sc_ushort stateConfVectorPosition;
-
- DefaultSCI iface;
- SCI_IfA ifaceIfA;
- InternalSCI ifaceInternalSCI;
-
- // prototypes of all internal functions
-
- sc_boolean check_main_region_A_tr0_tr0();
- sc_boolean check_main_region_A_tr1_tr1();
- sc_boolean check_main_region_B_tr0_tr0();
- sc_boolean check_main_region_B_tr1_tr1();
- sc_boolean check_main_region_B_tr2_tr2();
- sc_boolean check_main_region_B_tr3_tr3();
- void effect_main_region_A_tr0();
- void effect_main_region_A_tr1();
- void effect_main_region_B_tr0();
- void effect_main_region_B_tr1();
- void effect_main_region_B_tr2();
- void effect_main_region_B_tr3();
- void enact_main_region_A();
- void enseq_main_region_A_default();
- void enseq_main_region_B_default();
- void enseq_main_region_default();
- void exseq_main_region_A();
- void exseq_main_region_B();
- void exseq_main_region();
- void react_main_region_A();
- void react_main_region_B();
- void react_main_region__entry_Default();
- void clearInEvents();
- void clearOutEvents();
-
- };
- #endif /* DECLARATIONS_H_ */
|