1
Optimizing Stream Programs Using Linear State Space Analysis
Sitij Agrawal1,2, William Thies1, and Saman Amarasinghe1
1Massachusetts Institute of Technology 2Sandbridge Technologies
Optimizing Stream Programs Using Linear State Space Analysis Sitij - - PowerPoint PPT Presentation
1 Optimizing Stream Programs Using Linear State Space Analysis Sitij Agrawal 1,2 , William Thies 1 , and Saman Amarasinghe 1 1 Massachusetts Institute of Technology 2 Sandbridge Technologies CASES 2005 http://cag.lcs.mit.edu/streamit Streaming
1
1Massachusetts Institute of Technology 2Sandbridge Technologies
2
AtoD Decode duplicate LPF2 LPF1 LPF3 HPF2 HPF1 HPF3 Transmit roundrobin Encode
3
DSP Optimizations Rewrite the program Design the Datapaths
(no control flow)
Architecture-specific Optimizations
(performance, power, code size)
Coefficient Tables C/Assembly Code
4
DSP Optimizations High-Level Program (dataflow + control) Architecture-Specific Optimizations
C/Assembly Code Application-Level Design
5
[CC ’02, PPoPP ’05]
[ASPLOS ’02, ISCA ’04, Graphics Hardware ’05]
[LCTES ’03, LCTES ’05]
[PLDI ’03, CASES ‘05]
6
void->void pipeline FMRadio(int N, float lo, float hi) { add AtoD(); add FMDemod(); add splitjoin { split duplicate; for (int i=0; i<N; i++) { add pipeline { add LowPassFilter(lo + i*(hi - lo)/N); add HighPassFilter(lo + i*(hi - lo)/N); } } join roundrobin(); } add Adder(); add Speaker(); }
Adder Speaker AtoD FMDemod LPF1 Duplicate RoundRobin LPF2 LPF3 HPF1 HPF2 HPF3
7
float->float filter LowPassButterWorth (float sampleRate, float cutoff) { float coeff; float x; init { coeff = calcCoeff(sampleRate, cutoff); } work peek 2 push 1 pop 1 { x = peek(0) + peek(1) + coeff * x; push(x); pop(); } }
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41