metaonly module ti.bios.utils.Load

Load module

The Load module is used for calculating the CPU load of the DSP. [ more ... ]
XDCspec summary sourced in ti/bios/utils/Load.xdc
metaonly module Load {  ...
XDCscript usage meta-domain
var Load = xdc.useModule('ti.bios.utils.Load');
 
XDCspec declarations sourced in ti/bios/utils/Load.xdc
package ti.bios.utils;
 
metaonly module Load {
}
DETAILS
The Load module is used for calculating the CPU load of the DSP.
The Load module provides an API (Load_getcpuload()) that returns the current CPU load. The CPU load is averaged over a period of time as specified by the 'window' variable within Load.c.
It is necessary to do the following in order to use Load_getcpuload()
(1) A BIOS IDL object which has its function set to '_Load_idlefxn' must exist. The code to do this has already been written for the user, and exists in 2 different files:
a. ti/bios/utils/Load.tci
If the user's app is built using Tconf, then this file must be included into the build by adding the following statement into the *.tcf file:
         utils.importFile('Load.tci');
b. ti/bios/utils/package.xs
If the user's app is built using RTSC, then one must use the Load module. This is done by adding the following line to the *.cfg file:
         var Load = xdc.useModule('ti.bios.utils.Load');
NOTE: The two above mentioned methods are mutually exclusive. One can't use both method 'a' and method 'b' in the same program build, the user must choose the appropriate one for their build.
(2) call 'Load_init()' from your application's main() program
(3) call 'Load_getcpuload()' to return the CPU load as averaged over the pre-compiled window. This window can be changed by modifying the Load_WINDOW value in this file and recompiling load.c.
(4) compile Load.c and link it with your application.
CAVEATS:
(1) This implementation self-calibrates the shortest path through the IDL loop. It does this by keeping track of the shortest time between invocations of 'Load_idlefxn'. This relies on the fact that the IDL loop will execute at least 2 times in a row w/o being interrupted! In the unlikely event that is a problem for your application, you can measure the shortest path through the IDL loop using the profiler and set 'minloop' to this time. Note that the units of minloop are CLK_gethtime() units which are processor dependent; e.g., CPU/4 for 'C6211, CPU/(TDDR+1) for 'C54xx, CPU for C64P, etc..
generated on Mon, 20 Sep 2010 23:50:09 GMT