Main Content

Model Reference PIL Simulation

Embedded Coder® Support Package for Infineon® AURIX™ TC3x Microcontrollers enables you to run processor-in-the-loop (PIL) simulation on selected parts of monolithic or SoC-based multicore models. A PIL simulation cross-compiles source code on your development computer and runs the generated object code on a target processor or an equivalent instruction set simulator. With model reference PIL simulation, the selected reference model runs on the Infineon AURIX hardware while the rest of the application model runs on the development host computer. This workflow allows incremental testing and improves simulation quality by validating execution behavior without simulating the entire application model or system.

Convert Part of Application Model to Model Reference

  1. Open an Infineon AURIX example model and select a part of the model for PIL simulation.

    For example, open the Field-Oriented Control of BLDC with Encoder Using Infineon AURIX TC3xx Microcontrollers example and launch the Simulink® model tc3x_mcb_pmsm_foc_encoder.slx.

    To perform PIL simulation for the Speed Control algorithm, select the Speed Control subsystem block.

  2. In the Simulink Toolstrip, on the Subsystem Block tab, click Convert > Referenced Model. Simulink opens the Model Reference Conversion Advisor, where you can select the conversion options and fix any conversion issues. For more information, see Convert Subsystem to Referenced Model.

    Convert part of application model as model reference

  3. To replace the Speed Control subsystem with a Model block that references the new model, check that Replace the content of a subsystem with a Model block is selected in the Model Reference Conversion Advisor. Click Convert.

    Model Reference Conversion Advisor

    Simulink opens the converted reference model after the conversion is complete.

    conversion completed in conversion advisor

  4. Open the Configuration Parameters dialog box of the reference model and configure it for Infineon AURIX hardware boards. Specify the Hardware board, Device Series, and Processing Unit for your hardware board.

PIL Simulation

  1. In the Simulink Toolstrip, on the Model Block tab, set Simulation Mode to Processor-in-the-loop (PIL).

    select PIL simulation mode for the model reference

    Simulink displays the simulation mode as a block label.

    simulink displays simulation mode on block label

  2. To launch the SIL/PIL Manager app, in the Simulink Toolstrip, on the Apps tab, select SIL/PIL Manager.

  3. On the SIL/PIL tab, set Mode to SIL/PIL Only and System Under Test to Model blocks in SIL/PIL mode.

    SIL PIL Manager configuration

    You can also configure the Code coverage, Code execution profiling, and Creation of code generation report and static code metrics.

  4. Click Run SIL/PIL. At the end of the simulation, in the Results section, click Data Inspector to view the simulation results.

  5. Restore the model to its initial state and continue performing PIL simulation on other parts of your application model. To restore the model, click Restore the original model in the Model Reference Conversion Advisor.

    Option to restore the original model in conversion advisor

Known Limitations

  • Top-level PIL simulation is not supported.

  • Infineon AURIX driver blocks are not supported in the Model block for the model reference PIL simulations.

See Also

| | (C2000 Microcontroller Blockset) | | | |