이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
코드 분석 및 추적
리포트, 추적성 및 Polyspace® 정적 코드 분석 제품을 사용하여 생성된 코드를 수동으로 확인하고 임계 경로를 분석
코드를 생성한 후에는 코드 메트릭, 인터페이스, 대체 및 코드 생성 가정을 분석하여 코드가 요구 사항을 충족하는지 확인하십시오. 코드 생성 리포트는 생성된 코드의 이러한 측면에 대한 정보를 제공합니다. 코드를 평가하고 모델을 수정하여 요구 사항을 충족하는 코드를 생성할 수 있습니다.
코드 추적을 사용하여 코드 라인과 그에 대응하는 모델 요소 사이를 탐색해 생성 코드를 확인합니다. 코드의 하이퍼링크에서 모델 요소로, 그리고 델 요소에서 시작해 코드 라인으로 추적할 수 있습니다. 생성 코드에서 모델 요소 요구 사항에 대한 링크를 포함할 수도 있습니다.
임계 경로 분석을 사용하면 생성된 코드를 분석하여 가장 긴 실행 시간을 생성하는 실행 경로를 식별할 수도 있습니다. 가장 긴 실행 시간을 생성하는 경로를 임계 경로라고 합니다. 코드 프로파일 분석기를 사용하여 식별된 경로 중 가장 비용이 많이 드는 섹션을 식별하고, 비용이 많이 드는 섹션에 최적화 노력을 적용하여 성능 요구 사항을 충족합니다.
앱
코드 프로파일 분석기 | Analyze execution-time and stack usage profiles for generated code (R2023a 이후) |
함수
rtwtrace | Trace a block to generated code in code generation report |
coder.profile.test.analyzePath | Identify critical paths of tasks (R2024a 이후) |
coder.profile.test.generateTests | Generate decision coverage tests for execution-time analysis (R2024a 이후) |
coder.profile.test.generateCriticalPathTest | Generate tests for critical paths (R2024a 이후) |
coder.profile.test.getCriticalPathElements | Get cell array of model elements in critical path (R2024a 이후) |
coder.profile.test.hiliteCriticalPath | Highlight critical path in model canvas (R2024a 이후) |
도움말 항목
코드 분석
- Check Code Generation Assumptions
Use standalone workflow to check code generator assumptions. - Analyze Code Replacements in Generated Code
The Code Replacements Report section in the code generation report documents the code replacement library (CRL) functions that were used for code replacements during code generation. - Generate Static Code Metrics Report for Simulink Model
When generating code, generate a report that includes static code metrics, such as, the number of lines of code, size of global variables, and the number of reads and writes. - Static Code Metrics
The code generator performs static analysis of the generated C or C++ code and provides these metrics in the static code metrics report in the code generation report. - Analyze Generated Data Code Interface Report
Use the code interface report to see documentation of the generated code data interfaces, including model entry-point functions and data interfaces. - Analyze Generated Service Code Interface Report
Use the code interface report to see documentation of the generated code service interface, including execution functions and services. - Log Program Execution Results
Log data to a MAT-file during execution of generated code.
코드 추적
- Verify Generated Code by Using Code Tracing
Code tracing enables navigation between generated code and its corresponding elements in a model. - Trace Simulink Model Elements in Generated Code
Trace Simulink® model elements by using code-to-model and model-to-code traceability in the code generation report. - Trace Stateflow Elements in Generated Code
Trace different Stateflow® elements to corresponding lines in generated code. - Reload Existing Traceability Information
Example of how to reload existing traceability information for a model. - Customize Traceability Reports
Obtain complete mapping between model elements and generated code. - Use Traceability in MATLAB Function Blocks
Trace between source code and generated code in a MATLAB Function block.
임계 경로 분석
- Analyze Execution Times of Critical Paths
Identify and analyze critical paths in the generated code.