Texas Instruments TMS320 User Manual page 92

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Implicit DSP/BIOS Instrumentation
3.6.1.1 Measuring the CPU Load
Example 3-3. The Idle Loop
3-30
You can rewrite this equation:
t
w
×
CPUload
=
--------------
100
t
+
t
w
i
You can also express CPU load using instruction cycles rather than time
intervals:
c
w
×
CPUload
=
----------------
100
c
+
c
w
i
In a DSP/BIOS application, the CPU is doing work when any of the following
are occurring:
❏ hardware interrupts are serviced
❏ software interrupts and periodic functions are run
❏ task functions are run
❏ user functions are executed from the idle loop
❏ HST channels are transferring data to the host
❏ real-time analysis data is uploaded to the DSP/BIOS Analysis Tools
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.
'Idle_loop:
Perform IDL_cpuLoad
Perform all other IDL functions (user/system functions)
Goto IDL_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
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
, the total number of instruction cycles spent executing the loop is
1
are spent
w

Advertisement

Table of Contents
loading

Table of Contents