35
Automatic VHDL Model Generation of Parameterized FIR Filters E. George Walters III 1 , John Glossner 2 , and Michael J. Schulte 1 1 Computer Architecture and Arithmetic Laboratory Computer Science and Engineering Department Lehigh University Bethlehem, PA 18015 USA 2 Sandbridge Technologies 1 North Lexington Ave, 10 th Floor White Plains, NY 10601 USA

Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Automatic VHDL Model Generation of

Parameterized FIR Filters

E. George Walters III1, John Glossner2,and Michael J. Schulte1

1Computer Architecture and Arithmetic LaboratoryComputer Science and Engineering Department

Lehigh UniversityBethlehem, PA 18015 USA

2Sandbridge Technologies1 North Lexington Ave, 10th Floor

White Plains, NY 10601 USA

Page 2: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Outline

• Background• FIR filter architecture• Filter generation software• Results and conclusions

Page 3: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Two’s Complement MultipliersA

x B1

1

multiplier

partial product

product

bit matrix

multiplicand

n

2n

6 x 6 parallel tree multiplier (two’s complement)

Page 4: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Truncated MultipliersA

x B

not formed

1

1

product

multiplier

multiplicand

rkn

6 x 6 truncated multiplier

Page 5: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Truncated MultipliersA

x B

1

1

1 1 0 0 0 1

expectedvalue

n k r

Correcting for average reduction error

Page 6: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Truncated MultipliersA

x B

1

1

1 correction constant

valueexpected

n k r

Rounding the correction constant

Page 7: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Truncated Multiplier Errors

• Two sources of error– Reduction error– Roundoff error– Roundoff error often dominates

• Average reduction error is not zero

Page 8: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

FIR Filters

∑−

=

−⋅=1

0][][][

T

kknxibny

– x[ ] is the input– y[ ] is the output– T is the number of taps– b[ ] are the tap coefficients

Page 9: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Operand Bus 1 Operand Bus 'M'

Taps

Input Data

b[0] b[T-2] b[T-1]

x[n] x[n-1] x[n-T+1]

Register Register Register Register n bits

FIR filter architecture: 1st stage, operand selection

Page 10: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Operand Bus 1 Operand Bus 'M'

Multiplier 1

Register

Multiplier 'M'

Register

Taps

Input Data

b[0] b[T-2] b[T-1]

x[n] x[n-1] x[n-T+1]

Register Register Register Register

n + k bits

n bits

FIR filter architecture: 2nd stage, multiplication

Page 11: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Operand Bus 1 Operand Bus 'M'

Multiplier 1

Register

Multiplier 'M'

RegisterAccumulator

Multi-Operand Adder

Register

Taps

Input Data

b[0] b[T-2] b[T-1]

x[n] x[n-1] x[n-T+1]

Register Register Register Register

n + k bits

n + k bits

n bits

FIR filter architecture: 3rd stage, summation

Page 12: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Operand Bus 1 Operand Bus 'M'

Multiplier 1

Register

Multiplier 'M'

RegisterAccumulator

Multi-Operand Adder

Register

Final Adder

Output Register

Correction Constant

Taps

Input Data

Output Data

b[0] b[T-2] b[T-1]

x[n] x[n-1] x[n-T+1]

Register Register Register Register n bits

n + k bits

n + k bits

n bits

FIR filter architecture: 4th stage, final addition

Page 13: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Filter Generation Software

• VHDL generation• Test bench generation• Synthesis script generation• Bit level simulation

Page 14: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

ReducedAreaReductionTree

RippleCarryAdder

CarryPropagateAdder

WallaceReductionTree

CarryLookaheadAdder

ParallelMultiplier

BitMatrix ReductionTree

DaddaReductionTree

FIRFilter

Partial class diagram of the Filter Generation Software

Page 15: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Class <<Interface>>Abstract Class

Bit

BitMatrix

HDLFile

StdLogicVector

Util

arithmeticVHDLGenerator

<<Parameterized>>

<<Simulator>>

Object

java.lang

extends implements

The arithmetic package

Page 16: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Class <<Interface>>Abstract Class

CLALookaheadLogic

D_FF

FullAdder

HalfAdder

ReducedFullAdder

arithmetic.smallcomponents

VHDLGenerator <<Parameterized>>Object

java.lang

extends implements

SpecialHalfAdder

arithmetic

The arithmetic.smallcomponents package

Page 17: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Class <<Interface>>Abstract Class

Summer

CarryPropagateAdder

CarryLookaheadAdder

RippleCarryAdder

arithmetic.adders

VHDLGenerator <<Parameterized>>Object

java.lang

extends implements

SpecialCarrySaveAdder

arithmetic <<Simulator>>

The arithmetic.adders package

Page 18: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Class <<Interface>>Abstract Class

ReducedAreaReductionTree

WallaceReductionTree

arithmetic.matrixreductionReductionTreeObject

java.lang

extends implements

DaddaReductionTree

The arithmetic.matrixreduction package

Page 19: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Class <<Interface>>Abstract Class

ParallelMultiplier

arithmetic.multipliers

VHDLGenerator <<Parameterized>>Object

java.lang

extends implements

arithmetic <<Simulator>>

The arithmetic.multipliers package

Page 20: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Class <<Interface>>Abstract Class

Bus

Register

arithmetic.misccomponents

VHDLGenerator <<Parameterized>>Object

java.lang

extends implements

arithmetic

The arithmetic.misccomponents package

Page 21: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Class <<Interface>>Abstract Class

IdealFIRFilter

arithmetic.firfilters

VHDLGenerator <<Parameterized>>Object

java.lang

extends implements

arithmetic <<Simulator>>

FIRFilter

FIRControl

The arithmetic.firfilters package

Page 22: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Class <<Interface>>Abstract Class

TestFIRFilter

arithmetic.testingObject

java.lang

extends implements

TestParallelMultiplier

The arithmetic.testing package

Page 23: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Class <<Interface>>Abstract Class

FIRControlPanel

BusPanel

arithmetic.guiComponentPanelJPanel

javax.swing

extends implements

CarryLookaheadPanel

FIRFilterPanel

ParallelMultiplierPanel

RegisterPanel

RippleCarryAdderPanel

SpecialCarrySaveAdderPanel

SummerPanel

<<RadioButtonGroupUser>>

Graph

RadioButtonGroup

The arithmetic.gui package

Page 24: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Area Results

00.10.20.30.40.50.60.70.80.9

1

8-Bit Operands 12-Bit Operands 16-Bit Operands

12 Tap Filters with 4 Multipliers (normalized within each group)

standard multipliersk = 4k = 3k = 2k = 1k = 0

Page 25: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Error Results

0

1

2

3

4

5

6

ulps

8-Bit Operands 12-Bit Operands 16-Bit Operands

Standard deviation of error, 12 Tap Filters

k = 6

k = 5

k = 4

k = 3

k = 2

k = 1

k = 0

Page 26: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Conclusions

• Studied use of truncated multipliers in FIR filters• Area is significantly reduced• Error is tolerable for many applications• Average error is significantly reduced

Page 27: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation
Page 28: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Average Reduction Error22

_ 22)1( −− +•−−= ravgr rE

• Ex: 12 unformed columns, 1 multiplier– 1011000000000001 (correction constant)– 11-------------- (rounded)

• Ex: 12 unformed columns, 4 taps– 101100000000000100 (4 * correction constant)– 1011--------------

Page 29: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Tree Multipliers

p0p1p2p3p4p5p6p7p8p9p10p11

a0b5a1b5a2b5a3b5a4b5a5b5

a0b4a1b4a2b4a3b4a4b4a5b4

a0b3a1b3a2b3a3b3a4b3a5b3

a0b2a1b2a2b2a3b2a4b2a5b2

a0b1a1b1a2b1a3b1a4b1a5b1

a0b0a1b0a2b0a3b0a4b0a5b0

b0b1b2b3b4b5GB

a0a1a2a3a4a5A

6 x 6 partial product bit matrix

Page 30: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Parallel Tree Multipliers

Ax B

multiplicand

multiplier

partial product

product

bit matrix

6 x 6 parallel tree multiplier (unsigned)

Page 31: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Ax B

1

1

partial productbit matrix

1st reduction stage

2nd reduction stage

final reduction stage

product

multiplicand

multiplier

Reduced area reduction for 6 x6 multiplier

Page 32: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Truncated MultipliersA

x B

1

1

1

Bx1

A

Truncated multiplier reduction tree vs. standard multiplier

Page 33: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Truncated MultipliersA

x B

1

1

1

keep discard

round

Rounding truncated multiplier to 6 bits

Page 34: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Error Results

0

20

40

60

80

100

120

SNR

12 taps 24 taps 36 taps 48 taps

Reduction error SNR, 16-bit operands

r = 10

r = 11

r = 12

r = 13

r = 14

r = 15

r = 16

Page 35: Automatic VHDL Model Generation of Parameterized FIR Filtersglossner.org/john/papers/samos_2002_presentation.pdf · FIR filter architecture: 4th stage, final addition. Filter Generation

Results and Conclusions

0

0.2

0.4

0.6

0.8

1

12 16 20 24

Number of Taps

Area-Delay Product, 4 Multipliers, 16-Bit Operands

r = 0r = 12r = 16

Unformed Columns