AUTOSAR ARXML - 引用的定义与配置

在ARXML的配置过程中,除了要使用参数的定义与配置外,还有很多场景需要使用引用来实现。

引用按照使用场景可分为以下6种类型:

  • Reference
  • Choice Reference
  • Foreign Reference
  • Instance Reference
  • Symbolic Name Reference
  • Uri Reference


Reference

待更新……

Choice Reference

待更新……

Foreign Reference

待更新……

Instance Reference

待更新……

Symbolic Name Reference

“符号名引用”通过符号名的机制获取其它模块容器的数值。

在AUTOSAR的配置过程中,有一种情况为Module A需要使用的数据由于某些原因只能被定义在Module B中,如下图所示,CorTst模块的很多Production Error需要上报给Dem模块进行处理,由于很多的模块都需要上报错误给Dem模块,所以只能由Dem来统一的定义这些错误的序号。

那么我们应该如何使用ARXML来实现上面所描述的场景呢?

CorTst模块引用定义:

<!-- xml snippet of CorTst reference definition file. -->
<ECUC-MODULE-DEF>
	<SHORT-NAME>CorTst</SHORT-NAME>
	<CONTAINERS>
		<ECUC-PARAM-CONF-CONTAINER-DEF>
			<SHORT-NAME>CorTstDemEventParameterRefs</SHORT-NAME>
			<LOWER-MULTIPLICITY>0</LOWER-MULTIPLICITY>
			<UPPER-MULTIPLICITY>1</UPPER-MULTIPLICITY>
			<REFERENCES>
				<ECUC-SYMBOLIC-NAME-REFERENCE-DEF>
					<SHORT-NAME>CORTST_E_CORE_FAILURE</SHORT-NAME>
					<LOWER-MULTIPLICITY>1</LOWER-MULTIPLICITY>
					<UPPER-MULTIPLICITY>1</UPPER-MULTIPLICITY>
					<DESTINATION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/AUTOSAR/EcucDefs/Dem/DemEventParameter</DESTINATION-REF>
				</ECUC-SYMBOLIC-NAME-REFERENCE-DEF>
			</REFERENCES>
		</ECUC-PARAM-CONF-CONTAINER-DEF>
	</CONTAINERS>
</ECUC-MODULE-DEF>

CorTst模块引用配置定义:

<!-- xml snippet of CorTst reference definition file. -->
<ECUC-MODULE-CONFIGURATION-VALUES>
	<SHORT-NAME>myCorTst</SHORT-NAME>
	<DEFINITION-REF DEST="ECUC-MODULE-DEF">/AUTOSAR/EcucDefs/CorTst</DEFINITION-REF>
	<CONTAINERS>
		<ECUC-CONTAINER-VALUE>
			<SHORT-NAME>Dem_PLL_lock_error</SHORT-NAME>
			<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/AUTOSAR/EcucDefs/CorTst/CorTstDemEventParameterRefs</DEFINITION-REF>
			<REFERENCE-VALUES>
				<ECUC-REFERENCE-VALUE>
					<DEFINITION-REF DEST="ECUC-SYMBOLIC-NAME-REFERENCE-DEF">/AUTOSAR/EcucDefs/CorTst/CorTstDemEventParameterRefs/CORTST_E_CORE_FAILURE</DEFINITION-REF>
					<VALUE-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/ECUC/myDem/myDemConfigSet/CORTST_E_CORE_FAILURE_1</VALUE-REF>
				</ECUC-REFERENCE-VALUE>
			</REFERENCE-VALUES>
		</ECUC-CONTAINER-VALUE>
	</CONTAINERS>
</ECUC-MODULE-CONFIGURATION-VALUES>

Dem模块参数定义:

<!-- xml snippet of Dem parameter definition file. -->
<ECUC-MODULE-DEF>
	<SHORT-NAME>Dem</SHORT-NAME>
	<CONTAINERS>
		<ECUC-PARAM-CONF-CONTAINER-DEF>
			<SHORT-NAME>DemEventParameter</SHORT-NAME>
			<LOWER-MULTIPLICITY>0</LOWER-MULTIPLICITY>
			<UPPER-MULTIPLICITY-INFINITE>true</UPPER-MULTIPLICITY-INFINITE>
			<PARAMETERS>
				<ECUC-INTEGER-PARAM-DEF>
					<SHORT-NAME>DemEventId</SHORT-NAME>
					<LOWER-MULTIPLICITY>1</LOWER-MULTIPLICITY>
					<UPPER-MULTIPLICITY>1</UPPER-MULTIPLICITY>
					<SYMBOLIC-NAME-VALUE>true</SYMBOLIC-NAME-VALUE>
				</ECUC-INTEGER-PARAM-DEF>
			</PARAMETERS>
		</ECUC-PARAM-CONF-CONTAINER-DEF>
	</CONTAINERS>
</ECUC-MODULE-DEF>

Dem模块参数配置定义:

<!-- xml snippet of Dem reference configuration file. -->
<ECUC-MODULE-CONFIGURATION-VALUES>
	<SHORT-NAME>myDem</SHORT-NAME>
	<DEFINITION-REF DEST="ECUC-MODULE-DEF">/AUTOSAR/EcucDefs/Dem</DEFINITION-REF>
	<CONTAINERS>
		<ECUC-CONTAINER-VALUE>
			<SHORT-NAME>myDemConfigSet</SHORT-NAME>
			<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/AUTOSAR/EcucDefs/Dem/DemConfigSet</DEFINITION-REF>
			<SUB-CONTAINERS>
				<ECUC-CONTAINER-VALUE>
					<SHORT-NAME>CORTST_E_CORE_FAILURE_1</SHORT-NAME>
					<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/AUTOSAR/EcucDefs/Dem/DemConfigSet/DemEventParameter</DEFINITION-REF>
					<PARAMETER-VALUES>
						<ECUC-NUMERICAL-PARAM-VALUE>
							<DEFINITION-REF DEST="ECUC-INTEGER-PARAM-DEF">/AUTOSAR/EcucDefs/Dem/DemConfigSet/DemEventParameter/DemEventId</DEFINITIONREF>
							<VALUE>17</VALUE>
						</ECUC-NUMERICAL-PARAM-VALUE>
					</PARAMETER-VALUES>
				</ECUC-CONTAINER-VALUE>
			</SUB-CONTAINERS>
		</ECUC-CONTAINER-VALUE>
	</CONTAINERS>
</ECUC-MODULE-CONFIGURATION-VALUES>


对应Dem的头文件Dem_PBcfg.h中需要定义:

#define DemConf_DemEventParameter_CORTST_E_CORE_FAILURE_1 17


上述DemConf_DemEventParameter_CORTST_E_CORE_FAILURE_1宏定义的规则如下:

"Mip" + "Conf" + "_" + "ContainerDefShortName" + "_" + "ContainerRefShortName"

Mip: 模块前缀,如Dem、CorTet。

Conf:固定后缀

ContainerDefShortName:在模块定义文件中,被引用的参数的<ECUC-PARAM-CONF-CONTAINER-DEF>元素的<SHORT-NAME>。

ContainerRefShortName:在模块配置文件中,对应配置参数的<ECUC-CONTAINER-VALUE>元素的<SHORT-NAME>。


DemEventId因其<SYMBOLIC-NAME-VALUE>元素设置为true, 所以其值17被用于DemEventParameter宏定义的数值。

注意:Symbolic Name Reference只能被指向“ECUC-PARAM-CONF-CONTAINER-DEF”类型的元素。

Uri Reference

待更新……


阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/daweihuahuo/article/details/78366430
文章标签: AUTOSAR ARXML
个人分类: AUTOSAR
想对作者说点什么? 我来说一句
相关热词

没有更多推荐了,返回首页

关闭
关闭
关闭