User`s guide
Implicit DSP/BIOS Instrumentation
3-22
When the CPU is not performing any of those activities, it is going through the
idle loop, executing the IDL_cpuLoad function, and calling the other DSP/
BIOS IDL objects. In other words, the CPU idle time in a DSP/BIOS
application is the time that the CPU spends doing the routine in Example 3-3.
To measure the CPU load in a DSP/BIOS application over a time interval T, it
is sufficient to know how much time was spent going through the loop, shown
in Figure 3-3, and how much time was spent doing application work.
Example 3-3. The Idle Loop
Over a period of time T, a CPU with M MIPS (million instructions per second)
executes M x T instruction cycles. Of those instruction cycles, c
w
are spent
doing application work. The rest are spent executing the idle loop shown in
Example 3-3. If the number of instruction cycles required to execute this loop
once is l
1
, the total number of instruction cycles spent executing the loop is
N x l
1
where N is the number of times the loop is repeated over the period T.
Hence, you have total instruction cycles equals work instruction cycles plus
idle instruction cycles.
From this expression you can rewrite c
w
as:
3.4.2.2 Calculating the Application CPU Load
Using the previous equations, you can calculate the CPU load in a DSP/BIOS
application as:
To calculate the CPU load you need to know l
1
and the value of N for a chosen
time interval T, over which the CPU load is being measured.
The IDL_cpuLoad object in the DSP/BIOS idle loop updates an STS object,
IDL_busyObj, that keeps track of the number of times the IDL_loop runs, and
the time as kept by the DSP/BIOS high-resolution clock (see section 4.8,
Timers, Interrupts, and the System Clock, page 4-67). This information is
used by the host to calculate the CPU load according to the equation above.
’Idle_loop:
Perform IDL_cpuLoad
Perform all other IDL functions (user/system functions)
Goto IDL_loop’
--------- ×
------------------------ ×
---------
×










