X-Git-Url: https://scm.cri.minesparis.psl.eu/git/Faustine.git/blobdiff_plain/c7f552fd8888da2f0d8cfb228fe0f28d3df3a12c..b4b6f2ea75b9f0f3ca918f5b84016610bf7a4d4f:/interpretor/preprocessor/faust-0.9.47mr3/examples/rewriting/mesh.dsp diff --git a/interpretor/preprocessor/faust-0.9.47mr3/examples/rewriting/mesh.dsp b/interpretor/preprocessor/faust-0.9.47mr3/examples/rewriting/mesh.dsp new file mode 100644 index 0000000..92bb932 --- /dev/null +++ b/interpretor/preprocessor/faust-0.9.47mr3/examples/rewriting/mesh.dsp @@ -0,0 +1,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);