Products & Services Solutions Academia Support User Community Company

Learn more about Fixed-Point Toolbox   

Working with Fixed-Point Compilation Reports

Generating the Compilation Report

When you compile your M-code with the Embedded MATLAB emlmex function or the Real-Time Workshop emlc function, you can use the -report option to generate a compilation report. This compilation report allows you to examine the data types of the variables and expressions in your code.

To see an example of the compilation report generated by the emlmex function, compile cordic_atan_fixpt.m. This file ships as a part of the Fixed-Point ATAN2 Calculation demo. You can open the M-file by typing the following at the MATLAB command line:

open cordic_atan_fixpt

To compile the cordic_atan_fixpt.m file, you must provide inputs x, y, N, and angleLUT. This example uses the following input values:

x = fi(0.23);
y = x;
N = 12;
Tz = numerictype(1,16,13);
angleLUT = fi(atan(2.^-(0:N-1)), 'NumericType', Tz);

After you define the input variables in the MATLAB workspace, change your working folder to a local folder and compile the M-file using emlmex. Use the -report option to generate the compilation report:

emlmex cordic_atan_fixpt -eg {x,y,N,angleLUT} -report

Opening the Compilation Report

If the compilation is successful, you receive the following message:

Click the Open coder report link to view the report.

If the compilation fails, a link to the error report appears:

Click the Open error report link to view the error report and debug your code. For more information on working with error reports, see Working with Compilation Reports in the Embedded MATLAB subset documentation.

Viewing Your M-Code

When the compilation report opens, you can hover your cursor over the variables and expressions in your M-code to see their data type information. The compilation report provides color-coded data type information according to the following legend.

ColorMeaning
GreenData type information is available for the selected variable at this location in the code.
OrangeThere is a warning message associated with the selected variable or expression.
PinkNo data type information is available for the selected variable.
PurpleData type information is available for the selected expression at this location in the code.
RedThere is an error message associated with the selected variable or expression.

Variables in your M-code that have data type information available appear highlighted in green, as shown in the following figure.

Expressions in your M-code that have data type information available appear highlighted in purple, as the next figure shows.

Viewing Variables in the Variables Tab

To see the data type information for all the variables in your M-file, click on the Variables tab of the compilation report. You can expand all fi and fimath objects listed in the Variables tab to display the properties of the associated fimath object, as shown in the following figure.

You can sort the variables by clicking the column headings in the Variables tab. To sort the variables by multiple columns, hold down the Shift key while clicking on the column headings.

See Also

For more information about using the compilation report with the emlmex function, see Working with Compilation Reports in the Embedded MATLAB documentation.

For information about using the compilation report with the emlc function, see Working with Compilation Reports in the Real-Time Workshop documentation.

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS