コード解析と追跡
レポート、トレーサビリティ、および Polyspace® 静的コード解析製品を使用して生成されたコードを手動で検証
コードの生成後、コード メトリクス、インターフェイス、置換、コード生成の仮定を解析することにより、コードが要件を満たしていることを確認します。コード生成レポートにより、生成されたコードのこれらの側面に関する情報が提供されます。要件を満たすコードを生成するために、コードを評価してモデルを変更できます。
コードのトレースを使用して、コードの行とそれに対応するモデル要素の間を移動することにより、生成されたコードを検証します。コードのハイパーリンクからモデル要素にトレースしたり、モデル要素からコード行にトレースしたりできます。生成コードからモデル要素の要件に対するリンクを含めることもできます。
関数
rtwtrace | コード生成レポートの生成コードへのブロックをトレースする |
トピック
コード解析
- コード生成の仮定のチェック
スタンドアロン ワークフローを使用して、コード ジェネレーターの仮定をチェックします。 - 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
Use the code interface report to see documentation of the generated code data interfaces, including model entry-point functions and interface data. - 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. - プログラム実行結果のログを作成する
生成されたコードの実行中に MAT ファイルにデータのログを作成します。
コードのトレース
- 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.