SWC步骤

阅读: 评论:0

SWC步骤

SWC步骤

纲要:

SWC属于AUTOSAR的Component文件夹下,而Composition属于Composition文件夹下。

目录

1. Import "Data Type" and "Interface" information

2. Creat Software Component(SWC)

3. Create "Port" for this SWC

4. Add "Internal Behavior" for this SWC


1. Import "Data Type" and "Interface" information

Copy the "01_TypesAndInterface.arxml" file into the project, which contains

  • Interface
    • Data Element
  • Application data type
  • Implementation Data Type

which will be used in the "SWC creation". [0][0.1]

2. Creat Software Component(SWC)

Right click on the project, create "Component - Element/Sensor Actuator Sw Component Type". Then name the SWC, which will create "02_WiperControl_100us.arxml" file to save the SWC information.

3. Create "Port" for this SWC

Right click on the "02_WiperControl_100us.arxml" file and Open with “Component Editor", there will be option to create Pport/Rport. And also which Interface to be added under the port.[0.2](Interface is defined under 01_TypesAndInterface.arxml

4. Add "Internal Behavior" for this SWC

  • Runnable Entity(RE) [1]
    • DataAccessPoint: DataReadAccess/DataWriteAccess [2][2.1]        
    • Timing Event[3]
  • DataTypeMappingSet[4][5]

注:

[0] 说明新建SWC port的前提是要提前定义好Interface库,port只能从现有的库里面去绑定Interface

Interface定义在01_TypesAndInterface.arxml的PortInterface Package下面

[0]: 每次在新建SWC之前,都应该去看看有哪些Interface可用,这是新建SWC的基础和前提条件。因为SWC的port只能与现有的Interface相连,而Interface下面的Data Element则代表着SWC可用的variable

[0.1]: Application data type 和 Implementation Data Type 存在“01_TypesAndInterface.arxml”文件,但AUTOSAR platform types存在"ISOLAR_PlatformTypes.arxml"文件里面

[0.2]: 用户去决定是Pport还是Rport,因为Interface是不分方向的

[1] 每个SWC下面可以有多个runnables

[2] 是Read还是Write基于之前给该SWC新建的Ports来确定,软件会自动识别这步分配的是Pport还是Rport,从而确定是Read还是Write AccessPoint

[2.1] DataAccessPoint是在Function/Runnable下面的一个子tab,说白了就是一个SWC可以有多个runnable,在DataAccessPoint这个tab来规定各个port到底分配到哪个runnable

[3] 新建TimingEvent后软件会问和哪个runnable绑定,即TimingEvent可以看作是runnable的子tab

[4] DataTypeMappingSet is under "Internal Behavior', 所以说是基于SWC去绑定一个个相互独立的DataTypeMappingSet

[5] 之前在“01_TypesAndInterface.arxml” 文件里面只会去创建Application data type和Implementation data type(并声明IDT和哪种AUTOSAR base type相连)(Data Element在Interface下面和ADT相连),在这里(02_WiperControl_100us.arxml)才会将 Application data type和Implementation data type连接起来(可附加ComputeMethoud)

02_WiperControl_100us.arxml

[6] 但在实际生成的代码中,SWC变量/DataElement 用的是Implementation data type

WiperControl_2ms.c

[7] 之所以搞ADT出来,是为了Interface的复用,因为IDT是和AUTOSAR Platform Type绑定的,而AUTOSAR Platform Type与硬件有关(Int是16还是32-bit), 而在创建Interface的时候如果直接用IDT换了硬件就没法复用了,所以选用ADT和Data Element绑定,然后再在SWC的Internal Behavior里面用DataTypeMapping将ADT和IDT对应起来

1. RTE.c 里面的function name 是由 Internal behavior/Function这儿的命名一样吗?

本文发布于:2024-02-02 00:08:51,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170680951940072.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

下一篇:SWC 流程
标签:步骤   SWC
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23