1 <?xml version="1.0" encoding="UTF-8"?>
2 <processnetwork xmlns="http://www.tik.ee.ethz.ch/~shapes/schema/PROCESSNETWORK" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tik.ee.ethz.ch/~shapes/schema/PROCESSNETWORK
3 http://www.tik.ee.ethz.ch/~shapes/schema/processnetwork.xsd" name="filter">
5 <!-- N - 1 is the filter order -->
6 <variable name="N" value="3"/>
8 <!-- instantiate processes -->
9 <process name="producer">
10 <port type="output" name="out"/>
11 <source type="c" location="producer.c"/>
14 <process name="consumer">
15 <port type="input" name="in"/>
16 <source type="c" location="consumer.c"/>
19 <iterator variable="i" range="N">
20 <process name="filter">
21 <append function="i"/>
22 <port type="input" name="inA"/>
23 <port type="input" name="inB"/>
24 <port type="output" name="outA"/>
25 <port type="output" name="outB"/>
26 <source type="c" location="filter.c"/>
30 <!-- instantiate sw_channels -->
31 <sw_channel type="fifo" size="4" name="inputchannel">
32 <port type="input" name="in"/>
33 <port type="output" name="out"/>
36 <sw_channel type="fifo" size="4" name="outputchannel">
37 <port type="input" name="in"/>
38 <port type="output" name="out"/>
41 <iterator variable="i" range="N - 1">
42 <sw_channel type="fifo" size="4" name="filterchannelA">
43 <append function="i"/>
44 <port type="input" name="in"/>
45 <port type="output" name="out"/>
48 <sw_channel type="fifo" size="4" name="filterchannelB">
49 <append function="i"/>
50 <port type="input" name="in"/>
51 <port type="output" name="out"/>
55 <sw_channel type="fifo" size="4" name="feedbackchannel">
56 <port type="input" name="in"/>
57 <port type="output" name="out"/>
60 <!-- connections of top filter stage -->
61 <connection name="inputconnection">
62 <origin name="producer">
65 <target name="inputchannel">
70 <connection name="outputconnection">
71 <origin name="outputchannel">
74 <target name="consumer">
79 <connection name="filterconnectionin">
80 <origin name="inputchannel">
83 <target name="filter">
84 <append function="0"/>
89 <connection name="filterconnectionout">
90 <origin name="filter">
91 <append function="0"/>
94 <target name="outputchannel">
99 <!-- connections of intermediate filter stage(s) -->
100 <iterator variable="i" range="N - 1">
101 <connection name="filterconnectionoutAinA1">
102 <append function="i"/>
103 <origin name="filter">
104 <append function="i"/>
107 <target name="filterchannelA">
108 <append function="i"/>
113 <connection name="filterconnectionoutAinA2">
114 <append function="i"/>
115 <origin name="filterchannelA">
116 <append function="i"/>
119 <target name="filter">
120 <append function="i + 1"/>
125 <connection name="filterconnectionoutBinB1">
126 <append function="i"/>
127 <origin name="filter">
128 <append function="i + 1"/>
131 <target name="filterchannelB">
132 <append function="i"/>
137 <connection name="filterconnectionoutBinB2">
138 <append function="i"/>
139 <origin name="filterchannelB">
140 <append function="i"/>
143 <target name="filter">
144 <append function="i"/>
150 <!-- connection of bottom filter stage -->
151 <connection name="sinkconnectionA1">
152 <origin name="filter">
153 <append function="N - 1"/>
156 <target name="feedbackchannel">
161 <connection name="sinkconnectionA2">
162 <origin name="feedbackchannel">
165 <target name="filter">
166 <append function="N - 1"/>