August 27, 2012
Specification of APERTIF Polyphase Filter Bank in C흀aSH
Rinse Westera, Dimitrios Sarakiotisa, Eric Kooistrab, Jan Kupera University of Twente, Enschede ASTRON, Dwingelo
1
Monday, August 27, 12
Specification of APERTIF Polyphase Filter Bank in C aSH Rinse Wester - - PowerPoint PPT Presentation
Specification of APERTIF Polyphase Filter Bank in C aSH Rinse Wester a , Dimitrios Sarakiotis a , Eric Kooistra b , Jan Kuper a University of Twente, Enschede ASTRON, Dwingelo August 27, 2012 1 Monday, August 27, 12 Contents
August 27, 2012
Rinse Westera, Dimitrios Sarakiotisa, Eric Kooistrab, Jan Kupera University of Twente, Enschede ASTRON, Dwingelo
1
Monday, August 27, 12
✤ Introduction ✤ Background ✤ Describing the Filter bank using CλaSH ✤ Results ✤ Conclusions & Future Work
2
Monday, August 27, 12
✤ What is C흀aSH? ✤ Functional Language and Compiler for Concurrent Digital
Hardware Design
✤ Motivation? ✤ Testing C흀aSH on real life complex application ✤ Why APERTIF Polyphase filter bank? ✤ Strict specification on Throughput, Area and clock frequency
3
Monday, August 27, 12
✤ CλaSH ✤ A functional language and compiler for digital hardware design ✤ On the lowest level, everything is a Mealy machine f(s,i) = (s’,o) ✤ A CλaSH description is purely structural i.e. all operations are
performed in a single clock cycle
✤ Simulation is cycle accurate
4
Monday, August 27, 12
+
a
*
b
s' s
5
Monday, August 27, 12
fir cs (State us) inp = (State us0, out) where us0 = inp + us ws = vzipWith (⇤) us cs
+ *
in
+ * + *
cN-1 c0 c1
u0 u1 uN-1 w0 w1 wN-1
6
Monday, August 27, 12
✤ APERTIF Polyphase Filter bank ✤ Increasing field of view of Westerbork telescope using small array ✤ Each antenna in the array requires a polyphase filter bank ✤ Goals: Fclk = 200 MHz and throughput = 800 MS/s
7
APERTIF project
k Monday, August 27, 12
✤ APERTIF Polyphase
Filter bank
✤ Polyphase FIR filter ✤ FFT
*
in
+ * + *
c(N-1)M c0 cM
↓M
* + * + *
c(N-1)M+1 c1 cM+1
↓M
* + * + *
cNM-1 cM-1 c2M-1
↓M M = 1024 N = 16 M-point FFT M = 1024
8
Monday, August 27, 12
✤ Design method ✤ Polyphase filter ✤ FFT pipeline
9
Monday, August 27, 12
✤ Design whole Architecture first in plain Haskell ✤ Perform small modification such that the code is accepted by C흀aSH ✤ Lists are replaced by vectors: lists with fixed length ✤ Fixed point representation for numbers ✤ A clear division between structure and low level hardware details
Design method
Functional description
Mathematics Haskell C훌aSH Hardware
Simulation/behavioral verification
10
Monday, August 27, 12
✤ A set of FIR filters
sequentially activated
✤ Parallelization of P=4
needed Polyphase Filter
FIR0 cntr inp
FIR1 FIRM-1 FIRcomb Coefficients States inp
11
Monday, August 27, 12
✤ A set of FIR filters
sequentially activated
✤ Parallelization of P=4
needed Polyphase Filter
FIR0 cntr inp
FIR1 FIRM-1 FIRcomb Coefficients States inp
11
Monday, August 27, 12
✤ A set of FIR filters
sequentially activated
✤ Parallelization of P=4
needed Polyphase Filter
FIR0 cntr inp
FIR1 FIRM-1 FIRcomb Coefficients States inp
11
Monday, August 27, 12
Parallel Polyphase Filter
cntr FIRcomb Coefficients States inp0
cntr FIRcomb Coefficients States inp1
cntr FIRcomb Coefficients States inp2
cntr FIRcomb Coefficients States inp3
12
Monday, August 27, 12
fir :: [Double ] ! (State [Double ]) ! Double ! (State [Double ], Double) fir cs (State us) inp = (State us , out) where us = inp + us ws = zipWith (⇤) uscs
FIR filter: Haskell → CλaSH
13 + *
in
+ * + *
cN-1 c0 c1
u0 u1 uN-1 w0 w1 wN-1 Monday, August 27, 12
fir :: (Vector D16 S) ! (State (Vector D16 S)) ! S ! (State (Vector D16 S), S) fir cs (State us) inp = (State us,
where us = inp + us ws = vzipWith ‘fpmult‘ uscs
fir :: [Double ] ! (State [Double ]) ! Double ! (State [Double ], Double) fir cs (State us) inp = (State us , out) where us = inp + us ws = zipWith (⇤) uscs
FIR filter: Haskell → CλaSH
13 + *
in
+ * + *
cN-1 c0 c1
u0 u1 uN-1 w0 w1 wN-1 Monday, August 27, 12
fir :: (Vector D16 S) ! (State (Vector D16 S)) ! S ! (State (Vector D16 S), S) fir cs (State us) inp = (State us,
where us = inp + us ws = vzipWith ‘fpmult‘ uscs
fir :: [Double ] ! (State [Double ]) ! Double ! (State [Double ], Double) fir cs (State us) inp = (State us , out) where us = inp + us ws = zipWith (⇤) uscs
FIR filter: Haskell → CλaSH
13 + *
in
+ * + *
cN-1 c0 c1
u0 u1 uN-1 w0 w1 wN-1 Monday, August 27, 12
fir :: (Vector D16 S) ! (State (Vector D16 S)) ! S ! (State (Vector D16 S), S) fir cs (State us) inp = (State us,
where us = inp + us ws = vzipWith ‘fpmult‘ uscs
fir :: [Double ] ! (State [Double ]) ! Double ! (State [Double ], Double) fir cs (State us) inp = (State us , out) where us = inp + us ws = zipWith (⇤) uscs
FIR filter: Haskell → CλaSH
13 + *
in
+ * + *
cN-1 c0 c1
u0 u1 uN-1 w0 w1 wN-1 Monday, August 27, 12
FFT pipeline
14
inp
*
8 BF2I 4 BF2II ws
*
2 BF2I 1 BF2II ws Monday, August 27, 12
✤ FFT is implemented using pipeline ✤ Two types of butterflies and Complex multiplier
FFT pipeline
14
inp
*
8 BF2I 4 BF2II ws
*
2 BF2I 1 BF2II ws Monday, August 27, 12
FFT pipeline
14
bf2i (cntr, lst) inp = ((cntr 0, lst0), out) where n = length lst cntr 0 = (cntr + 1) ‘mod‘ n lst0 = lstin + lst (out, lstin) = if cntr > n then (lstout + inp, lstout inp) else (lstout , inp ) lstout = last lst
lst
+
lstin lstout inp
inp
*
8 BF2I 4 BF2II ws
*
2 BF2I 1 BF2II ws Monday, August 27, 12
FFT pipeline
14
cmult ws cntr inp = (cntr 0, out) where n = length ws cntr 0 = (cntr + 1) ‘mod‘ n w = ws ! cntr
= inp ⇤ w
inp
*
8 BF2I 4 BF2II ws
*
2 BF2I 1 BF2II ws Monday, August 27, 12
FFT pipeline
14
fftbb ws (bf1state, bf2state, cmstate) inp = ((bf1state0, bf2state0, cmstate0), out) where (bf1state0, a) = bf2i bf1state inp (bf2state0, b) = bf2ii bf2state a (cmstate0, out) = cmult ws cmstate b
inp
*
8 BF2I 4 BF2II ws
*
2 BF2I 1 BF2II ws Monday, August 27, 12
FFT pipeline
14
fftchain (ws1, ws2, ...) (bb1state, bb2state, ...) inp = ((bb1state0, bb2state0, ...), out) where (bb1state0, d1) = fftbb ws1 bb1state inp (bb2state0, d2) = fftbb ws2 bb2state d1
inp
*
8 BF2I 4 BF2II ws
*
2 BF2I 1 BF2II ws Monday, August 27, 12
FFT BF2I: Haskell → CλaSH
15
bf2i (cntr, lst) inp = ((cntr 0, lst0), out) where n = length lst cntr 0 = (cntr + 1) ‘mod‘ n lst0 = lstin + lst (out, lstin) = if cntr > n then (lstout + inp, lstout inp) else (lstout , inp ) lstout = last lst
bf2i clash (cntr, lst) inp = ((cntr 0, lst0), out) where n = vlength lst cntr 0 = cntr + 1 lst0 = lstin + lst (out, lstin) = if cntr > n then (lstout + inp, lstout inp) else (lstout, inp) lstout = vlast lst
Monday, August 27, 12
FFT BF2I: Haskell → CλaSH
15
bf2i (cntr, lst) inp = ((cntr 0, lst0), out) where n = length lst cntr 0 = (cntr + 1) ‘mod‘ n lst0 = lstin + lst (out, lstin) = if cntr > n then (lstout + inp, lstout inp) else (lstout , inp ) lstout = last lst
bf2i clash (cntr, lst) inp = ((cntr 0, lst0), out) where n = vlength lst cntr 0 = cntr + 1 lst0 = lstin + lst (out, lstin) = if cntr > n then (lstout + inp, lstout inp) else (lstout, inp) lstout = vlast lst
Monday, August 27, 12
FFT BF2I: Haskell → CλaSH
15
bf2i (cntr, lst) inp = ((cntr 0, lst0), out) where n = length lst cntr 0 = (cntr + 1) ‘mod‘ n lst0 = lstin + lst (out, lstin) = if cntr > n then (lstout + inp, lstout inp) else (lstout , inp ) lstout = last lst
bf2i clash (cntr, lst) inp = ((cntr 0, lst0), out) where n = vlength lst cntr 0 = cntr + 1 lst0 = lstin + lst (out, lstin) = if cntr > n then (lstout + inp, lstout inp) else (lstout, inp) lstout = vlast lst
Monday, August 27, 12
✤ Polyphase filter bank has been fully implemented using C흀aSH ✤ Simulation shows that the PFB operates correctly ✤ Synthesis revealed some limitations of the current compiler
16
Polyphase filter(256 elements) 1k-points FFT Logic utilization 91% 6% blockRAMS DSP blocks 128 70
114 MHz 195 MHz
Monday, August 27, 12
✤ The complete Polyphase Filter Bank has been implemented ✤ Haskell code needs only small modifications before it is accepted by
the C흀aSH compiler
✤ The description is purely parallel (structural) and cycle accurate ✤ Shortcomings of C흀aSH compiler ✤ Large coefficient vectors not supported ✤ BlockRAM not supported, limiting Fclk
17
Monday, August 27, 12
✤ Develop area vs time time trade off based on functional description ✤ Improvements for the C흀aSH compiler ✤ Support for blockRAMs on FPGA ✤ Support for memory initialization files for coefficient vectors
18
Monday, August 27, 12
19
Monday, August 27, 12