主要内容

编码标准

R2026b
了解编码标准报告、lint 工具脚本和编码标准规则

行业编码标准建议使用特定 HDL 编码规范。HDL Coder™ 生成遵循行业标准规则的代码,并生成报告以显示生成的 HDL 代码符合行业编码标准的程度。

HDL Coder 检查 Simulink® 模型或 MATLAB® 算法是否符合 HDL 编码标准规则。要修复与这些规则相关的错误或警告,请更新模型设计。您可自定义部分编码标准规则。

函数

hdlcoder.CodingStandardCreate HDL coding standard customization object

属性

模型设置

全部展开

HDL 编码标准Select coding standard guidelines
在编码标准报告中显示通过规则Include passing rules in coding standard report
检查重复名称Check for duplicate names in design
检查设计名称中是否有 HDL 关键字Check for HDL keywords in design names
检查模块、实例和实体名称长度Whether to check module, instance, and entity name length
检查信号、端口和参数名称长度Whether to check signal, port, and parameter name length
检查时钟使能信号Whether to check for clock enable signals in generated code
检测复位信号的使用Whether to check for reset signals in generated code
检测异步复位信号的使用Whether to check for asynchronous reset signals in generated code
尽量减少变量的使用Whether to minimize use of variables
检查设置 RAM 初始值的初始语句Whether to check for initial statements that set RAM initial values
检查 process 中的条件语句Whether to check for length of conditional statements
检查多个级联控制区域中相同变量的赋值Whether to check if there are assignments to same variable in multiple cascaded control regions
检查 if-else 语句链长度Whether to check if-else statement chain length
检查 if-else 语句嵌套深度Whether to check if-else statement nesting depth
检查乘法器宽度Whether to check multiplier bit width
检查非整数常量Whether to check for non-integer constants
检查换行长度Whether to check line lengths in the generated HDL code

主题

HDL 编码标准报告

HDL 编码标准规则参考

  • 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.

编码标准注意事项