Tuesday, September 21, 2021

Vector Davinci Developer - Application and RTE

Davinci Developer Concepts

  • Methodology, Architecture and General aspects
  • AUTOSAR Datatypes
  • Software Components
  • Ports
  • Internal Behavior
  • RTE
  • Software component implementation
========================================================================================================================================

Figure: AUTOSAR project process methodology


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

AUTOSAR Datatypes

Autosar defines the data in different abstraction level such as VFB level, RTE and Base type level. The AUTOSAR standard defines an approach to AUTOSAR data types in which base data types are mapped to implementation data types and application data types. Application and implementation data types separate application-level physical attributes, such as real-world range of values, data structure, and physical semantics, from implementation-level attributes, such as stored-integer minimum and maximum and specification of a primitive type (for example, integer, Boolean, or real)

Application datatypes (Boolean, Value, String, Array, Record, Characteristic Table, Axis): this type data we can see in the AUTOSAR SWC implementation level. In the ADT, we can see physical unit, Compu Method for datatype derivation and it describes the conversion relationship of data from the physical (value) range to the internal digital level.

Implementation data type (Boolean, Value, String, Array, Record) : Describe data from the perspective of code implementation 
ex: typedef boolean BGI1P_DrvrDrOpnSts;

Base datatype (Platform level and standard level) or Primitive Datatypes

Datatypes link: AUTOSAR Datatypes




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

Software Components:

Link from autosar.org:  RTE SRS


Davinci Developer:


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

Communication Ports:

Application SWCs are communicated using ports. Each port has Portinterface depends on the what type of data to be carried between SWCs.
Classification of Ports:
  • Sender-Receiver Port
  • Client-Server port
  • Parameter port
  • NV Data Port
  • Mode Switch Port
  • Trigger Port





Figure: Port prototypes

Port Interfaces Specify the static structure of the exchanged information where as the dynamic that are relevant for communication are attached to port prototypes as communication Spec. (ComSpec, RPortComSpec, PPortComSpec).


  • Sender-Receiver Port contains the Sender-Receiver Port Interface : S-R communication has implicit communication or Explicit communication.
    • In the Queued communication, Sender Port can access as Send and ACK only. if access as Receiver port then Polling (Receiver) and waiting (Receiver with wait point). This reference provide in the Port "Access points"
    • Non-Queued communication, Sender port can access as explicit (Write) , Implicit (IWrite) and Ack only, If access as Receiver Port explicit by argument(Read), explicit by value (DRead), implicit read(IRead)
  • Client-sever Ports has Synchronous and Asynchronous communication
    • Synchronous Client-sever communication: for runnable entities that invoke a "Clientserveroperation" synchronously, SynchronousServerCallPoint must be defined. synchronous calls are blocking calls, meaning that they only return after the operation has been finished.
    • Asynchronous Client-sever communication: for runnable entities that invoke a "ClientServerOperation" asynchronously , two access points must be defined: AsynchronousServerCallPoint and AsynchronousServerCallResultPoint. asynchronous calls are non-blocking calls, meaning that they call immediately returns even if the actual operation has not yet concluded. 
  • Ports such as Parameter port, NV Data Port, Mode Switch Port and Trigger Port has its respective Port Interfaces such as ParameterInterface, NvDataInterface, ModeSwitchInterface, TriggerInterface
S/R Implicit communication: In Implicit communication, sender and Receiver communicate through local buffer. Buffer in AUTOSAR term called as VDP (Variable data prototype). In Tool side called as "Data Element"



APIs:
Rte_IRead_<r>_<p>_<d>: The function Rte_IRead_<r>_<p>_<d>() supplies the value of the data element, stored in a buffer before starting of the runnable entity. This API can be used for buffered (implicit) read of S/R data with isQueued=false.
Rte_IWrite_<r>_<p>_<d>: The function Rte_IWrite_<r>_<p>_<d>() can be used for buffered transmission of S/R data with isQueued=false.

symbols: <r> --> component name, <p> --> Port prototype, 
<d>--> DataElement.

S/R Explicit communication: In Explicit communication, sender and receiver communicate through global buffer. Sender updated the data in global buffer and receiver is received data from global buffer.


APIs:
Rte_Read_<p>_<d>: The function Rte_Read_<p>_<d>() supplies the current value of the data element. This API can be used for explicit read of S/R data with isQueued=false. After startup Rte_Read provides the initial value.
Rte_DRead_<p>_<d>: The function Rte_DRead_<p>_<d>() supplies the current value of the data element. This API can be used for explicit read of S/R data with isQueued=false. After startup or if the receiver port is unconnected, Rte_DRead provides the initial value.
Rte_Write_<p>_<d>: The function Rte_Write_<p>_<d>() can be used for explicit transmission of S/R data with isQueued=false.
Rte_Receive_<p>_<d>: The function Rte_Receive_<p>_<d>() supplies the oldest value stored in the reception queue of the data element. This API can be used for explicit read of S/R data with isQueued=true.
Rte_Send_<p>_<d>: The function Rte_Send_<p>_<d>() can be used for explicit transmission of S/R data with isQueued=true.

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

Internal Behavior (SwcInternalBehavior): 

SWC not only provide the ports for communication that contains the "internal behavior" which means it provide the some sort of functionality. functionality implemented using Runnable Entity.

SwcInternalBehavior consists of following parts:
  • Runnable Entity: functionality of an atomic SWC is implemented in the form of Runnable entities. In general term called as "Runnable"
  • Runnable Access points: A runnable can access the ports of the SWC.
    • DataSendPoint (SendData(queue))
    • DataReceivePoint(ReceiveData(queue))
    • DataWriteAccess (Write Data(Non-queue))
    • DataReadAccess (Read Data(Non-queue))
    • SynchronousServerCallPoint (Invoke Operation)
    • AsynchronousServerCallPoint (Invoke Operation)
    • Mode (Send Mode switches, Read Receive Mode, Read Sent Mode)
    • Trigger (Internal triggering point or raise on external Trigger)
  • Runnable Events (Triggers) : An event can either trigger a runnable or wake up a wait point.
    • Timing Event (Init, Background, Periodic)
    • DataReceivedEvent (on data Reception)
    • DataReceivedErrorEvent (on data Reception error)
    • DataSendCompletedEvent (on Data Send Completion)
    • OperationInvokedEvent
    • AsynchronousServerCallReturnsEvent
    • ModeSwitchEvent (On Mode Entry, On Mode Exit, On Mode transition, On Mode switch Acknowledgement)
    • Triggering Event - Internal Trigger or External Trigger


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

RTE (RuntimeEnvironment):


Runtime environment (RTE): acts as a middleware between the AUTOSAR application layer and the lower layers. Basically, the RTE layer manages the inter- and intra-ECU communication between application layer components as well as between the BSW and the application layer





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

Software component implementation

  • Create Port Interface
  • Create SWC
  • Create port - Application and service ports
  • Create Runnable
  • Access ports in the Runnable
  • Provide Trigger access to Runnable
  • Connect the ports - Assembly Connector and Delegation connector
  • Assign Runnable to OS-tasks
  • Generate SWC Template
  • Generate RTE code

  • Create Port Interface
Go to Davinci Developer object browser window Right click on  "Application Port Interfaces" --> select the required Port Interface as shown below 
if we select S-R Interface 
step1: Provide the name of the interface in the "Properties tab"
step2:  Go to DataElementPrototype tab  and the create data element (VDP) and provide the VDP details such as name, datatype and used queue communication
if we select C-S Interface
step1: Provide the name of the interface in the "Properties tab" and add Application error 
step2: Go to Operation prototype tab, go to edit provide the operation name and Argument details like name, direction and ImplPolicy.

if we select Calibration Interface
step1: Provide the name of the interface in the "Properties tab"
step2: Go to CalibrationElementPrototype tab and the create data element (VDP) and provide the VDP details such as name, datatype and Addressing Method

if we select Mode Interface
step1: Provide the name of the interface in the "Properties tab"
step2: Go to ModeDeclartionGroupPrototype tab and the create data element (VDP) and provide Mode declaration group reference (Note: create Mode groups before using in the Interface)


NV-data Interface and Trigger Interface same as S-R Interface


  • Create SWC
Go to Composition component --> Right click on the composition select new component 

step1: Provide the Prototype name
step2: click the component Type and go to component selection tab click atomic select the component type like application, Sensor-Actuator, select implementation code type as Source code and click Ok


  • Create port - Application and service ports

Application Ports:

Right click on SWC --> select the Required Port Prototype --> select the Interface --> Provide the Port name --> select the symbol name --> click ok

Note: symbol name is important because it is used for RTE code generation


Service ports: Double click on the SWC --> Go to ports --> select service ports

  • Create Runnable
Go to Runnable ->select new and create Runnable like Init runnable, runnable, server runnable

  • Access ports in the Runnable


  • Provide Trigger access to Runnable
Click the Runnable, Go to triggers and select Trigger according to your requirement


  • Connect the ports - Assembly Connector and Delegation connector
    • Assembly Connector : Assembly Connectors are used when communication needs to be taken place between SWCs within Composition SWC. These connectors connect the ports of SWCs that needs to be connected.
    • Delegation connector: A delegation connector is a connector that links the external contract of a component (as specified by its Ports) to the internal realization of that behavior by the component's parts
Note:

  • Delegation connector provides the outer port communication between two composition. 
  • Here two composition connected through Assembly connector but delegation create the outer port to the composition.
  • In your system many compositions are present then we can realize that otherwise we can see only com signal ports are accessed as delegation ports.






Activities such as  
Assign Runnable to OS-tasks, Generate SWC Template, Generate RTE code are done through Davinci Configurator Pro.

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

Final Note: 
  • On the system level, the OEM designs the Software components, their connections, Hardware topology, network communication. Etc. OEMs are using Vector PREEvision tool for system design.
  • with the system configuration description, the OEM export a subset for each ECU. this is called ECUC.arxml. This ECU Extract is an important input for the development of the ECU functionality by the tier-1 and used to configure the BSW, OS and RTE, resulting in the "ECU Configuration Description" 
  • AUTOSAR tools for system and Application Configuration
    • Vector Davinci Developer
    • Mentor VSA
    • dSPACE SystemDesk
  • Tools for Basic-software, OS and RTE configuration are
    • Vector Davinci Configurator Pro
    • EB Tresos Studio
    • Mentor VSB (VSX)






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

No comments:

Post a Comment