组合与 ECU 软件仿真
开发多个相互连接并协同工作的 AUTOSAR 软件组件模型时,您可以将它们纳入一个 AUTOSAR 组合模型中进行仿真。组合是 AUTOSAR 软件组件,它聚合一组相关的软件组件。组合支持组件扩展,有助于管理设计的复杂性。
要创建 AUTOSAR 组合的 Simulink® 表示,请执行以下操作之一:
导入组合的 AUTOSAR XML (ARXML) 描述(Classic 平台)。
创建一个模型,并使用 Model 模块来引用和连接 AUTOSAR 组件模型。
如果您有 System Composer™ 软件,您也可以创建一个 AUTOSAR 架构模型,并使用 Software Composition 模块对 AUTOSAR 组合进行建模。有关详细信息,请参阅软件架构建模。
对一个组合模型进行仿真时,您需要仿真聚合的 AUTOSAR 组件的整体行为。
对于 AUTOSAR Classic 平台,AUTOSAR Blockset 提供 Basic Software (BSW) 模块,您可使用这些模块对在 AUTOSAR 运行时环境中运行的 BSW 服务的软件组件调用进行建模。BSW 服务包括 NVRAM Manager (NvM)、Diagnostic Event Manager (Dem) 和 Function Inhibition Manager (FiM)。在运行时环境中,AUTOSAR 软件组件通常使用客户端-服务器或发送方-接收方通信来访问 BSW 服务。
要对调用 BSW 服务的 AUTOSAR 组件进行仿真,您需要创建一个包含式组合模型,并添加预配置的 BSW 服务组件模块。这些模块提供 BSW 服务的参考实现。
如果您有 Simulink Design Verifier™,您可以对 AUTOSAR 组件模型执行验证。
模块
Control Function Available Caller | Call AUTOSAR Function Inhibition Manager (FiM) service interface
ControlFunctionAvailable |
Dem Status Inject | Inject an event failure to test recovery (自 R2022a 起) |
Dem Status Override | Override an event to simulate and verify behavior (自 R2022a 起) |
DiagnosticEventAvailableCaller | Call AUTOSAR Diagnostic Event Manager (Dem) service interface
EventAvailable |
DiagnosticInfoCaller | Call AUTOSAR Diagnostic Event Manager (Dem) service interface
DiagnosticInfo |
DiagnosticMonitorCaller | Call AUTOSAR Diagnostic Event Manager (Dem) service interface
DiagnosticMonitor |
DiagnosticOperationCycleCaller | Call AUTOSAR Diagnostic Event Manager (Dem) service interface
OperationCycle |
Diagnostic Service Component | Configure AUTOSAR Diagnostic Services and Runtime Environment (RTE) for emulation |
Function Inhibition Caller | Call AUTOSAR Function Inhibition Manager (FiM) service interface
FunctionInhibition |
NvMAdminCaller | Call AUTOSAR NVRAM Manager (NvM) service interface
NvMadmin |
NvMServiceCaller | Call AUTOSAR NVRAM Manager (NvM) service interface
NvMService |
NVRAM Service Component | Configure AUTOSAR NVRAM Services and Runtime Environment (RTE) for emulation |
函数
autosar.slrealtime.migrateModel | Migrate AUTOSAR component models to Simulink Real-Time for rapid-prototyping and real-time simulation (自 R2024b 起) |
createCompositionAsModel | Create Simulink representation of AUTOSAR ARXML software composition |
updateModel | Update AUTOSAR model or architecture with ARXML changes |
主题
导入 AUTOSAR 组合和组件
- AUTOSAR 软件组件和组合
开发可重用的 AUTOSAR 软件组件,并将其组装到 AUTOSAR 组合中。 - Import AUTOSAR Composition to Simulink
Create Simulink® model from XML description of AUTOSAR software composition. - Import AUTOSAR Software Composition with Atomic Software Components (Classic Platform)
Import AUTOSAR software composition and its contained components and compositions.
设计、建模和配置
- Model AUTOSAR Basic Software Service Calls
Model communication between an AUTOSAR software component and AUTOSAR Basic Software (BSW) services. - Configure Calls to AUTOSAR Diagnostic Event Manager Service
Implement component calls to Diagnostic Event Manager (Dem) service with preconfigured AUTOSAR Basic Software blocks. - Configure Calls to AUTOSAR Function Inhibition Manager Service
Implement component calls to Function Inhibition Manager (FiM) service with preconfigured AUTOSAR Basic Software blocks. - Configure Calls to AUTOSAR NVRAM Manager Service
Implement component calls to NVRAM Manager (NvM) service with preconfigured AUTOSAR Basic Software blocks. - Configure AUTOSAR Basic Software Service Implementations for Simulation
For system-level simulation of AUTOSAR Basic Software caller blocks, use reference implementations of Basic Software services.
仿真和验证
- Combine and Simulate AUTOSAR Software Components
Combine AUTOSAR software components in a composition model for simulation. - Design and Simulate AUTOSAR Components and Generate Code
Develop AUTOSAR components by implementing behavior algorithms, simulating components and compositions, and generating component code. - Configure and Simulate AUTOSAR Function Inhibition Service Calls
Simulate AUTOSAR component calls to Basic Software function inhibition and related services by using reference implementations. - Simulate AUTOSAR Basic Software Services and Run-Time Environment
Simulate AUTOSAR component calls to Basic Software memory and diagnostic services by using reference implementations. - Simulate and Verify AUTOSAR Component Behavior by Using Diagnostic Fault Injection
This example shows how to simulate and verify the behavior of AUTOSAR components modeled in Simulink® that contain calls into the AUTOSAR Diagnostic Event Manager (Dem). - Configure and Simulate AUTOSAR Classic Models with Simulink Real-Time
For system-level simulation of AUTOSAR Classic models, use AUTOSAR conversion features to Simulink Real-Time™ to rapidly prototype and simulate your model on a target computer.