Main Content

showInstrumentationResults

Results logged by instrumented, compiled C code function

Syntax

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

Description

showInstrumentationResults('mex_fcn')opens the Code Generation Report, showing results from calling the instrumented MEX functionmex_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 specify. If you specify to include them in thebuildInstrumentedMexfunction, histograms are also included. 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.

showInstrumentationResultsmex_fcnandshowInstrumentationResultsmex_fcn -optionsare alternative syntaxes for opening the Code Generation Report.

When you callshowInstrumentationResults, a file namedinstrumentation/mex_fcn/html/index.htmlis created.mex_fcnis 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 selectOpen Outside MATLAB.showInstrumentationResultsreturns an error if the instrumentedmex_fcnhas not yet been called.

Input Arguments

mex_fcn

Instrumented MEX function created usingbuildInstrumentedMex.

options

Instrumentation results options.

-defaultDTT Default data type to propose for double or single data type inputs, whereTis either a numerictype object or one of the following:'remainFloat','double','single','int8','int16','int32','int64',“uint8”,'uint16','uint32', or'uint64'. If you specify anintoruint, signedness和字长intoruintvalue and a fraction length is proposed. The default isremainFloat, which does not propose any data types.
-nocode

Do not display MATLAB code in the printable report. Display only the tables of logged variables. This option only has effect in combination with the-printableoption.

-optimizeWholeNumbers

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

-percentSafetyMarginN

Safety margin for simulation min/max, whereNis a percent value.

-printable

Create and open a printable HTML report. The report opens in the system browser.

-proposeFL

提出部分长度为指定的单词长度s.

-proposeWL

Propose word lengths for specified fraction lengths.

Examples

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

Note

The logged results fromshowInstrumentationResultsare an accumulation of all previous calls to the instrumented MEX function. To clear the log, seeclearInstrumentationResults.

  1. Create a temporary directory, then import an example function from Fixed-Point Designer™.

    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 = complex(fi(zeros(n,1),T)); W = coder.Constant(fi(fidemo.fi_radix2twiddles(n),T));
  3. Generate an instrumented MEX function. Use the-ooption to specify the MEX function name.

    buildInstrumentedMextestfft-otestfft_instrumented...-args{x,W}-histogram
  4. Run a test bench to record instrumentation results. CallshowInstrumentationResultsto open a report. View the simulation minimum and maximum values, proposed fraction length, percent of current range, and whole number status by pausing over a variable in the report.

    fori=1:20 x(:) = 2*rand(size(x))-1; y = testfft_instrumented(x);endshowInstrumentationResultstestfft_instrumented...-proposeFL-percentSafetyMargin10

  1. View the histogram for a variable by clickingin theVariablestab.

    For information on the figure, refer to theNumericTypeScopereference page.

  2. Close the histogram display and then, clear the results log.

    clearInstrumentationResultstestfft_instrumented
  3. Clear the MEX function, then delete temporary files.

    cleartestfft_instrumented; tempdirObj.cleanUp;

Version History

Introduced in R2011b