Contenuto principale

Coding Standards

R2026b
Learn about coding standard report, lint tool scripts, and coding standard rules

Industry coding standards recommend using certain HDL coding guidelines. HDL Coder™ generates code that follows industry-standard rules and generates a report that shows how well your generated HDL code conforms to industry coding standards.

HDL Coder checks for conformance of your Simulink® model or MATLAB® algorithm to the HDL coding standard rules. To fix errors or warnings related to these rules, update your model design. You can customize some of the coding standard rules.

Functions

hdlcoder.CodingStandardCreate HDL coding standard customization object

Properties

Model Settings

expand all

HDL coding standardSelect coding standard guidelines
Show passing rules in coding standard reportInclude passing rules in coding standard report
Check for duplicate namesCheck for duplicate names in design
Check for HDL keywords in design namesCheck for HDL keywords in design names
Check module, instance, entity name lengthWhether to check module, instance, and entity name length
Check signal, port, and parameter name lengthWhether to check signal, port, and parameter name length
Check for clock enable signalsWhether to check for clock enable signals in generated code
Detect usage of reset signalsWhether to check for reset signals in generated code
Detect usage of asynchronous reset signalsWhether to check for asynchronous reset signals in generated code
Minimize use of variablesWhether to minimize use of variables
Check for initial statements that set RAM initial valuesWhether to check for initial statements that set RAM initial values
Check for conditional statements in processesWhether to check for length of conditional statements
Check for assignments to the same variable in multiple cascaded control regionsWhether to check if there are assignments to same variable in multiple cascaded control regions
Check if-else statement chain lengthWhether to check if-else statement chain length
Check if-else statement nesting depthWhether to check if-else statement nesting depth
Check multiplier widthWhether to check multiplier bit width
Check for non-integer constantsWhether to check for non-integer constants
Check line wrap lengthWhether to check line lengths in the generated HDL code

Topics

HDL Coding Standard Report

HDL Coding Standard Rules Reference

  • Basic Coding Practices
    A list of rules related to basic coding practices, the rule description, and how you can fix warnings or errors resulting from rule violations.
  • RTL Description Rules and Checks
    A list of rules related to RTL description techniques, the rule description, and how you can fix warnings or errors resulting from rule violations.
  • RTL Design Methodology Guidelines
    A list of rules related to RTL design methodology, the rule description, and how you can fix warnings or errors resulting from rule violations.

Coding Standard Considerations