• No results found

Reduce the operation latency in the critical loop. derived form the original algorithm.

N/A
N/A
Protected

Academic year: 2021

Share "Reduce the operation latency in the critical loop. derived form the original algorithm."

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

1

Maximal Sample Rate

The maximal sample rate of an algorithm is determined only by its recur- sive parts. The minimal sample period for a recursive algorithm that is described by a fully specified signal-flow graph is where T

opi

is the total latency of the arithmetic operations, etc. and N

i

is

the number of delay elements in the directed loop i. Nonrecursive parts of the signal-flow graph, e.g., input and output branches, generally do not limit the sample rate, but to achieve this limit additional delay elements may have to be introduced into the nonrecursive branches.

T min max T opi N i -   i = DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

The minimal sample period is also referred to as the

iteration period bound

.

Loops that yield

Tmin

are called

critical loops

.

The signal-flow graph has two loops. Loop 1 is the critical loop if otherwise loop 2 is the critical loop. The iteration period bound is of course not possible to improve for a given algorithm. However, a new algorithm with a higher bound can often be derived form the original algorithm. We recognize that there are two possibilities to improve the bound. • Reduce the operation latency in the critical loop. • Introduce additional delay elements into the loop

Q T T x(n) y(n) Loop 1 Loop 2 b1 b2 T b 2 2 T add T Q ++ 2 -T b 1 T add T q ++ 1 -< DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

3

Example 6.5 The 3rd-order LWDF has been implemented by Siemens using so-called redundant, bit-parallel arithmetic in which long carry propagations are avoided. The adaptor coefficient is

α

= 0.375 = (0.011)

2

. The results

obtained using a 2-µm, double metal CMOS process were Input data word length, 8 bit Output data word length, 11 bit Maximal sample rate,

35 MHz

Number of devices,

9000

Power consumption, 150 mW Chip area, 14.7 mm

2 (including pads)

The filter is a lowpass filter but it can also be used as a highpass filter, as well as for decimation or interpolation of the sample frequency by a factor two, with minor changes in the hardware.

T T T #4 – + #1 #2 #3 #5 y(n) x(n) α DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

OUR IMPLEMENTATION Assume here that the

data word length is 12 bit

and that the filter is

imple-mented with

bit-serial arithmetic

using so-called

true single-phase logic

(

TSPC

).

This type of logic is modeled by

model 1

, i.e., the latencies for addition,

subtraction, and multiplication in this logic style are one clock cycle longer than the theoretical minimum. Thus, we have

Tadd

= 1 clock cycle and

Tmult

= 4 clock cycles.

The delay (latency) due to the arithmetic operations in the recursive loop is

Top = 2 Tadd + Tmult = 6 clock cycles

and the number of delay elements in the loop is

Ni

= 2. Hence, we get the

iteration period bound

clock cycles

T min

6 ---3 2

(2)

DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

5

The bit-serial implementation must therefore have a clock frequency of at least 105 MHz to be as fast as the implementation using bit-parallel, redundant arithmetic. This represents a relatively modest clock frequency. ALTERNATIVE IMPLEMENTATION Using a static logic style, i.e., model 0, having minimum latencies

Tadd

=

0 clock cycle and

Tmult

= 3 clock cycles, we get

clock cycles/sample

Note that the length of the clock cycles are different between the two mod- els. In practice, the implementation corresponding to model 1 may be the fast- est, because of shorter propagations paths between the memory elements.

f samplemax 1 T min -f CL --- 3 -== T min 2 T add T mult + 2 -20 3 + ⋅ 2 -1 .5 == = DSP Integrated Circuits

Department of Electrical Engineering

[email protected] Lars Wanhammar Linköping University http://www.es.isy.liu.se/ 6

EQUIVALENCE TRANSFORMATIONS

Theor em 6.3

If an arbitrary, nonlinear, time-varying discrete time network,

Nn

, has

delay elements in series with all inputs (outputs), then all the delays can be moved to the outputs (inputs) and the properties of

Nn

shifted, without

changing the input–output behavior of the composite system. Nn

and

Nn

+ 1

denote the properties of the network with reference to

sam-ple n and n +1, respectively. T T T T T Nn Nn+1 DSP Integrated Circuits

Department of Electrical Engineering

[email protected] Lars Wanhammar Linköping University http://www.es.isy.liu.se/ 7 Essentially Equi valent Netw orks

Two networks that can be transformed into one another by the equivalence transformations just described, except for different (positive or negative) delays appearing in their input and output branches, are called

essentially

equivalent

networks.

A delay element can not be propagated into a recursive loop. However, the positions of the delay elements in a recursive loop can be changed as shown in example below. The latency of the algorithm may be affected by such a change, but the maxi- mal sample rate is unaffected.

T/2 T/2 A2 = 0 T T/2 A2 = 0 T/2 T/2 DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

8

INTERLEAVING AND PIPELINING

The throughput of a recursive algorithm is always bounded by the critical loop(

s

).

However, input, output, and other non-recursive branches and parts of loops in the signal-flow graph may have a critical path with a computation time longer than

Tmin

.

In that case, the critical path(

s

) will limit the sample rate.

(3)

DSP Integrated Circuits

Department of Electrical Engineering

[email protected] Lars Wanhammar Linköping University http://www.es.isy.liu.se/ 9

INTERLEAVING

Consider a sequential algorithm with three processes. The throughput is the reciprocal of the length of the critical path,

TCP

.

The throughput can be increased if the three processes

P1 , P2 , and P3 are

mapped onto three processors – interleaving at the process level The throughput is increased by a factor three, but the latency remains the same.

P1 P3 P2 x(n) y(n) TCP P1 P3 P2 x(n) y(n) P1 P3 P2 P1 P3 P2 y(n–1) x(n–2) y(n–2) TSample PE 3 PE 2 PE 1 x(n–1) DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

10

Interleaving of the computations can be used to increase the throughput of a sequential algorithm by an arbitrarily large amount. However, it requires a corresponding increase in resources since opera- tions corresponding to several different time indices must be computed concurrently. Interleaving is an inefficient technique in terms of resources since the three processors must be capable of executing all processes and no spe- cialization is possible. Example A shift-register represent an algorithm with sequential storings and shifting of bits. Advantages?

B1 B3 B2 x(n) y(n) x(n) MUX y(n) MUX D FF D FF D FF DSP Integrated Circuits

Department of Electrical Engineering

[email protected] Lars Wanhammar Linköping University http://www.es.isy.liu.se/ 11

Pipelining

Pipelining, which is another method of increasing the throughput of a sequential algorithm, can be used if the application permits the algorith- mic delay to be increased. This is usually the case when the system (algorithm) is not inside a recur- sive loop, but there are many cases when the algorithmic delay must be kept within certain limits. Pipelining of the three processes is accomplished by propagating algorith- mic delay elements into the original critical path so that a set of new and shorter critical path(s) is obtained. Ideally the critical path should be broken into paths of equal length.

x(n) P1 P3 P2 TCP T T TCP TCP y(n–2) DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

12

For each of the three processors a new computation can begin as soon as the results of the current computations are stored in the corresponding (output) delay elements. At steady state, three successive output value computations are performed concurrently. Throughput is the reciprocal of the longest critical path, i.e., the same throughput as with interleaving. The differences between interleaving and pipelining are that in the latter case

the output is delayed by two sample periods

and that the amount of

required resources is reduced.

x(n) P1 P3 P2 TCP T T TCP TCP y(n–2)

(4)

DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

13

In pipelining, each PE operates on different processes while in interleav- ing a PE operates on every

n

th sample.

The number of PEs is still three, but each PE is now required to execute only one process per sample period. Hence a specialized, and thereby less expensive, PE may be used for each process. Pipelining can be applied to sequential algorithms at any level of abstrac- tion. Typically, both basic DSP algorithms and arithmetic operations are pipe- lined. At the digital circuit level pipelining corresponds to inserting latches between different circuit levels so that each level has the same transistor depth. Note that parallelism in a structure is a fundamental property and can not be changed. By inserting delay elements into the critical path (for example, by pipelin- ing)

a new structure

with a higher degree of parallelism is obtained.

DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

14

Example 6.9 The structure is completely sequential with respect to the operations. The length of the critical path, which is equal to the latency, is

T T x(n) c1 H1 v1 (n) H2 c2 v2 (n) y0 (n) v2 (n–1) v1 (n–1) x(n) c1 c2 v1 (n) y0 (n) N4 N1 N2 N3 N5 T CP 2 T add T mult + () = DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

15

Note that all operations lie on the critical path. The transfer function is

, |

z | >

R+

where

and

The original filter,

H0

(z

), is now cascaded with a single delay element. A

cascaded delay element will increase the group delay by a constant factor, T. We get

, | z | > R+ H 0 z() H 2 z() H 1 z() = H 1 z() c 1 1 c 1 z 1 – – -= H 2 z() c 2 1 c 2 z 1 – – -= H p z() H 0 z() z 1 – z 1 – H 2 z() H 1 z() == DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

16

The order of the linear, shift-invariant filters and the delay element can be interchanged. Hence, we get The signal-flow graph for the new, pipelined structure is.

H p z() H 2 z() z 1 – H 1 z() c 2 1 c 2 z 1 – – ---z 1 – c 1 1 c 1 z 1 – – -== T T x(n) c1 H1 v1 (n) H2 c2 v2 (n) yp (n) T T T x(n) c1 H1 v1 (n) H2 c2 v2 (n) yp (n)

(5)

DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

17

The maximal sample rate is determined by the recursive loops. The mini- mal iteration period bound for both loops is The precedence graph has two equally long critical paths of length

Tmin

.

The new algorithm has a higher degree of par- allelism compared to the original structure which is completely sequential. The throughput is twice that of the original algorithm. The algorithmic delay has increased, but the latency has remained the same.

T min T add T mult + = x(n) v1 (n–1) c1 c2 v2 (n–1) v1 (n) yp (n) N1 N2 N3 y p n() y 0 n 1 – () = DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

Structural Pipelines

In classical pipelines, only one operation is executed by each pipeline stage (PE) separated by registers (delay elements). A PE is allocated to each stage of the pipeline. The pipeline stages do not share resources. This leads to a fixed and sim- ple communication pattern between the processors. This case is often referred to as a

structural pipeline . T P1 P2 T P3 PE 1 D PE 2 D PE 3 x( n) y( n–2) y( n–2) x( n) DSP Integrated Circuits

Department of Electrical Engineering

[email protected] Lars Wanhammar Linköping University http://www.es.isy.liu.se/ 19

Functional Pipelines

A more general case is to partition the pipeline stages into several smaller subtasks (operations) that are subsequently mapped onto a hardware struc- ture. The operations can of course be executed by a structural pipeline, but a more efficient way to organize the hardware structure in terms of utiliza- tion of the resources is to

allow the pipeline stages to share resources

.

That is, operations within a pipeline stage are not bounded to a particular PE, and opera- tions that are not concurrent may share resources. Functional

pipelining

is used

to increase the parallelism in the algorithm so that the oper- ations may be scheduled more freely.

T P1 P2 P3 T *** +++ +++ PE 3 PE 2 PE 1 PE 3 PE 2 PE 1 x(n) x(n) y(n–2) y(n–2)

ALGORITHM SCHEDULING RESOURCES

DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

INTERPOLATOR, CONT.

In order to schedule the opera- tions and determine the neces- sary amount of computational resources for the interpolator, we first need to determine the precedence relations for the operations. We choose to use the adaptors as atomic operations, i.e., an operation with three inputs (two data and one coefficient) and two output values. First, we draw the wave-flow graph without switches to demonstrate the algorithm more clearly.

T 3 T 2 T 5 T 4 T 7 T 6 T 1 T 12 T 11 21 22 T T 16 17 18 19 T T 13 14 20 T 15 9 8 10 T T T x( n ) –1 –1 –1 –1 –1 –1 –1 –1 –1 –1 –1 –1 –1 –1 –1 –1 –1 –1 y(4 m y(4 m y(4 m y(4 –1 –1 –1

(6)

DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

21

Adaptors that have valid inputs can be executed immediately. In the first time slot, only adaptors 1, 3, 5, and 7 have valid inputs. Only adaptor 2 can be executed in the second time slot, and so on. Altogether, 11 time slots are required to complete the whole filter. The number of concurrent operations ranges between 1 and 4. The average number is only 2 adaptors/time slot.

1 2 3 5 7 4 6 11 8 12 91 0 13 14 15 18 19 20 16 17 21 22 N1 N2 N3 N4 N5 N6 N7 N9 N8 N10 N11 z –1 z –1 z –1 z –1 –1z z –1 z –1 z –1 –1z z –1 z –1 z –1 z –1 z –1 z –1 z –1 z –1 DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

22

In order to determine the maximal sample rate for the interpolator, we assume that a multiplication takes 21 clock cycles and an addition takes 1 clock cycle. The computation paths through an adaptor involve two additions and one multiplication, i.e., (21+2) clock cycles. The usable clock frequency for the target technology is estimated to be at least 220 MHz. The critical path for the interpolator is through 11 adap- tors, i.e.,

µs or 869.6 kHz

The throughput will be too low, since the required input sampling fre- quency is 1.6 MHz. Four output values are generated for each input sample. Hence, the output sampling frequency is only 3.478 MHz. We will therefore use pipelining of the interpolator to reach the required output sample frequency of 6.4 MHz.

T CP 11 21 2 + () 220 10 6 -1.15 == DSP Integrated Circuits

Department of Electrical Engineering

[email protected]

Lars Wanhammar

Linköping University

http://www.es.isy.liu.se/

23

From Figure 11.60 it is evident that the minimal input sampling period is determined by a loop through two adaptors. We get

µs or 4.785 MHz

It is therefore possible to achieve the required sample frequency by break- ing the critical path into smaller pieces using pipelining.

T min 22 1 2 + () 220 10 6 -0.209 ==

References

Related documents

○ If BP elevated, think primary aldosteronism, Cushing’s, renal artery stenosis, ○ If BP normal, think hypomagnesemia, severe hypoK, Bartter’s, NaHCO3,

 HCC is developing in 85% in cirrhosis hepatis Chronic liver damage Hepatocita regeneration Cirrhosis Genetic changes

The key segments in the mattress industry in India are; Natural latex foam, Memory foam, PU foam, Inner spring and Rubberized coir.. Natural Latex mattresses are

The PROMs questionnaire used in the national programme, contains several elements; the EQ-5D measure, which forms the basis for all individual procedure

• Speed of weaning: induction requires care, but is relatively quick; subsequent taper is slow • Monitoring: Urinary drug screen, pain behaviors, drug use and seeking,

For establishments that reported or imputed occupational employment totals but did not report an employment distribution across the wage intervals, a variation of mean imputation

An analysis of the economic contribution of the software industry examined the effect of software activity on the Lebanese economy by measuring it in terms of output and value

The whole system, with external I/O IGBT fiber optic gate signals, executes in real- time at 80 µ s time step under the RT-Lab real-time distributed simulation software on