Autosar OS IOC

IOC是一种操作系统内的通信方式,用于同一ECU上的跨应用通信。它支持1:1、N:1和N:M的无队列或有队列通信,确保数据一致性。RTE利用IOC服务进行通信,接收方可以通过回调函数被通知。IOC接口类似于RTE与软件组件之间的接口,每个通信操作具有独特的API。在多核系统中,IOC需要处理内存保护和非重入性问题。

背景和基本原理

The IOC implementation shall be part of the Operating System

IOC和操作系统紧密相关,是操作系统实现的一部分

The IOC is a third type of communication, in addition to
Intra OS-Application communication: Always handled within the RTE
Inter ECU communication: Already available via well defined interfaces to the
communication stack (COM)

IOC 是除了Intra OS-Application communication,Inter ECU communication之外的第三种通信方式

In systems with only one core, the IOC can be omitted completely, if just one OSApplication is available, or if no OS-Application uses memory protection
mechanisms

在单核系统中,如果只有一个OsApplicationn或者没有使用内存保护,那么可以把IOC模块去除。

General purpose

The IOC provides communication services which can be accessed by clients which
need to communicate across OS-Application boundaries on the same ECU

IOC提供同一个ECU上跨OSApplicatiion的通信服务。

The RTE uses IOC services to communicate across such boundaries. All
communication must be routed through the RTE on sender (or client) and on receiver
(or server) side

Direct access to IOC services by clients other than the RTE is currently not
supported, but possible, if the client (e.g. a CDD) provides a hand written or
generated IOC Configuration Description as specified and specific callback functions
if necessary. Only sender/receiver communication is supported however by the IOC

IOC通过RTE的sender/receiver来实现。

Software Components and/or BSW modules located in the same OS-Application
(and hence on the same core) should not communicate by invoking IOC services.
This would be less efficient than communication via RTE only. However, in case of
IOC supported N:1 communication, if not all of the senders and the receiver are in
the same OS-Application the IOC must be used

同一个OSApplication的模块不要通过IOC通信,效率较低。当然,如果不是所有的senders和receiver在同一个OSApplication内的情况除外。

The IOC has to guarantee data consistency in inter OS-Application and inter core
(Multi-Core systems) communication,

IOC要负责数据一致性。

IOC functionality

Communication

1:1, N:1 and N:M (unqueued only) communication are supported by the IOC

The IOC allows the transfer of one data item per atomic communication operation. A
data item can either be a value for atomic basic data types or a reference for
complex data structures. The data structure must be implemented as a single
memory block, however. This way the data item can be transmitted in one piece. The
IOC does not need to know the internal data structure. The basic memory address
and length (which can be calculated from the type of the data item) is sufficient. The
IOC does, e.g., not support a conversion of endianness between cores.

IOC 允许每一次原子通信操作传输一个数据,这个数据可以是原子数据类型,或者一个复杂数据结构的引用,这个数据结构必须是一个单独的内存块,每次传输的时候只需要知道内存块的地址和长度就行了。

Transferring more than one data item in one operation is also supported for 1:1
communication only. In this case several types and memory addresses have to be
used by the IOC function. The advantage compared to sequential IOC calls is that
mechanisms to open memory protection boundaries and to notify the receiver have
to be executed just once. Additionally, all data items are guaranteed to be consistent,
because they are transferred in one atomic operation

IOC只有在1:1的通信中才允许一个传输多个数据。这种通信方式可以降低额外的通信开销,也可以保证数据的一致性。

The IOC provides both, unqueued (Last-is-Best, data semantics) or queued (First-InFirst-Out, event semantics) communication operations. If present, the IOC internal
queue has a configurable length.

IOC提供了unqueued和queued两种通信操作。

Each atomic communication operation gets specified individually by its own
description block in a Configuration Description with regard to sender, receiver, data
type(s), notification, and queuing

每一个原子通信操作都有自己的配置。

Notification

The IOC optionally notifies the receiver as soon as the transferred data is available
for access on the receiver side, by calling a configured callback function which gets
provided by the user of the communication.

当传输的数据可用时,IOC调用配置的callback function来通知receciver。

A possible implementation is to trigger an interrupt (Cat. 2) mechanism to invoke the
callback function from the ISR on receiver side, or to use a microcontroller supplied
trap. The callback function shall be efficient and compact, because it is called from
within the ISR.

Notification 的实现方式可以在receiver侧通过二类中断触发callback function,或者通过微控制器提供的trap来实现方式。callback function应该是高效的,因为它是通过中断调用的。

IOC interface

The interface between RTE and IOC shall be similar to the interface between
Software Components and the RTE, i.e. by generating specific interfaces for each
communication operation instead of providing a generic API.

RTE和IOC的接口和RTE和SWC的接口类型。

There is a unique set of IOC service APIs (at least to send and receive data) for each
data communication specified in the IOC Configuration Description. Each service API
gets generated and can be identified by a unique Id for each data communication. In
case of N:1 communication, each sender must use its own API.

每组通信都必须要有自己的唯一的API。

The same IOC service API and hence the same 1:1 communication can get used by
more than one runnable inside the same SWC both on sender and on receiver side.
However, the IOC functions are not reentrant, because otherwise e.g. spinlock errors
could occur in case the IOC uses spinlocks in Multi-Core systems. The same IOC
API must therefore only be called sequentially. This is no problem, if all runnable
entities are scheduled within the same TASK, otherwise the caller is responsible to
guarantee that the same IOC API is not called again before it returns from a different
invocation

由于IOC函数是不可重入的,所以在多核系统中有可能会出现自旋锁错误。

Software Components may access the IOC only via RTE. Only the RTE decides
which communication services to use to support the communication needs of
Software Components.

SWC可能通过RTE来访问IOC。RTE决定为SWC使用哪种通信方式。

Direct access to IOC services by BSW modules is not supported, but allowed for
CDDs and other modules, if unavoidable. The clients have to provides a hand written
or generated IOC Configuration Description as specified

BSW直接访问IOC服务是不支持的,CDD和其他的模块是允许的,但是要手写IOC配置描述。

本节属于《跟朱老师学智能网联汽车开发系列课程》的第2季《智能网联汽车开发核心课程》第6部分的第3个课程,本课程主要讲解AutoSar的RTOS。首先围绕ISO17356-3标准文档,来逐行解读OSEKOS的诸多特性。包括任务状态和调度策略,优先级,抢占,资源优先级天花板机制,Counter和Alarm机制等。然后结合AutoSar官方文档来补充讲解AutoSarOS的补充特性,如调度表机制、MultiCore多核的支持、栈监控和OS-Application、4种保护机制等。学完本课程将对AutoSarOS有深度理解和掌握。 智能网联汽车未来十年最值得期待的风口。综合叠加了电动汽车替代传统燃油汽车、自动驾驶辅助甚至替代人工驾驶、传统汽车座舱升级智能座舱、整车和零部件乃至产业链的国产自主可控化等发展趋势。AI、IoT、云计算、大数据、芯片和半导体、操作系统、5G等国家重点发展的“硬科技”,都和智能网联汽车有很紧密的关系。所以除了传统车企外,涌现了“蔚小理”这样的造车新势力,引入了Tesla这样的鲶鱼,又吸引了华为、百度、大疆、小米这样的中国高科技以及互联网巨头。智能网联汽车相较于传统汽车来说,最大的变化是:整车的核心技术和竞争点从机械技术转向了计算机技术。所以从车企到tire1等汽车产业链上下游,都将注意力转向了“车载计算机及其相关技术”的研究和实践。域控制器、hypervisor、车载以太网、SOME/IP、DoIP、SOA、AGL和QNX、OTA、C-V2X、AutoSAR CP和AP、ROS、SLAM、激光雷达、超声波雷达、毫米波雷达、深度相机、传感器前融合后融合、ADAS、AR-HUD、智能驾驶算法、算力平台、英伟达Xavier和Orin、高通骁龙8155和Ride、华为MDC、地平线征程3和征程5、MobileEye EyeQ5、TI TDA4、 NXP S32G等等,以上列出了一些关心汽车行业的人经常会看到听到的“关键词”。这些都是实现智能网联汽车所需要的关键技术,也是汽车行业工作者形成行业竞争力,试图去理解和分析行业发展趋势的关键技术底蕴。但是客观上智能网联汽车涉及到的技术杂、学科多、内容深,而且本身这些技术都在快速发展演变,这就造成了学习困难、不成体系。这对于传统汽车行业的“老人”,以及有兴趣进入智能汽车行业的“新人”来说,都是很大的障碍和挑战,急需解决方案。本训练营及课程体系就是为解决这个问题。我们将通过系统化的课程,全面覆盖智能网联汽车的“车端”新技术(就是前段中列出的那些关键词),控制深度深入浅出的讲解相关原理和概念、分析相关技术发展趋势。最终目标是希望大家有一定深度的理解智能网联汽车的原理和相关技术,能从整体上认知智能网联汽车这个产品,具备行业趋势的分析研判能力,具备行业上下游之间或者模块与模块之间的沟通能力,帮助大家在智能网联汽车获取核心竞争力,助力个人发展。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值