주요 콘텐츠

MISRA C 코딩 표준에 대한 모델 어드바이저 검사

R2026b

모델이나 서브시스템이 MISRA C:2012 및 MISRA C:2023 준수 코드를 생성할 수 있는 가능성을 검사하려면 모델 어드바이저를 열고 작업별 > MISRA C:2023에 대한 모델링 표준에서 검사를 실행합니다.

참고

MISRA C:2012를 준수하는 고무결성 시스템 모델링 지침 및 각 지침과 관련 검사 항목은 MISRA C:2023도 준수합니다. R2026a부터, 모델 어드바이저는 MISRA C:2023을 독점적으로 참조하는 폴더와 검사를 포함하며 이는 또한 MISRA C:2012 준수도 유지합니다.

아래 검사를 실행하려면 Embedded Coder®와 Simulink® Check™가 모두 필요합니다.

모델 어드바이저 검사검사 ID
Check configuration parameters for MISRA C:2023mathworks.misra.CodeGenSettings
Check for blocks not recommended for C/C++ production code deploymentmathworks.codegen.PCGSupport
Check for blocks not recommended for MISRA C:2023mathworks.misra.BlkSupport
Check for unsupported block names (지원되지 않는 블록 이름이 있는지 검사)mathworks.misra.BlockNames
Check usage of Assignment blocks (Assignment 블록 사용 검사)mathworks.misra.AssignmentBlocks
Check for switch case expressions without a default case (default case를 갖지 않는 switch case 표현식이 있는지 검사)mathworks.misra.SwitchDefault
AUTOSAR 수신기 인터페이스에 누락된 오류 포트가 있는지 확인하세요.mathworks.misra.AutosarReceiverInterface
Check for bitwise operations on signed integers (부호 있는 정수에 대한 비트별 연산이 있는지 검사)mathworks.misra.CompliantCGIRConstructions
재귀 함수 호출이 있는지 검사mathworks.misra.RecursionCompliance
Check for equality and inequality operations on floating-point values (부동소수점 값에 대한 등식 및 부등식 연산이 있는지 검사)mathworks.misra.CompareFloatEquality
모델 함수에 누락된 const 한정자가 있는지 확인하세요.mathworks.misra.ModelFunctionInterface
Check integer word lengths (정수 워드 길이 검사)mathworks.misra.IntegerWordLengths

Check bus object names that are used as bus element names

mathworks.misra.BusElementNames
Check for variant blocks that do not have a default choice (디폴트 선택지를 갖지 않는 Variant 블록이 있는지 검사)mathworks.misra.DefaultChoiceVariantChecks
Check MISRA C2012 compliance on Generated Codemathworks.misra.checkPolyspaceMISRA2012Compliance
Check MISRA C2023 compliance on Generated Codemathworks.misra.checkPolyspaceMISRA2023Compliance

MISRA C:2012 및 MISRA C:2023 표준에서 지원하는 고무결성 검사에 액세스하려면 작업별 > MISRA C:2023에 대한 모델링 표준 > 고무결성 시스템 폴더로 이동하십시오.

참고

고무결성 모델링 지침은 MISRA C:2012 및 MISRA C:2023 모델링의 특정 규칙을 준수하도록 하기 위한 것입니다.

또한 고무결성 시스템에는 아래 표에 나온 대로, 기능을 기반으로 고무결성 검사를 포함하는 하위 폴더가 포함되어 있습니다.

작업별 > MISRA C:2023에 대한 모델링 표준 > 고무결성 시스템 > 구성

작업별 > MISRA C:2023에 대한 모델링 표준 > 고무결성 시스템 > MATLAB

모델 어드바이저 검사검사 ID고무결성 시스템 모델링 지침
Check switch statements in MATLAB Function blocksmathworks.hism.himl_0007himl_0007: MATLAB code switch / case / otherwise patterns

작업별 > MISRA C:2023에 대한 모델링 표준 > 고무결성 시스템 > 명명

모델 어드바이저 검사검사 ID고무결성 시스템 모델링 지침
Check model object namesmathworks.hism.hisl_0032hisl_0032: Model element names

작업별 > MISRA C:2023에 대한 모델링 표준 > 고무결성 시스템 > Simulink

모델 어드바이저 검사검사 ID고무결성 시스템 모델링 지침
Check usage of Abs blocksmathworks.hism.hisl_0001hisl_0001: Usage of Abs block
Check usage of square root operationsmathworks.hism.hisl_0003hisl_0003: Usage of square root operations
Check usage of While Iterator blocksmathworks.hism.hisl_0006hisl_0006: Usage of While Iterator blocks
Check usage of For and While Iterator subsystemsmathworks.hism.hisl_0007hisl_0007: Usage of For Iterator or While Iterator subsystems
Check usage of For Iterator blocksmathworks.hism.hisl_0008hisl_0008: Usage of For Iterator blocks
Check usage of If blocks and If Action Subsystem blocksmathworks.hism.hisl_0010hisl_0010: Usage of If blocks and If Action Subsystem blocks
Check usage of Switch Case blocks and Switch Case Action Subsystem blocksmathworks.hism.hisl_0011hisl_0011: Usage of Switch Case blocks and Action Subsystem blocks
Check usage of Relational Operator blocksmathworks.hism.hisl_0017hisl_0017: Usage of blocks that compute relational operators (2)
Check usage of Logical Operator blocksmathworks.hism.hisl_0018hisl_0018: Usage of Logical Operator block
Check usage of bit operation blocksmathworks.hism.hisl_0019hisl_0019: Usage of bitwise operations
Check for blocks not recommended for C/C++ production code deploymentmathworks.hism.hisl_0020hisl_0020: Blocks not recommended for MISRA C compliance
Check usage of Reciprocal Sqrt blocksmathworks.hism.hisl_0028hisl_0028: Usage of Reciprocal Square Root blocks
Check usage of Assignment blocksmathworks.hism.hisl_0029hisl_0029: Usage of Assignment blocks
Check usage of Signal Routing blocksmathworks.hism.hisl_0034hisl_0034: Usage of Signal Routing blocks
Check global variables in graphical functionsmathworks.hism.hisl_0062hisl_0062: Global variables in graphical functions
Check for length of user-defined object namesmathworks.hism.hisl_0063hisl_0063: Length of user-defined object names to improve MISRA C compliance
Check for divide-by-zero calculationsmathworks.hism.hisl_0067hisl_0067: Protect against divide-by-zero calculations
Check usage of bit-shift operationsmathworks.hism.hisl_0073hisl_0073: Usage of bit-shift operations
Check safety-related diagnostic settings for variantsmathworks.hism.hisl_0074hisl_0074: Configuration Parameters > Diagnostics > Modeling issues related to variants
Check for dead logicmathworks.hism.hisl_0101hisl_0101: Prevent operations that result in dead logic to improve code compliance
Check data type of loop control variablesmathworks.hism.hisl_0102hisl_0102: Data type of loop control variables to improve MISRA C compliance
Check usage of remainder and reciprocal operationsmathworks.sldv.hism.hisl_0002hisl_0002: Usage of remainder and reciprocal operations
Check usage of log and log10 operationsmathworks.sldv.hism.hisl_0004hisl_0004: Usage of natural logarithm and base 10 logarithm operations

작업별 > MISRA C:2023에 대한 모델링 표준 > 고무결성 시스템 > Stateflow