Skip to Main Content Skip to Search
Product Documentation

showInstrumentationResults - Results logged by instrumented MEX function

Syntax

showInstrumentationResults('mex_fcn')
showInstrumentationResults ('mex_fcn' '-options')
showInstrumentationResults mex_fcn
showInstrumentationResults mex_fcn -options

Description

showInstrumentationResults('mex_fcn') opens the Code Generation Report, showing results from calling the instrumented MEX function mex_fcn. Hovering over variables and expressions in the report displays the logged information. The logged information includes minimum and maximum values, proposed fraction or word lengths, percent of current range, and whether the value is always a whole number, depending on which options you speciify. The same information is displayed in a summary table in the Variables tab.

showInstrumentationResults ('mex_fcn' '-options') specifies options for the instrumentation results section of the Code Generation Report.

showInstrumentationResults mex_fcn and showInstrumentationResults mex_fcn -options are alternative syntaxes for opening the Code Generation Report.

When you call showInstrumentationResults, a file named instrumentation/mex_fcn/html/index.html is created. mex_fcn is the name of the corresponding instrumented MEX function. Selecting this file opens a web-based version of the Code Generation Report. To open this file from within MATLAB, right-click on the file and select Open Outside MATLAB. showInstrumentationResults returns an error if the instrumented mex_fcn has not yet been called.

Input Arguments

mex_fcn

Instrumented MEX function created using buildInstrumentedMex.

options

Instrumentation results options.

-browser

Open the instrumentation results in a system web browser window. Use this option to open multiple reports so you can compare results.

-optimizeWholeNumbers

Optimize the word length of variables whose simulation min/max logs indicate that they are always whole numbers.

-percentSafetyMargin N

Safety margin for simulation min/max, where N is a percent value.

-printable

Create and open a printable HTML report.

-proposeFL

Propose fraction lengths for specified word lengths. This option is valid only for fi objects with scaled double data types.

-proposeWL

Propose word lengths for specified fraction lengths. This option is valid only for fi objects with scaled double data types.

Examples

Generate an instrumented MEX function, then run a test bench. Call showInstrumentationResults to open the Code Generation Report.

  1. Create a temporary directory, then import a demo function from Fixed-Point Toolbox.

    tempdirObj=fidemo.fiTempdir('showInstrumentationResults')
    copyfile(fullfile(matlabroot,'toolbox','fixedpoint',...
       'fidemos','fi_m_radix2fft_withscaling.m'),...
       'testfft.m','f')
    
  2. Define prototype input arguments.

    T = numerictype('DataType','ScaledDouble','Scaling',...
       'Unspecified');
    n = 128;
    x = fi(zeros(n,1),T);
    W = coder.Constant(fi(fidemo.fi_radix2twiddles(n),T));
  3. Generate an instrumented MEX function. Use the -o option to specify the MEX function name.

    buildInstrumentedMex testfft -o testfft_instrumented...
       -args {x,W}
  4. Run a test bench to record instrumentation results. Call showInstrumentationResults to open the Code Generation Report. View the simulation minimum and maximum values, proposed fraction length, percent of current range, and whole number status by hovering over a variable in the report.

    for i=1:20
       x(:) = 2*rand(size(x))-1;
       y = testfft_instrumented(x);
    end
    
    showInstrumentationResults testfft_instrumented...
       -proposeFL -percentSafetyMargin 10

  1. Clear the results log.

    clearInstrumentationResults testfft_instrumented
  2. Clear the MEX function, then delete temporary files.

    clear testfft_instrumented;
    tempdirObj.cleanUp;

See Also

buildInstrumentedMex | clearInstrumentationResults | codegen | fiaccel | mex

  


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-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS