Main Content

Report Generation

Generate reports and obtain description of code generation results

With an HTML code generation report you can view the source files of the generated code and analyze information about the generated code such as code generation objectives, subsystems, code interface, and state code metrics. The code generation report provides traceability between the code and elements of the model. Include a Web view of the model to share your model and generated code outside of the MATLAB environment.

View meta information about the generated code by using the Code Descriptor API. The Code Descriptor API describes the data interfaces, function interfaces, parameters and global data stores in the generated code.

Classes

expand all

coder.codedescriptor.CodeDescriptorReturn information about generated code
coder.descriptor.DataInterfaceReturn information about different types of data interfaces
coder.descriptor.FunctionInterfaceReturn information about entry-point functions
coder.descriptor.LookupTableDataInterfaceReturn information about Lookup Table blocks that have tunable parameters
coder.descriptor.BreakpointDataInterfaceReturn information about tunable breakpoint set data for a lookup table that has tunable parameters
coder.descriptor.FixAxisMetadataAbstract class to get breakpoint set data information
coder.descriptor.EvenSpacingMetadataReturn information about evenly spaced breakpoint set data
coder.descriptor.NonEvenSpacingMetadataReturn information about non-evenly spaced breakpoint set data

Functions

expand all

rtwreportCreate generated code report for model with Simulink Report Generator
coder.report.openOpen existing HTML code generation report
coder.report.generateGenerate HTML code generation report
coder.report.generateCodeMetricsGenerate static code metrics report
coder.report.closeClose HTML code generation report
getCodeDescriptorCreate coder.codedescriptor.CodeDescriptor object for model
getAllDataInterfaceTypesReturn data interface types
getAllFunctionInterfaceTypes Return function interface types
getArrayLayout Return array layout of the generated code
getDataInterfaces Return information of the specified data interface
getDataInterfaceTypesReturn data interface types in the generated code
getFunctionInterfacesReturn information of the specified function interface
getFunctionInterfaceTypesReturn function interface types in the generated code
getReferencedModelCodeDescriptorReturn coder.codedescriptor.CodeDescriptor object for the specified referenced model
getReferencedModelNamesReturn names of the referenced models
isLookupTableDataInterfaceDetermine whether object is a coder.descriptor.LookupTableDataInterface object
getAllParameters Return all associated coder.descriptor.LookupTableDataInterface and coder.descriptor.BreakpointDataInterface objects
isBreakpointDataInterfaceDetermine whether object is a coder.descriptor.BreakpointDataInterface object

Topics

Report Generation

Reports for Code Generation

Access the generated code files and information about the generated code with the code generation report.

Generate a Code Generation Report

When the model is built, generate an HTML code generation report for analyzing the generated code.

Generate Code Generation Report After Build Process

After generating code, you can generate an HTML code generation report without rebuilding your model.

Open Code Generation Report

You can refer to existing code generation reports at any time.

Generate Code Generation Report Programmatically

At the MATLAB® command line, you can generate, open, and close an HTML Code Generation Report with the following functions:

Package and Share the Code Generation Report

To share the code generation report, you can package the code generation report files and supporting files into a zip file for transfer.

Web View of Model in Code Generation Report

Include a Web view of the model to share your model and generated code outside of the MATLAB environment.

Analyze Generated Code

Analyze the Generated Code Interface

Use the code interface report to see documentation of the generated code interface, including model entry-point functions and interface data, for consumers of the generated code.

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.

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.

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.

Check Code Generation Assumptions

Use standalone workflow to check code generator assumptions.

Document Generated Code with Simulink Report Generator

Explains how to use the Simulink® Report Generator™ software to generate a detailed report for a code generation project.

Related Information

Featured Examples