标准、规范和模块用法
要开发模型并生成符合行业标准的代码,请使用建模规范
建模规范提供有关模型设置、模块用法和模块参数的信息。当您为特定应用程序开发模型和生成代码时,请使用建模规范。如果您的应用程序具有高安全性的开发和认证目标,则您可以使用建模规范来增大模型和生成的代码符合行业标准的可能性,这些行业标准包括 IEC 601508、IEC 62304、ISO 26262、IEC 62304、EN 50128、ISO 25119、DO-178C、AUTOSAR、MISRA C®:2012、CERT® C、CWE™ 和 ISO/IEC TS 17961。
要评估模型设计和代码质量,并验证是否符合建模规范,如高完整性系统建模规范、MathWorks 咨询委员会 (MAB) 指导规范和代码生成规范,请使用模型顾问检查。有关详细信息,请参阅使用模型顾问检查您的模型。
主题
为生成高效的 C 和 C++ 代码设计高质量的模型
- Use Products and Blocks Supported for Code Generation
Identify products and blocks that support Simulink® Coder™Embedded Coder® code generation. - Consider Modeling Semantics when Generating Code
Data propagation, sample time propagation, latches for subsystem blocks, block execution order, and algebraic loops. - 生成代码的建模规范
概述有关模型和生成代码的规范,包括编码规范、组件部署建模规范和 MathWorks 咨询委员会规范 (MAB)。 - Check Model and Configuration for Code Generation
Assess model readiness to generate code by using the Model Advisor and Code Generation Advisor.
根据行业标准开发模型和生成代码
- Industry Standards
Industry-specific standards to consider for your model and the generated code, including IEC 61508, IEC 62304, ISO 26262, IEC 62304, EN 50128, ISO 25119, DO-178C, and AUTOSAR. - Modeling Guidelines and Model Advisor Checks for Verifying Compliance with Industry Standards
Use High-Integrity System Modeling guidelines and Model Advisor checks to verify that your model and the generated code complies with industry standards. - Qualification of Embedded Coder and AUTOSAR Blockset for Use in Processes that Must Comply with Industry Standards
Use the IEC Certification Kit to qualify Embedded Coder and AUTOSAR Blockset for supported industry standards, including ISO 26262: 2018, IEC 61508: 2010, IEC 62304: 2015, ISO 25119: 2018, and EN 50128: 2011.
验证模型和生成的代码是否符合行业编码标准
- Coding Standards
Industry coding standards to consider for your model and generated code, including MISRA C:2012, CERT C, CWE, and ISO/IEC TS 19761:2013. - Model Advisor Checks for Verifying Compliance with Secure Coding Standards
Use Model Advisor checks to verify that your model and the generated code complies with the secure coding standards. - Modeling Guidelines and Model Advisor Checks for Verifying Compliance with MISRA C:2012
Modeling guidelines for those MISRA C:2012 guidelines whose compliance type is "Compliance via guideline". - Developing a MISRA C:2012 Compliance Statement
Identifies how to use this documentation when developing your compliance statements for generated code as required per the MISRA C:2012 guidelines. - Evaluate Your Generated Code for MISRA C:2012 Compliance
High-level workflow to evaluate your generated code for compliance with MISRA C:2012 guidelines. - MISRA C:2012 Compliance Information Summary Tables
Defines the method to claim compliance to MISRA C:2012 guidelines. Includes applicable modeling guidelines, Model Advisor support, and Polyspace® MISRA C:2012 Checker support. - Deviations Rationale for MISRA C:2012 Compliance
Rationale for MISRA C:2012 directives and rules whose compliance type is "Deviation".