Simscape Hardware-in-the-Loop Workflow

Simscape support for HDL code generation and workflow to generate HDL code from the models and deploy to target hardware

You can generate HDL code for your plant model that you developed by using Simscape™ blocks and then deploy the generated code to standalone FPGA boards, or to FPGAs onboard the Speedgoat hardware, SoC devices, and so on. By deploying the plant model to an FPGA board, you can accelerate the simulation of your plant model and simulate the model in real time by using Hardware-in-the-Loop (HIL) simulations.

Before you generate HDL code, use the sschdladvisor function to generate an HDL implementation model from Simscape switched linear models. Switched linear models are models that contain blocks such as diodes or switches. These blocks are defined by a linear relationship such as V = IR where R can switch between two or more values depending on the state of the diodes or switches.

After you generate the HDL implementation model, you can use HDL Coder™ to generate code for this model and deploy the generated code to target platforms by using the HDL Workflow Advisor. When you generate the HDL implementation model, you can specify whether to generate the implementation model with single-precision or double-precision floating-point data types. You can also specify insertion of a validation logic in the implementation model to verify whether the HDL implementation numerically matches the original Simscape algorithm.

Functions

sschdladvisorOpen Simscape HDL Workflow Advisor
simscape.findNonlinearBlocksCheck model for blocks with nonlinear equations
makehdlGenerate HDL RTL code from model, subsystem, or model reference

Topics

Generate HDL Code for Simscape Models

How to generate HDL code from Simscape switched linear models.

Deploy Simscape™ Plant Models to Speedgoat FPGA I/O Modules

How to deploy the generated HDL code from Simscape models to Speedgoat IO modules.

Partition Simscape Models Containing a Large Network into Multiple Smaller Networks

Learn how to partition a large Simscape network into multiple networks.

Generate HDL Code for Simscape Models with Multiple Networks

How to split a large Simscape network into multiple networks and generate HDL implementation model.

Improve Sampling Rate of HDL Implementation Model Generated from Simscape Algorithm

Learn about oversampling in generated HDL implementation model and how the model sample time relates to sample time of original Simscape algorithm.

Simscape HDL Workflow Advisor Tasks

Learn about the Simscape HDL Workflow Advisor and the various tasks to convert the Simscape algorithm to HDL implementation model.

Simscape HDL Workflow Advisor Tips and Guidelines

Learn about tips in Simscape HDL Workflow Advisor UI and how to use them as workflow guidelines.

Troubleshooting

Validate HDL Implementation Model to Simscape Algorithm

How to validate and resolve mismatch in simulation results between Simscape algorithm and HDL implementation model.

Troubleshoot Conversion of Simscape DC Motor Control to HDL-Compatible Simulink Model

How to troubleshoot generation of implementation model from Simscape models with few nonlinear elements such as DC Motor Control.

Troubleshoot Conversion of Simscape Permanent Magnet Synchronous Motor to HDL-Compatible Simulink Model

How to troubleshoot generation of implementation model from models with significant nonlinear elements such as Permanent Magnet Synchronous Motor.

Featured Examples