123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- #include <stdlib.h>
- #include <string.h>
- #include "sc_types.h"
- #include "ConstOnlyInternalScope.h"
- /*! \file Implementation of the state machine 'ConstOnlyInternalScope'
- */
- /* prototypes of all internal functions */
- static sc_boolean constOnlyInternalScope_check_ConstOnlyInternalScope_main_region_A_tr0_tr0(const ConstOnlyInternalScope* handle);
- static sc_boolean constOnlyInternalScope_check_ConstOnlyInternalScope_main_region_A_tr1_tr1(const ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_effect_ConstOnlyInternalScope_main_region_A_tr0(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_effect_ConstOnlyInternalScope_main_region_A_tr1(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_A_default(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_B_default(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_C_default(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_default(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_A(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_B(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_C(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_react_ConstOnlyInternalScope_main_region_A(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_react_ConstOnlyInternalScope_main_region_B(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_react_ConstOnlyInternalScope_main_region_C(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_react_ConstOnlyInternalScope_main_region__entry_Default(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_clearInEvents(ConstOnlyInternalScope* handle);
- static void constOnlyInternalScope_clearOutEvents(ConstOnlyInternalScope* handle);
- const sc_integer CONSTONLYINTERNALSCOPE_CONSTONLYINTERNALSCOPEINTERNAL_B = 1;
- const sc_integer CONSTONLYINTERNALSCOPE_CONSTONLYINTERNALSCOPEINTERNAL_C = 2;
- void constOnlyInternalScope_init(ConstOnlyInternalScope* handle)
- {
- sc_integer i;
- for (i = 0; i < CONSTONLYINTERNALSCOPE_MAX_ORTHOGONAL_STATES; ++i)
- {
- handle->stateConfVector[i] = ConstOnlyInternalScope_last_state;
- }
-
-
- handle->stateConfVectorPosition = 0;
- constOnlyInternalScope_clearInEvents(handle);
- constOnlyInternalScope_clearOutEvents(handle);
- }
- void constOnlyInternalScope_enter(ConstOnlyInternalScope* handle)
- {
- /* Default enter sequence for statechart ConstOnlyInternalScope */
- constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_default(handle);
- }
- void constOnlyInternalScope_exit(ConstOnlyInternalScope* handle)
- {
- /* Default exit sequence for statechart ConstOnlyInternalScope */
- constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region(handle);
- }
- sc_boolean constOnlyInternalScope_isActive(const ConstOnlyInternalScope* handle)
- {
- sc_boolean result = bool_false;
- int i;
-
- for(i = 0; i < CONSTONLYINTERNALSCOPE_MAX_ORTHOGONAL_STATES; i++)
- {
- result = result || handle->stateConfVector[i] != ConstOnlyInternalScope_last_state;
- }
-
- return result;
- }
- /*
- * Always returns 'false' since this state machine can never become final.
- */
- sc_boolean constOnlyInternalScope_isFinal(const ConstOnlyInternalScope* handle)
- {
- return bool_false;
- }
- static void constOnlyInternalScope_clearInEvents(ConstOnlyInternalScope* handle)
- {
- handle->iface.e_raised = bool_false;
- }
- static void constOnlyInternalScope_clearOutEvents(ConstOnlyInternalScope* handle)
- {
- }
- void constOnlyInternalScope_runCycle(ConstOnlyInternalScope* handle)
- {
-
- constOnlyInternalScope_clearOutEvents(handle);
-
- for (handle->stateConfVectorPosition = 0;
- handle->stateConfVectorPosition < CONSTONLYINTERNALSCOPE_MAX_ORTHOGONAL_STATES;
- handle->stateConfVectorPosition++)
- {
-
- switch (handle->stateConfVector[handle->stateConfVectorPosition])
- {
- case ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_A :
- {
- constOnlyInternalScope_react_ConstOnlyInternalScope_main_region_A(handle);
- break;
- }
- case ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_B :
- {
- constOnlyInternalScope_react_ConstOnlyInternalScope_main_region_B(handle);
- break;
- }
- case ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_C :
- {
- constOnlyInternalScope_react_ConstOnlyInternalScope_main_region_C(handle);
- break;
- }
- default:
- break;
- }
- }
-
- constOnlyInternalScope_clearInEvents(handle);
- }
- sc_boolean constOnlyInternalScope_isStateActive(const ConstOnlyInternalScope* handle, ConstOnlyInternalScopeStates state)
- {
- sc_boolean result = bool_false;
- switch (state)
- {
- case ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_A :
- result = (sc_boolean) (handle->stateConfVector[SCVI_CONSTONLYINTERNALSCOPE_CONSTONLYINTERNALSCOPE_MAIN_REGION_A] == ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_A
- );
- break;
- case ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_B :
- result = (sc_boolean) (handle->stateConfVector[SCVI_CONSTONLYINTERNALSCOPE_CONSTONLYINTERNALSCOPE_MAIN_REGION_B] == ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_B
- );
- break;
- case ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_C :
- result = (sc_boolean) (handle->stateConfVector[SCVI_CONSTONLYINTERNALSCOPE_CONSTONLYINTERNALSCOPE_MAIN_REGION_C] == ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_C
- );
- break;
- default:
- result = bool_false;
- break;
- }
- return result;
- }
- void constOnlyInternalScopeIface_raise_e(ConstOnlyInternalScope* handle, sc_integer value)
- {
- handle->iface.e_value = value;
- handle->iface.e_raised = bool_true;
- }
- /* implementations of all internal functions */
- static sc_boolean constOnlyInternalScope_check_ConstOnlyInternalScope_main_region_A_tr0_tr0(const ConstOnlyInternalScope* handle)
- {
- return ((handle->iface.e_raised) && (handle->iface.e_value == CONSTONLYINTERNALSCOPE_CONSTONLYINTERNALSCOPEINTERNAL_B)) ? bool_true : bool_false;
- }
- static sc_boolean constOnlyInternalScope_check_ConstOnlyInternalScope_main_region_A_tr1_tr1(const ConstOnlyInternalScope* handle)
- {
- return ((handle->iface.e_raised) && (handle->iface.e_value == CONSTONLYINTERNALSCOPE_CONSTONLYINTERNALSCOPEINTERNAL_C)) ? bool_true : bool_false;
- }
- static void constOnlyInternalScope_effect_ConstOnlyInternalScope_main_region_A_tr0(ConstOnlyInternalScope* handle)
- {
- constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_A(handle);
- constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_B_default(handle);
- }
- static void constOnlyInternalScope_effect_ConstOnlyInternalScope_main_region_A_tr1(ConstOnlyInternalScope* handle)
- {
- constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_A(handle);
- constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_C_default(handle);
- }
- /* 'default' enter sequence for state A */
- static void constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_A_default(ConstOnlyInternalScope* handle)
- {
- /* 'default' enter sequence for state A */
- handle->stateConfVector[0] = ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_A;
- handle->stateConfVectorPosition = 0;
- }
- /* 'default' enter sequence for state B */
- static void constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_B_default(ConstOnlyInternalScope* handle)
- {
- /* 'default' enter sequence for state B */
- handle->stateConfVector[0] = ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_B;
- handle->stateConfVectorPosition = 0;
- }
- /* 'default' enter sequence for state C */
- static void constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_C_default(ConstOnlyInternalScope* handle)
- {
- /* 'default' enter sequence for state C */
- handle->stateConfVector[0] = ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_C;
- handle->stateConfVectorPosition = 0;
- }
- /* 'default' enter sequence for region main region */
- static void constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_default(ConstOnlyInternalScope* handle)
- {
- /* 'default' enter sequence for region main region */
- constOnlyInternalScope_react_ConstOnlyInternalScope_main_region__entry_Default(handle);
- }
- /* Default exit sequence for state A */
- static void constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_A(ConstOnlyInternalScope* handle)
- {
- /* Default exit sequence for state A */
- handle->stateConfVector[0] = ConstOnlyInternalScope_last_state;
- handle->stateConfVectorPosition = 0;
- }
- /* Default exit sequence for state B */
- static void constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_B(ConstOnlyInternalScope* handle)
- {
- /* Default exit sequence for state B */
- handle->stateConfVector[0] = ConstOnlyInternalScope_last_state;
- handle->stateConfVectorPosition = 0;
- }
- /* Default exit sequence for state C */
- static void constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_C(ConstOnlyInternalScope* handle)
- {
- /* Default exit sequence for state C */
- handle->stateConfVector[0] = ConstOnlyInternalScope_last_state;
- handle->stateConfVectorPosition = 0;
- }
- /* Default exit sequence for region main region */
- static void constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region(ConstOnlyInternalScope* handle)
- {
- /* Default exit sequence for region main region */
- /* Handle exit of all possible states (of declarations.ConstOnlyInternalScope.main_region) at position 0... */
- switch(handle->stateConfVector[ 0 ])
- {
- case ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_A :
- {
- constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_A(handle);
- break;
- }
- case ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_B :
- {
- constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_B(handle);
- break;
- }
- case ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_C :
- {
- constOnlyInternalScope_exseq_ConstOnlyInternalScope_main_region_C(handle);
- break;
- }
- default: break;
- }
- }
- /* The reactions of state A. */
- static void constOnlyInternalScope_react_ConstOnlyInternalScope_main_region_A(ConstOnlyInternalScope* handle)
- {
- /* The reactions of state A. */
- if (constOnlyInternalScope_check_ConstOnlyInternalScope_main_region_A_tr0_tr0(handle) == bool_true)
- {
- constOnlyInternalScope_effect_ConstOnlyInternalScope_main_region_A_tr0(handle);
- } else
- {
- if (constOnlyInternalScope_check_ConstOnlyInternalScope_main_region_A_tr1_tr1(handle) == bool_true)
- {
- constOnlyInternalScope_effect_ConstOnlyInternalScope_main_region_A_tr1(handle);
- }
- }
- }
- /* The reactions of state B. */
- static void constOnlyInternalScope_react_ConstOnlyInternalScope_main_region_B(ConstOnlyInternalScope* handle)
- {
- /* The reactions of state B. */
- }
- /* The reactions of state C. */
- static void constOnlyInternalScope_react_ConstOnlyInternalScope_main_region_C(ConstOnlyInternalScope* handle)
- {
- /* The reactions of state C. */
- }
- /* Default react sequence for initial entry */
- static void constOnlyInternalScope_react_ConstOnlyInternalScope_main_region__entry_Default(ConstOnlyInternalScope* handle)
- {
- /* Default react sequence for initial entry */
- constOnlyInternalScope_enseq_ConstOnlyInternalScope_main_region_A_default(handle);
- }
|