Why do I get the error message "The model contains constructs that are unsupported for HDL code generation"?

I am trying to generate HDL code from my Simulink model, but I encounter the following error:
The model contains constructs that are unsupported for HDL code generation.

 Accepted Answer

In order to see details regarding this error message, refer to the HDL Code Generation Check Report which should pop up in a separate browser window within MATLAB. You can also open it by double-clicking on /hdlsrc/modelName/DUTname_report.html.
For example, the underlying error message could be the following:
Found division expression with unsupported Rounding Method for HDL code generation at Function
'divide' (#33554449.10968.11030), line 268, column 16. Supported Rounding Methods include:
"Zero" and "Floor". "Zero" is supported for both signed and unsigned division, whereas,
"Floor" Rounding Method is supported for unsigned division only.
Since the error message refers to MATLAB code inside a MATLAB Function block, you can remedy this by specifying a supported rounding method in the block's properties:

More Answers (0)

Products

Release

R2022a

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!