AUTOSAR Multi-Core

多核架构-基于AUTOSAR 4.3

AUTOSAR 4.3中定义了如下多核架构,基于这份架构,Application SWC 可以按照需求分到不同的核上,但是可以看到绝大多数的BSW Module 都在一个核上,部分BSW Module会在两个核上都存在实例。
AUTOSAR Multi-CoreRte横跨多核之间,为SWC与BSW Module之间提供Mapping。这个Mapping分为两种,一种是这个BSW Module提供了在对应核上的Satellite时,另一种是没有Staellite,如下图:
在这里插入图片描述

基本概念介绍

AUTOSAR描述了关于跨核/Partition调用服务的三种方式,一种就是直接,通过RPC(Remote Procee Call),这种方式下Rte可能会替你生成一系列的保护措施,比如SpinLock;第二种就是BSW Satellite,第三种就是Proxy,他主要是通过将直接的跨核C/S调用转成了资源消耗更少的S/R接口调用,如下图:
BSW Satellites and Proxies
RPC没有固定的机制,如上述提到的SpinLock就是其中一种,但是无论哪种机制,其为了解决数据一致性所带来的额外开销都是比较大的。所以Proxy以及Statellite机制的目的就是为了提高在所有的核上对BSW Module的基本服务的高效的访问。
也就是说,利用Proxy或者Satellite机制之后,你就不需要像以前为了性能考虑而将需要使用特定BSW Module的服务的SWC,一定与这个BSW Module放在一个核,为设计带来了灵活性。当然,即使是使用了Proxy或者Satellite,仍然会有一定的资源开销,但是这相比与直接的RPC来说,都微乎其微。

Satellite

A BSW satellite is a part of a BSW service module. The idea is that the satellite offers services core-local, which means that it is executed on the same core as the accessing application SWC. The functional scope of satellites ranges from full copies of the service to very basic functionality. Common for all satellites is, that they exchange data and/or control flow with the (Master) BSW service module. Given the fact that the BSW service module can implement a tailored communication path that optimally suits to its communication needs, communication is more efficient compared to the universal path via the Rte (i.e. the RPC mechanism)

使用Satellite在多核中主要有如下两个好处:

1. (improved efficiency)RTE不再需要生成RPC机制;
2. 因为Statellite也是BSW Module的一部分,他承担了一部分的工作,很显然这会带来性能提升,因为调用方所在的核也会执行一部分的任务,即分担了主核的一些工作。

AUTOSAR WdgM, Dem, EcuM, Det 都提供了Satellite机制。

Proxy

A proxy translates the services of a BSW service module to a different interface type. The idea is to substitute the execution time expensive cross-core Client/Server operations with more lightweight Sender/Receiver Port Interfaces. Hence, whenever a SWC uses a service, it merely reads or writes data in shared RAM (Rte) instead of triggering a RPC.

简单说,Proxy就是用更轻量级的S/R接口取代了耗时的跨核的C/S调用(很显然,跨核C/S直接调用,调用方要等被调用方执行完成),最终实际的操作肯定还是C/S函数,但是这已经由原来的跨核变成了同一个核内由Proxy去直接调用BSW服务(参考上图),显然更好。
比较常见的有Com-Proxy和NVM-Proxy,其中Com-Proxy的Tx要注意要放到Com_MainFunctionTx之前:

Rte_ComSendSignalProxyPeriodic();/* Com Tx Proxy */
Com_MainFunctionTx();

术语

Core Types
多核架构中有Master Core和Slave Core之分,这是针对处理器而言的,如Tc27x系列,Core0是主核,但是AUTOSAR又有个概念叫做BSW Core,即绝大多数的BSW 模块都Mapping在BSW Core上。BSW Core可以是Master Core也可以是其他的Slave Core之一。
Partition
AUTOSAR中,Partition指的是一组SWC,BSW Module(Satellite),Task的合集,具体体现就是某个OS Application。Partition有等级划分,从QM到ASILD,对应MPU的第几个Set。需要注意一点,OS Application也有Trusted和Non-Trusted之分,但是这根ASIL等级无关,QM的Partition也可以是Trusted的。
在这里插入图片描述

多核启动和下电

启动

下电

发布了24 篇原创文章 · 获赞 15 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/ck1n9/article/details/104446244