Autosar NvBlockSwComponentType

NvBlock SwComponentPrototypes 的代码会由rte generator 负责实现。NvBlockSwComponentType 提供了获取和管理存储在nvram中的数据的pirt interface。

 上图表现了NvBlockSwComponentType 的使用介绍。根据不同的使用场景,swc可以有不同的方式和NvBlockSwComponentType 连接。如果port类型是 SenderReceiverInterfaces / NvDataInterfaces 的连接模式为了获得访问NV data的权限,port类型是ClientServerInterfaces是用于管理nv data。多个swc 可以读出相同的NvBlockSwComponentType 的VariableDataPrototypes。

每个NvBlockSwComponentType 可以包含多个NvBlockDescriptors, 每一个NvBlockDescriptor关联一个NVRAM block。

一个NvBlockDescriptor 包含了一个VariableDataPrototype,作为NVRAM block的ram block, ParameterDataPrototype 作为default ROM value, 可选。ROM 和RAM block的类型应该是要匹配的。RTE会给VariableDataPrototype分配memory。

对于每个存在NvBlockDescriptor 中的element, 应该有一个NvBlockDataMapping ,这个mapping关系把能读写对应VariableDataPrototype element的port关系表现出来了。

NvBlockSwComponentType 可以用于减少ecu上面 nvram的数量,他可以把一些小的数据元素放在一个block里面,还可以让不同的swc访问相同数据元素。

为了保证nvram block在合适的时机写到nv memory中,rte提供了一个叫dirty flag的功能。这个机制能够在rte write api被调用时和nvm module交互,但是具体的表现要依赖于NvBlockDescriptor.

如果一个swc 通过接口调用了RTE_write/Rte_IWrite / Rte_IWriteRef, 并且dirtyFlagSupport & storeatshutdown 设为true, RTE 会通过调用NvM_SetRamBlockStatus把 ram block标为changed.

如果一个swc 通过接口调用了RTE_write/ Rte_IWrite / Rte_IWriteRef, 并且dirtyFlagSupport & storeCyclic 设为true, RTE 会在下个cycle调用NvM_WriteBlock来写数据。周期的信息是NvBlockDescriptor.timingEvent.period.

如果一个swc 通过接口调用了RTE_write/ Rte_IWrite / Rte_IWriteRef, 并且dirtyFlagSupport & storeImmediate 设为true, RTE 会在 NvBlockDescriptor’s RunnableEntity 中调用NvM_WriteBlock

如果swc需要被通知nvm job result, 需要使用NvM Client-Server interfaces。

标准的client sever interface可以实现这些:

• NvMService

This interface is used to send commands to the NVM. The NvBlockSwComponentType provides a server port intended to be used by the SW-C users of this NvBlockSwComponentType.

• NvMNotifyJobFinished

This interface is used by the NVM to notify the end of job. The NvBlockSwComponentType provides a server port intended to be used by the NVM, and client ports intended to be connected to the SW-C users of this NvBlockSwComponentType.

• NvMNotifyInitBlock

This interface is used by the NVM to request users to provide the default values in the RAM Block. The NvBlockSwComponentType provides a server port intended to be used by the NVM, and client ports intended to be connected to the SW-C users of this NvBlockSwComponentType.

• NvMAdmin

This interface is used to order some administrative operations to the NVM. The NvBlockSwComponentType provides a server port intended to be used by the SW-C users of this NvBlockSwComponentType.

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值