File: mesh.dsp

package info (click to toggle)
faust 2.79.3%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 397,496 kB
  • sloc: cpp: 278,433; ansic: 116,164; javascript: 18,529; vhdl: 14,052; sh: 13,884; java: 5,900; objc: 3,852; python: 3,222; makefile: 2,655; cs: 1,672; lisp: 1,146; ruby: 954; yacc: 586; xml: 471; lex: 247; awk: 110; tcl: 26
file content (43 lines) | stat: -rw-r--r-- 919 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
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
42
43

/* Layout of a systolic array:

        x1        xm
        ↓         ↓
   y1 → □ → ... → □ → y1'
        ↓         ↓
       ...       ...
        ↓         ↓
   yn → □ → ... → □ → yn'
        ↓         ↓
        x1'       xm'

  g(m,f)   : y,x1,...,xm -> x1',...,xm',y'
  constructs a single row of size m.

  h(n,m,f) : y1,...,yn,x1,...,xm -> x1',...,xm',yn',...,y1'
  constructs an array of size nxm.

  f is the function computed by each cell, which must take
  exactly two inputs and yield exactly two outputs. */

g(1,f)		= f;
g(m,f)		= (f, r(m-1)) : (_, g(m-1,f));

h(1,m,f)	= g(m,f);
h(n,m,f)	= (r(n+m) <:
		   (!,r(n-1),s(m), (_,s(n-1),r(m) : g(m,f)))) :
                  (h(n-1,m,f), _);

// route n inputs
r(1)		= _;
r(n)		= _,r(n-1);

// skip n inputs
s(1)		= !;
s(n)		= !,s(n-1);

// sample cell function
f		= + <: _,_;

//process		= g(3,f);
process		= h(2,3,f);