1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
37
38 /*!
39 * ======== Load.xdc ========
40 * Load module.
41 *
42 * The Load module is used for calculating the CPU load of the DSP.
43 *
44 * The Load module provides an API (Load_getcpuload()) that returns the
45 * current CPU load. The CPU load is averaged over a period of time as
46 * specified by the 'window' variable within Load.c.
47 *
48 * It is necessary to do the following in order to use Load_getcpuload()
49 *
50 * (1) A BIOS IDL object which has its function set to '_Load_idlefxn' must
51 * exist. The code to do this has already been written for the user, and
52 * exists in 2 different files:
53 *
54 * a. ti/bios/utils/Load.tci
55 *
56 * If the user's app is built using Tconf, then this file must be
57 * included into the build by adding the following statement into the
58 * *.tcf file:
59 *
60 * @p(code)
61 * utils.importFile('Load.tci');
62 * @p
63 *
64 * b. ti/bios/utils/package.xs
65 *
66 * If the user's app is built using RTSC, then one must use the Load
67 * module. This is done by adding the following line to the *.cfg file:
68 *
69 * @p(code)
70 * var Load = xdc.useModule('ti.bios.utils.Load');
71 * @p
72 *
73 * NOTE: The two above mentioned methods are mutually exclusive. One can't
74 * use both method 'a' and method 'b' in the same program build, the
75 * user must choose the appropriate one for their build.
76 *
77 *
78 * (2) call 'Load_init()' from your application's main() program
79 *
80 * (3) call 'Load_getcpuload()' to return the CPU load as averaged over
81 * the pre-compiled window. This window can be changed by modifying
82 * the Load_WINDOW value in this file and recompiling load.c.
83 *
84 * (4) compile Load.c and link it with your application.
85 *
86 *
87 * CAVEATS:
88 *
89 * (1) This implementation self-calibrates the shortest path through the
90 * IDL loop. It does this by keeping track of the shortest time between
91 * invocations of 'Load_idlefxn'. This relies on the fact that the
92 * IDL loop will execute at least 2 times in a row w/o being interrupted!
93 * In the unlikely event that is a problem for your application, you can
94 * measure the shortest path through the IDL loop using the profiler and
95 * set 'minloop' to this time. Note that the units of minloop are
96 * CLK_gethtime() units which are processor dependent; e.g., CPU/4 for
97 * 'C6211, CPU/(TDDR+1) for 'C54xx, CPU for C64P, etc..
98 */
99 metaonly module Load {
100 }
101
102 103 104 105 106 107 108 109
110 111 112
113