Documentation

循环模拟处理器

Test generated code on target processor or simulator

A processor-in-the-loop (PIL) simulation cross-compiles generated source code, and then downloads and runs object code on your target hardware. By comparing normal and PIL simulation results, you can test the numerical equivalence of your model and the generated code. During a PIL simulation, you can collect code coverage and execution-time metrics for the generated code.

A PIL simulation requires a target connectivity configuration.

Objects

expand all

rtw.connectivity.componentargs 为每个目标连接组件提供参数
rtw.connectivity.Config Define connectivity implementation that comprises builder, launcher, and communicator components
rtw.connectivity.ConfigRegistry Register connectivity configuration
rtw.connectivity.MakefileBuilder Configure toolchain-based build process
rtw.connectivity.Launcher Control downloading, starting, and resetting of a target application
rtw.connectivity.RtIOStreamHostCommunicator 使用目标处理器配置开发计算机通信
rtw.pil.RtIOStreamApplicationFramework Configure target-side communications

Functions

expand all

rtIOStreamClose Shut down communications channel
rtIOStreamOpen Initialize communications channel
rtiostreamRecv Receive data through communication channel
rtiostreamsend Send data through communication channel
rtiosstreamtest 测试自定义rtiostream接口实现
rtiosstream_wrapper Test rtiostream shared library functions in MATLAB
piltest Verify custom target connectivity configuration for Simulink PIL simulation

Apps

SIL/PIL Manager 验证生成的代码

Topics

SIL and PIL Simulations

循环概述(SIL)和循环模拟(PIL)的概述。

Choose a SIL or PIL Approach

Test code generated from top models, referenced models, or subsystems.

Create PIL Target Connectivity Configuration for Simulink

为您的目标环境自定义PIL模拟。

simulink PIL模拟的主机目标通信金宝app

Use thertiosstreamAPI for communication between your development computer and target hardware during a PIL simulation.

Specify Hardware Timer

使用代码Replacemen指定一个硬件定时器t Tool.

Configure and Run PIL Simulation

Set up and run top-model PIL, Model block PIL, and PIL block simulations.

SIL/PIL Manager Verification Workflow

A simplified workflow for verifying generated code.

PIL Simulation Sequence

How a PIL simulation proceeds.

Simulation Mode Override Behavior in Model Reference Hierarchy

How the simulation mode of the top model or parent model determines the simulation behavior of a model hierarchy.

Field-Oriented Control of Permanent Magnet Synchronous Machine

Simulate motor control system, generate controller code, and use PIL simulation to test numerical equivalence and profile code execution times.

SIL and PIL Limitations

SIL和PIL模拟不支持或部分支持的建模和代码生成功能。金宝app

Troubleshooting

在代码生成报告中查看SIL和PIL文件

生成代码生成报告和静态代码指标,涵盖SIL和PIL文件。

Verification of Code Generation Assumptions

The SIL or PIL simulation checks code generation assumptions.

Featured Examples