コード例 #1
0
ファイル: subprograms.c プロジェクト: ramses-project/ramses
void test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl(
	SAMPLING_PORT_ID_TYPE *  cnx_p_out)
{
  RETURN_CODE_TYPE test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_the_proc1_the_sender_runtime_call_ret;
  common_pkg__Integer test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_p_out_localVariable;
  MESSAGE_SIZE_TYPE test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_p_out_Length = sizeof(common_pkg__Integer);
  test_sampling_refined_model__the_proc1_the_sender_behaviorIdentifier_enum whichPortActivated = test_sampling_refined_model__the_proc1_the_sender_behaviorIdentifier_enum_default_behavior;
while(1)
{
  switch(the_proc1_the_sender_entrypoint_impl_current_state)
  {
    case test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_BA_entrypoint_init_state:
    // Transition id: which_behavior_default_mode
    if(1) // no execution condition
    {
      the_proc1_the_sender_entrypoint_impl_current_state = test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_BA_entrypoint_exec_state;
      whichPortActivated = test_sampling_refined_model__the_proc1_the_sender_behaviorIdentifier_enum_default_behavior;
      break;
    }
    case test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_BA_entrypoint_wait_dispatch_state:
    // Transition id: dispatch_transition
    if(1) // no execution condition
    {
      the_proc1_the_sender_entrypoint_impl_current_state = test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_BA_entrypoint_exec_state;
      PERIODIC_WAIT (&test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_the_proc1_the_sender_runtime_call_ret);
      break;
    }
    case test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_BA_entrypoint_exec_state:
    // Transition id: call -- Priority 0
    if(whichPortActivated == test_sampling_refined_model__the_proc1_the_sender_behaviorIdentifier_enum_default_behavior)
    {
      the_proc1_the_sender_entrypoint_impl_current_state = test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_BA_entrypoint_wait_dispatch_state;
      send (&test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_p_out_localVariable);
      WRITE_SAMPLING_MESSAGE ((*cnx_p_out), &test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_p_out_localVariable, test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_p_out_Length, &test_sampling_refined_model__the_proc1_the_sender_entrypoint_impl_the_proc1_the_sender_runtime_call_ret);
      break;
    }
  }
}
}
コード例 #2
0
ファイル: activity.c プロジェクト: UPD-RTS/TiCOS
void* thr1_1_job ()
{
	RETURN_CODE_TYPE ret;
	unsigned char val1 = 1;
	SS_0_msg = &val1;
	SS_0_msg_size = sizeof(unsigned char);


	while (1)
	{
		printf("Partition n. 1 - Thread n.1\n");

		/***************************************************************/
		/* Message processing code should be placed here               */
		/***************************************************************/

		WRITE_SAMPLING_MESSAGE (SS_0_id, SS_0_msg, SS_0_msg_size, &(ret));
		printf("  WRITTEN message 0x%x  to port 1, size: %d, ret: %d\n", ((unsigned char *)SS_0_msg)[0], SS_0_msg_size, ret);

		PERIODIC_WAIT (&(ret));
	}
}
コード例 #3
0
ファイル: subprograms.c プロジェクト: ramses-project/ramses
void PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl(
	BLACKBOARD_ID_TYPE *  delayed_PongIn,
	SAMPLING_PORT_ID_TYPE *  PortCnx6_PingOut,
	SAMPLING_PORT_ID_TYPE *  PortCnx8_badSequenceNumber,
	SAMPLING_PORT_ID_TYPE *  mode_aadlKeywords,
	SEQ *  seqNb,
	PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_currentState *  Parent_BA_currentState_Access,
	Base_Types__Integer_16 *  PingOut_freshnessIndicator_access)
{
  PingPongMessage PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_delayed_PongIn_localVariable;
  MESSAGE_SIZE_TYPE PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_delayed_PongIn_Length = sizeof(PingPongMessage);
  PingPong_refined_model__PingPongMessage_freshness_t_impl PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_PingOut_localVariable;
  MESSAGE_SIZE_TYPE PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_PingOut_Length = sizeof(PingPong_refined_model__PingPongMessage_freshness_t_impl);
  Exception PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_badSequenceNumber_localVariable;
  MESSAGE_SIZE_TYPE PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_badSequenceNumber_Length = sizeof(Exception);
  ROLE PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_mode_aadlKeywords_localVariable;
  MESSAGE_SIZE_TYPE PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_mode_aadlKeywords_Length = sizeof(ROLE);
  RETURN_CODE_TYPE PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_delayed_PongIn_ErrorCode = 0;
  RETURN_CODE_TYPE PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_mode_aadlKeywords_ErrorCode = 0;
  VALIDITY_TYPE PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_mode_aadlKeywords_Validity;
  SYSTEM_TIME_TYPE PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_delayed_PongIn_TimeOut = 0;
  RETURN_CODE_TYPE PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_S2_inst_IPingOrPong_Cping_ping_runtime_call_ret;
  PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_behaviorIdentifier_enum whichPortActivated = PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_behaviorIdentifier_enum_default_behavior;
while(1)
{
  switch(S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_current_state)
  {
    case PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_BA_entrypoint_init_state:
    // Transition id: which_behavior_default_mode
    if(1) // no execution condition
    {
      S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_current_state = PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_BA_entrypoint_exec_state;
      whichPortActivated = PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_behaviorIdentifier_enum_default_behavior;
      break;
    }
    case PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_BA_entrypoint_wait_dispatch_state:
    // Transition id: dispatch_transition
    if(1) // no execution condition
    {
      S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_current_state = PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_BA_entrypoint_exec_state;
      PERIODIC_WAIT (&PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_S2_inst_IPingOrPong_Cping_ping_runtime_call_ret);
      break;
    }
    case PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_BA_entrypoint_exec_state:
    // Transition id: behavior_specification_1 -- Priority 0
    if(whichPortActivated == PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_behaviorIdentifier_enum_default_behavior)
    {
      S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_current_state = PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_BA_entrypoint_wait_dispatch_state;
      if ((*Parent_BA_currentState_Access) == PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_currentState_switch) {
      READ_BLACKBOARD ((*delayed_PongIn), PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_delayed_PongIn_TimeOut, &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_delayed_PongIn_localVariable, &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_delayed_PongIn_Length, &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_S2_inst_IPingOrPong_Cping_ping_runtime_call_ret);
      READ_SAMPLING_MESSAGE ((*mode_aadlKeywords), &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_mode_aadlKeywords_localVariable, PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_mode_aadlKeywords_Length, &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_mode_aadlKeywords_Validity, &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_S2_inst_IPingOrPong_Cping_ping_runtime_call_ret);
      if (PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_mode_aadlKeywords_localVariable == E_ROLE_CPING) {
      IPingOrPong_Cping_ping (&PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_delayed_PongIn_localVariable, &(PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_PingOut_localVariable.pvalue), &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_badSequenceNumber_localVariable, seqNb, seqNb);
      }
      PingOut_freshnessIndicator_access = PingOut_freshnessIndicator_access + 1;
      PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_PingOut_localVariable.fresh_ba = PingOut_freshnessIndicator_access;
      (*Parent_BA_currentState_Access) = PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_currentState_switch;
      WRITE_SAMPLING_MESSAGE ((*PortCnx6_PingOut), &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_PingOut_localVariable, PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_PingOut_Length, &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_S2_inst_IPingOrPong_Cping_ping_runtime_call_ret);
      WRITE_SAMPLING_MESSAGE ((*PortCnx8_badSequenceNumber), &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_badSequenceNumber_localVariable, PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_badSequenceNumber_Length, &PingPong_refined_model__S2_inst_IPingOrPong_Cping_ping_entrypoint_impl_S2_inst_IPingOrPong_Cping_ping_runtime_call_ret);
      }
      break;
    }
  }
}
}