main content

results logged by instrumented, compiled c code function -凯发k8网页登录

results logged by instrumented, compiled c code function

description

showinstrumentationresults('mex_fcn') opens the instrumentation report viewer, 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 specify. if you specify to include them in the buildinstrumentedmex function, histograms are also included. the same information is displayed in a summary table in the variables tab.

when you call showinstrumentationresults, a file named instrumentation/mex_fcn/html/printable.html is created. mex_fcn is the name of the corresponding instrumented mex function. selecting this file opens a web-based version of the instrumentation report viewer. to open this file from within matlab®, right-click on the file and select open outside matlab.

the showinstrumentationresults function returns an error if the instrumented mex_fcn has not yet been called.

note

the logged results from the showinstrumentationresults function are an accumulation of all previous calls to the instrumented mex function. to clear the log, see clearinstrumentationresults.

showinstrumentationresults('mex_fcn','-options') specifies options for the instrumentation results section of the instrumentation report viewer.

example

showinstrumentationresults mex_fcn and showinstrumentationresults mex_fcn -options are alternative syntaxes for opening the instrumentation report viewer.

examples

this example shows how to create an instrumented mex function, run a test bench, then view logged results.

define prototype input arguments.

n = 128;
x = complex(zeros(n,1));
w = fi_radix2twiddles(n);

generate an instrumented mex function. use the -o option to specify the mex function name. use the -histogram option to compute histograms.

if you have a matlab® coder™ license, you can also add the -coder option. in this case,

buildinstrumentedmex testfft -o testfft_instrumented -args {x,coder.constant(w)} -histogram

if you have a matlab® coder™ license, you can also add the -coder option. for example,

buildinstrumentedmex testfft -coder -o testfft_instrumented -args {x,w}

like the fiaccel function, the buildinstrumentedmex function generates a mex function. to generate c code, use the matlab® coder™ codegen function.

run a test file to record instrumentation results. use the showinstrumentedmex function to open the report. to view the simulation minimum and maximum values and whole number status, pause over a variable in the report. you can also see proposed data types for double precision numbers in the table.

for i=1:20
   y = testfft_instrumented(randn(size(x)),w);
end
showinstrumentationresults testfft_instrumented

instrumentation-report-tb1.png

close the histogram display, then use the clearinstrumentationresults function to clear the results log.

clearinstrumentationresults testfft_instrumented

run a different test bench, then view the new instrumentation results.

for i=1:20
   y = testfft_instrumented(cast(rand(size(x))-0.5,'like',x),w);
end
showinstrumentationresults testfft_instrumented

instrumentation-report-tb2.png

to view the histogram for a variable, click the histogram icon in the variables tab.

numeric-type-scope-x-tb2.png

close the histogram display, then use the clearinstrumentationresults function to clear the results log.

clearinstrumentationresults testfft_instrumented

clear the mex function.

clear testfft_instrumented

input arguments

instrumented mex function created using buildinstrumentedmex.

instrumentation results options, specified as:

-defaultdt t

default data type to propose for double or single data type inputs, where t is either a numerictype object or one of the following: 'remainfloat' (default), 'double', 'single', 'int8', 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32', or 'uint64'.

if you specify an int or uint, the signedness and word length are that int or uint value and a fraction length is proposed.

the default is remainfloat, 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 -printable option.

-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. the report opens in the system browser.

-proposefl

propose fraction lengths for specified word lengths.

-proposewl

propose word lengths for specified fraction lengths.

version history

introduced in r2011b
网站地图