Contenuto principale

FPGA HDL Code Generation

Generate HDL code from Simscape models for real-time FPGA deployment

Models or subsystems with fast sample time requirements may benefit from FPGA simulation. If you have HDL Coder™, you can convert your Simscape plant model to an HDL implementation model that you can then use to generate HDL code to deploy to an FPGA. To deploy your Simscape model or subsystem to an FPGA:

  1. Use the sschdladvisor function to launch the Simscape HDL Workflow Advisor, which guides you through the process of creating the HDL implementation model.

  2. Convert the implementation model to HDL code using the HDL Workflow Advisor tool.

  3. Use Simulink® Real-Time™ to deploy the HDL code to a FPGA.

You can use model synthesis to predict the achievable hardware time step.

Steps of generating HDL code from Simscape models and deploying the code on hardware.

Functions

sschdladvisorOpen Simscape HDL Workflow Advisor
simscape.findNonlinearBlocksCheck model for blocks with nonlinear equations
sschdl.updateRuntimeParametersGenerate updated tunable parameter data file for Simscape model (Since R2024a)
sschdl.generateOptimizedModelReplace Simscape switches and converter blocks with dynamic switches optimized for FPGA deployment (Since R2024a)

Topics

Troubleshooting

Resolving Issues with Nonlinearities

Troubleshoot simulation and code generation issues associated with nonlinearities.

Troubleshooting Real-Time Hardware Deployment Issues in Simscape Hardware-in-the-Loop Workflow (HDL Coder)

Troubleshoot real-time hardware deployment issues in Simscape Hardware-in-the-Loop workflow.

Troubleshoot Validation Errors in Simscape Hardware-in-the-Loop Workflow (HDL Coder)

Troubleshoot validation mismatches in Simscape Hardware-in-the-Loop workflow.

Featured Examples