Thursday, December 23, 2021

RTEEvent

In this article, we will discuss about following topics
  • What is Runnable Entity or what is Runnable?
  • Runnable Entity categories supported by the RTE
  • What is RTE Events?
  • Different types of RTE Events according RTE communication
  • Usage of each RTE Events
========================================================================================================
Reader Note: Application  SWC(Software Component) contains the Ports, Runnable, Access-points, Service needs,  Exclusive Area, InterRunnableVariable and PerInstanceMemory. these parameter creation and settings are called as "SWC Internal behavior". 
Runnable used concepts: RTEEvents and Port access (Access point) 
========================================================================================================

What is Runnable Entity?

RunnableEntities are the smallest code fragments that are provided by a software-component. 
As per C-language or simple terms
  • RunnableEntities : C-functions in the source file
  • Software-Component: Source file  (Each SWC as one .c file in AUTOSAR domain)
Below diagram explains the concept of Runnable Entity and SWC
  • conv.c file is the SWC, Run_ConvertionAlg() is the Runnable Entity and Rte_Read_xx is the Rte call.


Some important points:
  • Runnable Entity shortly called as "Runnable"
  • Each AUTOSAR SW-C is composed by one or more runnables/runnable entities. it means that one source file may contain many functions.
  • Runnable Entities are the schedulable parts of SW-Cs. it means that runnables are scheduled by OS tasks.
  • CompositionSwComponentType cannot have RunnableEntities but Only AtomicSwComponentType can have RunnableEntities. Note: This point is difficult to understand here because Reader should know concept of Composition, Component and Internal behavior.  Refer article Link : AUTOSAR Application SWC


Runnable Entity categories supported by the RTE

The RTE shall support the Runnable Entity categories 1a, 1b and 2. these categories base on the communication and blocking state.




what is Implicit and explicit Read/write? this topic discussed in the RTE communication. refer link: SWC Communication
What is blocking behavior? who will block the runnable execution ?
Answer: A runnable can block and wait for RTEEvents by using waitpoints. Each waitpoint defines a timeout and the reference to the RTEEvent that is suppose to unblock the waitpoint.


 

RTE Events and its types

RTE Events are used to activate runnables or to unblock a waitpoint inside a runnable. this provides the mechanism that how to trigger a runnable or specify when to execute a runnable.
  • RTE Events are defined inside the SwcInternalBehavior of an AtomicSwComponentType.
  • All RunnableEntities are activated by the RTE as a result of an RTEEvent.  If RunnableEntity is not mapped to particular RTEEvent then the RunnableEntity is never activated by the RTE.


RTEEvents used in the context of sender/receiver communication

  • DataReceivedEvent
Purpose: A runnable entity triggered by the RTE to receive and process a signal received on a sender-receiver  interface. This Event indicates that data received on a Receiver port is ready for processing.
This event is enabled, when we create a SR(sender-receiver) port Interface with "Queue Communication" is set to True. Refer: Port and Internal Behavior

  • DataReceiveErrorEvent: This event raised for explicit SR communication.
    • Refer : [SWS_Rte_08405], [SWS_Rte_08407], [SWS_Rte_05030], [TPS_SWCT_01338]
    • DataReceiveErrorEvent  indicates error is detected in the Receive port of the SWC.
This event raised in the following scenarios 
  • In case of Inter-ECU communication or Intra-ECU communication where receiving software components requesting different values for the attribute handleInvalid and this attribute is set to keep for a particular R-Port, in case of reception of a data element invalid, the RTE shall raise a DataReceiveErrorEvent.
  • Signal-outdated: the RTE receives a signal-outdated notification from the COM layer when a monitored periodic signal is not received in time.
  • Signal invalid: The RTE receives a signal invalid notification from the COM layer when the COM layer detects that an incoming signal has the predefined ’invalid’ value.

  • DataSendCompletedEvent
A runnable entity triggered by the RTE to receive and process transmit acknowledgment notifications for explicit communication.

Refer: [SWS_Rte_08018], [SWS_Rte_08021], [SWS_Rte_08023], [SWS_Rte_01283], [SWS_Rte_01285], [TPS_SWCT_01336].

This RTEEvent occurs when the data has been successfully sent or when an error has occurred during sending. 
  • As a general rule, the acknowledgment events DataWriteCompletedEvent and  DataSendCompletedEvent shall be raised immediately after the sending to all receivers has been performed and in case of Inter-ECU communication all acknowledgments from COM or LdCom have been received.
  • Acknowledgement is enabled for a provided VariableDataPrototype by the existence of a TransmissionAcknowledgementRequest in the SenderComSpec.

  • DataWriteCompletedEvent: A runnable entity triggered by the RTE to receive and process transmit acknowledgment notifications for implicit communication.
Refer: [SWS_Rte_08043], [SWS_Rte_08044], [SWS_Rte_08022], [SWS_Rte_08045],  [TPS_SWCT_01557].

This RTEEvent occurs when the data has been successfully sent or when an error has occurred during sending. 

RTEEvents used in the context of client/server communication

  • OperationInvokedEvent
Refer: [SWS_Rte_07023], [TPS_SWCT_01225], [TPS_SWCT_01309]
An OperationInvokedEvent indicates that the client is invoking an operation on the server.
A software-component can define an OperationInvokedEvent for each operation inside one of the server PPortPrototypes.
  • AsynchronousServerCallReturnsEvent
Refer: [SWS_Rte_03764], [SWS_Rte_03765], [SWS_Rte_01298], [TPS_SWCT_01346]
The AsynchronousServerCallReturnsEvent shall indicate either that the transmission was successful or that the transmission was not successful.
If an AsynchronousServerCallReturnsEvent references a RunnableEntity and a required ClientServerOperation, the RunnableEntity shall be activated when the operation’s result is available or when a timeout was detected by the RTE.

Note:
SynchronousServerCallPointThis means that the RunnableEntity is supposed to perform a blocking wait for a response from the server.
AsynchronousServerCallPoint: An AsynchronousServerCallPoint is used for asynchronous invocation of a ClientServerOperation. (Non-blocking)
AsynchronousServerCallResultPoint: If a RunnableEntity owns a AsynchronousServerCallResultPoint it is entitled to get the result of the referenced AsynchronousServerCallPoint

RTEEvents used in the context of mode communication

  • SwcModeSwitchEvent
Refer: [TPS_SWCT_01378], 
This event is raised upon a received mode change. 
 An AtomicSwComponentType can define an SwcModeSwitchEvent to specify that a particular RunnableEntity shall be started whenever a mode is entered, exited, or a transition between two specified modes occurs. [Reader should Refer: AUTOSAR Mode Management].
Note: Reader should know following terms ModeDeclaration, Mode Manager, Mode user and 
ModeActivationKind (onEntry,  onExit,  onTransition).
The configuration of this RTEEvent Refers to one or two modes that trigger the event and one activation attribute to define whether the event activated onEntry, onExit, onTransition.
  • ModeSwitchedAckEvent
The event is raised when the referenced modes have been received or an error occurs.
In case of mode switch communication, the mode manager may specify a ModeSwitchedAckEvent
or BswModeSwitchedAckEvent to receive a notification from the RTE that the mode transition has been completed.
  • SwcModeManagerErrorEvent:  This represents the ability to react on errors occurring during mode handling.
[TPS_SWCT_01535] Mode manager reacts on mode error: If the mode manager is getting out of sync with a mode user (because the partition of the mode user has been terminated) or vice versa (because the partition of the mode manager has been terminated) it shall be possible for the mode manager to react on such an event.

RTEEvents for purposes other than communication

  • InitEvent : A runnable entity triggered by the RTE for initialization. 
    Refer: [SWS_Rte_06761], [SWS_Rte_06762]
    The RTE shall activate RunnableEntities triggered by an InitEvent once when Rte_Start is executed.
  • TimingEvent: Trigger a runnable entity periodically at a rate defined within the software-component description.
    Many RunnableEntities will need to run cyclically with a fixed rate.
    Refer: [SRS_Rte_00238], [TPS_SWCT_01519], [TPS_SWCT_01519]
  • BackgroundEvent: A recurring RTEEvent which is used to perform background activities.
    It is similar to a TimingEvent but has no fixed time period and is activated only with low priority.

  • ExternalTriggerOccurredEvent
    • The Runnable Entities of the software component are activated at the occurrence of the external event by the means of an ExternalTriggerOccurredEvent.
    • Reader should know about Trigger port and TriggerPortInterface. Refer: Port and PortInterfaces
    • For unconnected RPortPrototypes the associated ExternalTriggerOccurredEvents will never get fired
  • InternalTriggerOccurredEvent 
    • The event is raised when the referenced internal trigger have been occurred.
    • The call of the Rte_IrTrigger API shall activate all triggered runnables which InternalTriggerOccurredEvents are associated with the related InternalTriggeringPoint of the same software-component instance. It means that Inter-Runnable Mechanism used this RTEEvent. 
=====================================================================================================
Refer: 
Requirements on Runtime Environment
Specification of RTE Software
Software Component Template

Thanks for visiting the Post..!! 

======================================================================================================= 



1 comment: