Generate an HDL Coding Standard Report from Simulink

You can generate an HDL coding standard report that shows how well your generated code follows industry standards. You can optionally customize the coding standard report and the coding standard rules.

Using the HDL Workflow Advisor

To generate an HDL coding standard report with the HDL Workflow Advisor:

  1. In the HDL Code Generation task, in Set Code Generation Options > Set Advanced Options, select the Coding standards tab.

  2. For HDL coding standard, select Industry and click Apply.

  3. Optionally, using the other options in the Coding standards tab, customize the coding standard rules and click Apply.

After you generate code, the message window shows a link to the HTML compliance report. To open the report, click the report link.

Using the Command Line

To generate an HDL coding standard report using the command-line interface, set the HDLCodingStandard property to Industry by using makehdl or hdlset_param.

For example, to generate HDL code and an HDL coding standard report for a subsystem, sfir_fixed/symmetric_sfir, enter the following command:

makehdl('sfir_fixed/symmetric_fir','HDLCodingStandard','Industry')
### Generating HDL for 'sfir_fixed/symmetric_fir'.
### Starting HDL check.
### HDL check for 'sfir_fixed' complete with 0 errors, 0 warnings, and 0 messages.
### Begin VHDL Code Generation for 'sfir_fixed'.
### Working on sfir_fixed/symmetric_fir as hdlsrc\sfir_fixed\symmetric_fir.vhd
### Industry Compliance report with 4 errors, 18 warnings, 5 messages.
### Generating Industry Compliance Report symmetric_fir_Industry_report.html
### Generating SpyGlass script file sfir_fixed_symmetric_fir_spyglass.prj
### HDL code generation complete.
To open the report, click the report link.

You can customize the coding standard report and coding standard rule checks by specifying an HDL coding standard customization object. For example, for a subsystem, sfir_fixed/symmetric_sfir, you can create an HDL coding standard customization object, cso, set the maximum if-else statement chain length to 5 by using the IfElseChain property, and generate code:

cso = hdlcoder.CodingStandard('Industry');
cso.IfElseChain.length = 5;
makehdl('sfir_fixed/symmetric_fir','HDLCodingStandard','Industry', ...
        'HDLCodingStandardCustomizations',cso)

See Also

Properties

Related Examples

More About