AUTOSAR學習之RTE - 基本概念


1.什么是RTE?

 

The Run-Time Environment (RTE) is at the heart of the AUTOSAR ECU architecture. The RTE is the realization (for a particular ECU) of the interfaces of the AUTOSAR Virtual Function Bus (VFB). 

RTE是AUTOSAR中VFB的接口實現。 

The RTE provides the infrastructure services that enable communication to occur between AUTOSAR software-components as well as acting as the means by which AUTOSAR software-components access basic software modules including the OS and communication service. 

RTE提供基礎的通信服務,支持軟件組件間和軟件組件間到基礎軟件模塊的通信。 

The RTE encompasses both the variable elements of the system infrastructure that arise from the different mappings of components to ECUs as well as standardized RTE services. 

RTE提供了構件到ECU異構信息的配置從而使得RTE服務標准化。 

The RTE is generated for each ECU to ensure that the RTE is optimal for the ECU. 

RTE是特定的對於每個ECU生成的。

 

2.RTE概念

 RTE對象:

 

對象間的關系:

1. 通訊關系圖:

 2. 並發關系圖:

 

AUTOSAR software-components have no direct access to the OS and hence there are no "tasks" in an AUTOSAR application. Instead, concurrent activity within AUTOSAR is based around runnable entities within components that are invoked by the RTE.(P31) 

AUTOSAR軟件組件不能直接訪問操作系統,所以在AUTOSAR應用程序中沒有 "task" 的概念,取而代之的是被RTE所管理的構件運行體(runnable)。

The AUTOSAR VFB specification [13] defines a runnable entity as a "sequence of instructions that can be started by the Run-Time Environment". A component provides one2 or more runnable entities [RTE00031] and each runnable entity has exactly one entry point. An entry point defines the symbol within the software-component's code that provides the implementation of a runnable entity. 

每個軟件組件都有一個或多個運行體(runnable),但每個運行體只有一個入口。

The RTE is responsible for invoking runnable entities – AUTOSAR software-components are not able to (dynamically) create private threads of control. Hence, all activity within an AUTOSAR application is initiated by the triggering of runnable entities by the RTE as a result of RTEEvents. 

因為AUTOSAR軟件組件沒有能力動態創建線程,所以由RTE負責調入運行體(runnable)。正因為這樣,AUTOSAR所有軟件活動都是由RTEEvents引起的。

An RTEEvent encompasses all possible situations that can trigger execution of a runnable entity by the RTE. 

RTEEvents 試圖把所有可能觸發任務的事件都包含進來。[The different classes of RTEEvent are defined in Section 5.7.5.]

The RTE supports runnable entities in any component that has an AUTOSAR interface - this includes AUTOSAR software-components and basic software modules. 

RTE支持所有含有AUTOSAR接口的運行體,不僅有SWC,還包括了BSW。 

Runnable entities are divided into multiple categories with each catgory supporting different facilities. 

運行體被分為不同的類別,以便支持不同的設備。[The categories supported by the RTE are described in Section 4.2.2.2.]

 

3.RTE生成過程

RTE生成的主要過程是:創建與操作系統系統功能相適應的AUTOSAR軟件構件API,並管理軟件構件間的通信。 

這些生成的代碼在運行時: 

(1)為軟件構件分配所需的系統資源,如消息號、任務運行環境等 

(2)負責具體執行軟件構件間通過端口進行的通信 

(3)根據軟件構件描述中的信息,在適當時刻為軟件構件提供事件或調度。 

RTE生成包含兩個階段:(1)定義階段(RTE Contract phase)(2)生成階段(RTE Generation phase)。 

在(1)定義階段中,將軟件構件和RTE交互描述信息定義為頭文件,作為軟件構件與RTE的契約,雙方都使用相同數據結構進行編程。在此階段,需要完成的工作是: 

l 軟件構件類型描述 

l 構件內部行為描述 

l 真實源代碼或目標代碼及其API(頭文件)生成 

l 實現語言描述 

 

從上圖中可以清晰的看到,其實定義階段就是掃描一下InternalBehavior這個xml的標簽( ),然后生成它的頭文件。

 

Internal Behavior中可以包含的內容如下:

 

在(2)生成階段中,將所有軟件構件、相關系統和ECU信息聯合起來,為每一個ECU生成一個RTE。 

 

由上圖可以看出,生成階段之前要先收集ECU配置信息,然后進行配置,可配置的內容有: 

So first the 'RTE Configuration Editor' needs to collect all the information needed to establish an operational RTE. This gathering includes information on the SW-Component instances and their communication relationships, the Runnable Entities and the involved RTE-Events and so on. The main source for all this information is the 'ECU Configuration Description', which might provide references to further descriptions like the SW-Component description or the System Configuration description. 

SWC的接口和它們的通信關系。 

運行體和它們的RTE-Events。

 

One extremely important point is the mapping of application signals from SW-Component's ports to COM signals. A mapping of the application signals to system signals has already been defined by the 'System Configuration Generator' .

還有一個極端重要的內容就是把SWC的端口映射成為COM的信號。映射的規則已經被系統配置生成器( )所描述。

The generated RTE interacts with AUTOSAR COM and OS. For the latter, the RTE both uses OS objects already in existance (e.g. tasks for which the RTE generator builds bodies) as well as requires new objects (e.g. a schedule table or periodic alarms for periodic runnable entities). 

The coordination of configuration information between the OS and RTE is therefore key since both the RTE and OS have to agree upon the set of OS objects. 

RTE生成器使用COM和操作系統已有的對象(如:task),同時也創建自己的新對象(如調度表和周期時鍾)。但是如果一個對象OS已經提供,RTE就必須使用。

The AUTOSAR OS is configured in the ECU Configuration Description. The RTE configurator/generator needs to communicate its needs to the OS and therefore it seems sensible to use the same format order to allow the communication of the set of OS object required by the generated RTE. 

AUTOSAR OS被ECU配置描述文件所配置。

The specification of the OS objects used by the generated RTE, henceforth termed OsNeeds, can be done either at configuration time only or at a mixture of configuration and generation time, depending on which approach is supported by the configuration and generation tools of RTE and OS. Thus according to figure 3.4 the output information OsNeeds can be alternatively provided by the RTE Configuration Editor or the RTE Generator. 

如果是操作系統特別需要的對象,就標記上OsNeed。如下圖所示:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM