Generate HDL Coding Standard Report from Simulink - MATLAB & Simulink (original) (raw)
Main Content
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 Configuration Parameters Dialog Box
To generate an HDL coding standard report using the Configuration Parameters dialog box:
- To open the Configuration Parameters dialog box, in the Apps gallery, click HDL Coder. The HDL Code tab in the Simulink® toolstrip appears. In thePrepare section, clickSettings.
- In the > pane of the Configuration Parameters dialog box, select the Coding standards tab.
- For the HDL coding standard parameter, selectIndustry and clickApply.
- Optionally, use the other options in theCoding standards tab to customize the coding standard rules and clickApply.
- You can then generate HDL code by clicking theGenerate HDL Code button in the HDL Code tab in the Simulink toolstrip.
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 orhdlset_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 theIfElseChain
property, and generate code:
cso = hdlcoder.CodingStandard('Industry'); cso.IfElseChain.length = 5; makehdl('sfir_fixed/symmetric_fir','HDLCodingStandard','Industry', ... 'HDLCodingStandardCustomizations',cso)