reports for code generation
the code generator software produces an html code generation report so that you can view and analyze the generated code. when you build your model, the code generation process produces an html file that is displayed in an html browser or in the model explorer. for an example, see .
if you have simulink® report generator™, you can document your code generation project in multiple formats, including html, pdf, rtf, microsoft® word, and xml. for an example of how to create a microsoft word report, see document generated code with simulink report generator.
html code generation report content
the code generation report includes:
the summary section that contains model and code information, including author, tasking mode, system target file, hardware device type, and code generation objectives information. the configuration settings at the time of code generation link opens a noneditable view of the configuration parameters dialog box. the dialog box shows the simulink model settings at the time of code generation, including tlc options.
the subsystem report section that contains information on nonvirtual subsystems in the model.
the code interface report section that provides information about the generated code interface, including model entry-point functions and input/output data. for more information, see .
in the code section on the contents pane, you can click the names of source code files generated from your model to view their contents.
html code generation report location
the default location for the code generation report files is in the html
subfolder of the build folder,
.
model
_target
_rtw/html/
is the name of the
system target file specified on the code
generation pane. the default name for the top-level html report file is
target
index.html
. for more information on the location of the build folder,
see .
html code generation report for referenced models
to generate a code generation report for a top model and code generation reports for each referenced model, you need to specify the create code generation report on the code generation > report pane for the top model and each referenced model. you can open the code generation report of a referenced model in one of two ways:
from the top-model code generation report, you can access the referenced model code generation report by clicking the name of the top model above the generated code. in the drop-down list of the model reference hierarchy, click the referenced model. to navigate back to the top model code generation report, use the back button at the top of the left navigation pane or use the model reference hierarchy context menu.
in the referenced model diagram window, on the c code tab, click open report.
for more information, see .
html code generation report extensions
if you have embedded coder®, the code generator enhances the html code generation report. configure your model to include these sections in the report:
the traceability report section enables you to account for eliminated / virtual blocks that are untraceable versus the listed traceable simulink blocks / stateflow objects / matlab scripts. this section provides a complete mapping between model elements and code. for more information, see customize traceability reports.
the static code metrics report section provides generated code statistics. metrics are estimated from static analysis of the generated code. to generate a static code metrics report without generating a code generation report, use the function . for more information, see .
the code replacements report section enables you to account for code replacement library (crl) functions that were used during code generation, providing a mapping between each replacement instance and the simulink block that triggered the replacement. for more information, see .
the coder assumptions section provides a list of:
code generation assumptions for your target hardware that you can check.
expected results for the assumption checks.
for more information, see .
the model web view displays an interactive model diagram within the code generation report and supports traceability between the source code and the model. you can then share your model and generated code outside of the matlab environment. for more information, see .
on the contents pane, in the generated files section, you can click the names of source code files generated from your model to view their contents in a matlab® web browser window. in the displayed source code:
if you enable code-to-model traceability, hyperlinks within the displayed source code navigate to the blocks or subsystems from which the code is generated. for more information, see .
if you enable model-to-code traceability, you can navigate to the generated code for a block in the model. for more information, see .
if you set the code coverage tool parameter on the code generation > verification pane, you can view the code coverage data and annotations. for more information, see .
if you select the generate static code metrics check box on the code generation > report pane, you can view code metrics information and navigate to code definitions and declarations in the generated code. for more information, see .
note
to view the contents of your generated code and navigate between model and code, you can also use the code view in the code perspective. in the perspective, click the code tab in the bottom-right corner.