主要内容

FPGA HDL 代码生成

从 Simscape 模型生成 HDL 代码,用于实时 FPGA 部署

需要快速采样时间的模型或子系统可受益于 FPGA 仿真。如果您安装了 HDL Coder™,则可将您的 Simscape 被控对象模型转换为 HDL 实现模型,然后使用该模型生成 HDL 代码,并将其部署到 FPGA。要将 Simscape 模型或子系统部署到 FPGA,请执行以下步骤:

  1. 使用 sschdladvisor 函数启动 Simscape HDL 工作流顾问,该工具将指导您完成创建 HDL 实现模型的过程。

  2. 使用 HDL 工作流顾问工具将实现模型转换为 HDL 代码。

  3. 使用 Simulink® Real-Time™ 将 HDL 代码部署到 FPGA。

您可以使用模型综合来预测可实现的硬件时间步。

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

函数

sschdladvisor打开 Simscape HDL 工作流顾问
simscape.findNonlinearBlocksCheck model for blocks with nonlinear equations
sschdl.updateRuntimeParametersGenerate updated tunable parameter data file for Simscape model (自 R2024a 起)
sschdl.generateOptimizedModelReplace Simscape switches and converter blocks with dynamic switches optimized for FPGA deployment (自 R2024a 起)

主题

疑难解答

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.

精选示例