报告s for Code Generation
这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万博1manbetx®报告Generator™,您可以以多种格式记录代码生成项目,包括HTML,PDF,RTF,微软®单词,,,,and XML. For an example of how to create aMicrosoft Wordreport, seeDocument Generated Code with Simulink Report Generator。
HTML代码生成报告内容
代码生成报告包括:
这Summarysection that contains model and code information, including作者,,,,Tasking Mode,,,,System Target File,,,,Hardware Device Type和代码生成目标信息。这代码生成时的配置设置链接打开“配置参数”对话框的不可编辑视图。对话框在代码生成时显示了Simulink模型设置,万博1manbetx包括TLC选项。
这子系统报告section that contains information on nonvirtual subsystems in the model.
这代码Interface Report提供有关生成的代码接口的信息,包括模型入口点功能和输入/输出数据。有关更多信息,请参阅分析生成的代码接口。
In the代码关于内容窗格,您可以单击从模型生成的源代码文件的名称以查看其内容。
HTML Code Generation Report Location
这default location for the code generation report files is in thehtml
subfolder of the build folder,
。模型
_目标
_rtw/html/
是系统目标文件在代码生成窗格。顶级HTML报告文件的默认名称是目标
index.html
。有关构建文件夹位置的更多信息,请参见Manage Build Process Folders。
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创建代码生成报告在代码生成>报告顶部模型的窗格和每个引用模型。您可以通过以下两种方式之一打开引用模型的代码生成报告:
从顶级模型代码生成报告中,您可以通过单击生成代码上方的顶部模型的名称来访问引用的模型代码生成报告。在模型参考层次结构的下拉列表中,单击引用模型。要导航回到顶级模型代码生成报告,请使用后退左导航窗格顶部的按钮或使用模型参考层次结构上下文菜单。
在引用的模型图窗口中C Code选项卡,单击开放报告。
有关更多信息,请参阅生成模型参考层次结构的代码。
HTML Code Generation Report Extensions
如果您有嵌入式编码器®,,,,the code generator enhances the HTML code generation report. Configure your model to include these sections in the report:
这Traceability Report部分使您可以考虑消除 /虚拟块that are untraceable versus the listed可追溯的simuli万博1manbetxnk块 /状态流对象 / matlab脚本。This section provides a complete mapping between model elements and code. For more information, seeCustomize Traceability Reports。
这静态代码指标报告部分提供生成的代码统计信息。指标是根据生成代码的静态分析估算的。要生成静态代码指标报告而不生成代码生成报告,请使用该函数
coder.report.generatecodemetrics
。有关更多信息,请参阅静态代码指标。这代码更换报告部分使您可以考虑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, seeAnalyze Code Replacements in Generated Code。
这编码器假设section provides a list of:
代码generation assumptions for your target hardware that you can check.
Expected results for the assumption checks.
有关更多信息,请参阅检查代码生成假设。
模型Web视图在代码生成报告中显示一个交互式模型图,并支持源代码和模型之间的可追溯性。万博1manbetx然后,您可以在MATLAB环境之外共享模型和生成代码。有关更多信息,请参阅代码生成报告中模型的网络视图。
在内容pane, in the生成的文件部分,您可以单击从模型生成的源代码文件的名称,以在MATLAB中查看其内容®Web浏览器窗口。在显示的源代码中:
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代码与模型可追溯性。
如果启用模型对可追溯性,则可以导航到模型中的块的生成代码。有关更多信息,请参阅Model-to-Code Traceability。
如果您设置代码覆盖工具参数代码生成>Verificationpane, you can view the code coverage data and annotations. For more information, seeConfigure Code Coverage with Third-Party Tools。
If you select the生成静态代码指标check box on the代码生成>报告窗格,您可以查看代码指标信息,并导航到生成代码中的代码定义和声明。有关更多信息,请参阅View Static Code Metrics and Definitions Within the Generated Code。
笔记
要查看生成的代码的内容并在模型和代码之间导航,您也可以在“代码”角度使用代码视图。从角度来看,单击代码tab in the bottom-right corner.