3 interrupt latency, 4 execution time, 1 mips is not enough – Texas Instruments TMS320 DSP User Manual

Page 41: Time, Enough

Advertising
background image

www.ti.com

4.3

Interrupt Latency

4.4

Execution Time

4.4.1 MIPS Is Not Enough

Interrupt Latency

Code

Code Sections

Size

Align

a.obj(.text)

768

0

b.obj(.text)

125

32

In most DSP systems, algorithms are started by the arrival of data and the arrival of data is signaled by an
interrupt. It is very important, therefore, that interrupts occur in as timely a fashion as possible. In
particular, algorithms should minimize the time that interrupts are disabled. Ideally, algorithms would never
disable interrupts. In some DSP architectures, however, zero overhead loops implicitly disable interrupts
and, consequently, optimal algorithm efficiency often requires some interrupt latency.

Guideline 9

Interrupt latency should never exceed 10µs.

Rule 23

All algorithms must characterize their worst-case interrupt latency for every operation.

All algorithms must characterize their interrupt latency by filling out a table such as that shown below. The
interrupt latency must be expressed in units of instruction cycles. Note that the entry in this table is not
required to be a constant; it may be function of the algorithm's instance creation parameters. Each row of
the table corresponds to a method of the algorithm.

Operation

Worst-Case Latency (Instruction Cycles)

process()

300

In practice, the interrupt latency may also depend on the type of memory allocated to an algorithm
instance. Since this relationship can be extremely complex, interrupt latency should be measured for a
single fixed configuration. Thus, this number must be the latency imposed by an algorithm instance using
the same memory configuration used to specify worst-case MIPS and memory requirements.

In this section, we examine the execution time information that should be provided by algorithm
components to enable system integrators to assemble combinations of algorithms into reliable products.
We first point out the challenges and then describe a simple model that, while not perfect, will significantly
improve our ability to integrate algorithms into a system.

It is important to realize that a simple MIPS calculation is far from sufficient when combining multiple
algorithms. It is possible, for example, for two algorithms to be "unschedulable" even though only 84% of
the available MIPS are required. In the worst case, it is possible for a set of algorithms to be
unschedulable although only 70% of the available MIPS are required!

Suppose, for example, that a system consists of two tasks A and B with periods of 2 ms and 3 ms
respectively. Suppose that task A requires 1 ms of the CPU to complete its processing and task B also
requires 1 ms of the CPU. The total percentage of the CPU required by these two tasks is approximately
83.3%; 50% for task A plus 33.3% for task B.

SPRU352G – June 2005 – Revised February 2007

Algorithm Performance Characterization

41

Submit Documentation Feedback

Advertising