主要内容

MISRA C 合规性注意事项

R2026b
MISRA C:2012 和 MISRA C:2023 合规性,包括建模风格、模块用法和配置设置

这些高完整性建模规范有助于您为系统建模,从而提高生成符合 MISRA C:2012 和 MISRA C:2023 编码标准的代码的可能性。使用针对这些规范的模型顾问检查以及模型顾问检查是否符合 MISRA C 编码标准 (Simulink Check)来验证您的模型。

建模规范

全部展开

hisl_0032:模型元素名称Naming conventions for model elements that produce valid identifiers in generated code
hisl_0061:为清晰起见使用唯一标识符Use unique identifiers for signals and across scopes within a chart
hisl_0062:图形函数中的全局变量Use of data with a global scope in graphical functions
hisl_0063:用于提高 MISRA C 合规性的用户定义对象名称的长度Limit the length of user defined names
hisl_0020:不推荐用于 MISRA C 合规性的模块Improve MISRA C:2012 and MISRA C:2023 compliance of the generated code
hisl_0101:防止导致死逻辑的操作以提高代码合规性Avoid operations that result in dead logic in the model (自 R2022a 起)
hisl_0102:用于提高 MISRA C 合规性的循环控制项变量的数据类型Use integer data type for loop control counter variables
hisl_0060:用于提高 MISRA C 合规性的配置参数Set model configuration parameters to improve MISRA C:2012 and MISRA C:2023 compliance of generated code
hisf_0065:在 Stateflow 中进行类型强制转换运算以提高代码合规性Protect against Stateflow implicit data type casting for integer and fixed-point calculations to data types other than input data types
hisf_0211:防止在 Stateflow 图中使用一元运算符来提高代码合规性Improve code compliance of the generated code