Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Constantinides G.A., Cheung P.Y.K., Luk W. - Synthesis and optimization of DSP algorithms (2004)(en).pdf
Скачиваний:
23
Добавлен:
15.08.2013
Размер:
1.54 Mб
Скачать

24 3 Peak Value Estimation

require p = 2. However such ranges are overly pessimistic. The upper output in Fig. 3.4 is clearly seen to have the value y1 = 2.1x1 1.8(x1 + x2) = 0.3x1 1.8x2. Thus the range of this output can also be calculated as 0.3(0.6, 0.6) 1.8(0.6, 0.6) = (1.26, 1.26). Similarly for the lower output y2 = 1.6x2 + 1.8(x1 +x2) = 1.8x1 +0.2x2, providing a range 1.8(0.6, 0.6)+0.2(0.6, 0.6) = (1.2, 1.2). Thus by examining the global system behaviour, we can see that in reality p = 1 is su cient for both outputs. Note that the analytic scheme described in Section 3.1.1 would calculate the tighter bound in this case.

In summary, range-propagation techniques may provide larger bounds on signal values than those absolutely necessary. This problem is seen in extremis with any recursive computation graph. In these cases, it is impossible to use range-propagation to place a finite bound on signal values, even in cases when such a finite bound can analytically be shown to exist.

3.2 Simulation-based Peak Estimation

A completely di erent approach to peak estimation is to use simulation: actually run the algorithm with a provided input data set, and measure the peak value reached by each signal.

In its simplest form, the simulation approach consists of measuring the peak signal value Pj reached by a signal j S and then setting p =log2 kPj + 1, where k > 1 is a user-supplied ‘safety factor’ typically having value 2 to 4. Thus it is ensured that no overflow will occur, so long as the

ˆ

signal value doesn’t exceed Pj = kPj when excited by a di erent input sequence. Particular care must therefore be taken to select an appropriate test sequence.

Kim and Kum [KKS98] extend the simulation approach by considering more complex forms of ‘safety factor’. In particular, it is possible to try to extract information from the simulation relating to the class of probability density function followed by each signal. A histogram of the data values for each signal is built, and from this histogram the distribution is classified as: unimodal or multimodal, symmetric or non-symmetric, zero mean or non-zero mean.

For a unimodal symmetric distribution, Kim and Kum propose the heur-

ˆ

= j | + (κj + 4)σj , where µj

is the sample mean, κj

istic safety scaling Pj

is the sample kurtosis, and σj is the sample standard deviation (all measured during simulation).

For multimodal or non-symmetric distrubtion, the heuristic safety scaling

ˆ

99.9%

100%

99.9%

p%

represents

Pj = Pj

+ 2(Pj

− Pj

), has been proposed where Pj

the simulation-measured p’th percentile of the sample.

In order to partially alleviate the dependence of the resulting scaling on the particular input data sequence chosen, it is possible to simulate with several di erent data sets. Let the maximum and minimum values of the standard deviation (over the di erent data sets) be denoted σmax and σmin respectively.

3.4 Summary

25

Then the proposal of Kim and Kum [KKS98] is to use the heuristic estimate σ = 1.1σmax 0.1σmin. A similar approach is proposed for the other collected statistics.

Simulation approaches are appropriate for nonlinear or time-varying systems, for which the data-range propagation approach described in Section 3.1.2 provides overly pessimistic results (such as for recursive systems). The main drawback of simulation-based approaches is the significant dependence on the input data set used for simulation; moreover no general guidelines can be given for how to select an appropriate input.

3.3 Hybrid Techniques

Simulation can be combined with data-range propagation in order to try and combine the advantages of the two techniques [CRS+99, CH02].

A pure simulation, without ‘safety factor’, may easily underestimate the required data range of a signal. Thus the scaling resulting from a simulation can be considered as a lower-bound. In contrast, a pure data-range propagation will often significantly overestimate the required range, and can thus be considered as an upper-bound. Clearly if the two approaches result in an identical scaling assignment for a signal, the system can be confident that simulation has resulted in an optimum scaling assignment. The question of what the system should do with signals where the two scalings do not agree is more complex.

Cmar et al. [CRS+99] propose the heuristic distinction between those simulation and propagation scalings which are ‘significantly di erent’ and those which are not. In the case that the two scalings are similar, say di erent by one bit position, it may not be a significant hardware overhead to simply use the upper-bound derived from range propagation.

If the scalings are significantly di erent, one possibility is to use saturation arithmetic logic to implement the node producing the signal. When an overflow occurs in saturation arithmetic, the logic saturates the output value to the maximum positive or negative value representable, rather than causing a two’s complement wrap-around e ect. In e ect the system acknowledges it ‘does not know’ whether the signal is likely to overflow, and introduces extra logic to try and mitigate the e ects of any such overflow. Saturation arithmetic will be considered in much more detail in Chapter 5.

3.4 Summary

This chapter has covered several methods for estimating the peak value that a signal can reach, in order to determine an appropriate scaling for that signal, resulting in an e cient representation. We have examined both analytic

26 3 Peak Value Estimation

and simulation-based techniques for peak estimation, and review hybrid approaches that aim to combine their strengths. We shall illustrate the combination of such techniques with word-length optimization approaches in the next chapter.