For processor-in-the-loop (PIL) code execution profiling, you must create a timer object that provides details of the hardware-specific timer and associated source files. You can use theCode Replacement Toolor the code replacement library API to specify this hardware-specific timer.
To specify the timer with the Code Replacement Tool:
Open the Code Replacement Tool. In the Command Window, entercrtool
.
Create a new code replacement table. SelectFile>New table.
Create a new function entry. UnderTables List, right-click the new table. Then, from the context-menu, selectNew entry>Function.
In the middle view, select the new unnamed function.
On theMapping Informationpane:
From theFunctiondrop-down list, selectcode_profile_read_timer
.
Specify the count direction for your timer. For example, from theCount directiondrop-down list, selectUp
.
In theTicks per secondfield, specify the number of ticks per second for your timer, for example,1e+09
.
The default value is 0. In this case, the software reports time measurements in terms of ticks, not seconds.
In theConceptual functionsection, from theData typelist, selectuint8
,uint16
,uint32
, oruint64
.
In theFunction prototypesection, in theName字段中,指定一个替代函数名,前女友ample,MyTimer
.
ClickApply.
To validate the function entry, clickValidate entry.
On theBuild Informationpane, specify the required build information. See Specify build information inDefine Code Replacement Library Optimizations.
Save the table (Ctrl+S). When you save the table for the first time, use the Save As dialog box to specify the file name and location.
You must save the table in a location that is on the MATLAB®search path. For example, you can save this file in the folder for your subclass ofrtw.connectivity.Config
.
The software stores your timer information as a code replacement library table.
Assuming you save the table as
, in your subclass ofMyCrlTable
.mrtw.connectivity.Config
, add the following line:
setTimer(this,MyCrlTable)