dol: initial dol commit
[jump.git] / dol / examples / example7 / example7.xml
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">
4
5   <!-- N - 1 is the filter order -->
6   <variable name="N" value="3"/>
7
8   <!-- instantiate processes -->
9   <process name="producer">
10     <port type="output" name="out"/>
11     <source type="c" location="producer.c"/>
12   </process>
13
14   <process name="consumer">
15     <port type="input" name="in"/>
16     <source type="c" location="consumer.c"/>
17   </process>
18
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"/>
27     </process>
28   </iterator>
29   
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"/>
34   </sw_channel>
35
36   <sw_channel type="fifo" size="4" name="outputchannel">
37     <port type="input" name="in"/>
38     <port type="output" name="out"/>
39   </sw_channel>
40   
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"/>
46     </sw_channel>
47
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"/>
52     </sw_channel>
53   </iterator>
54   
55   <sw_channel type="fifo" size="4" name="feedbackchannel">
56     <port type="input" name="in"/>
57     <port type="output" name="out"/>
58   </sw_channel>
59
60   <!-- connections of top filter stage -->
61   <connection name="inputconnection">
62     <origin name="producer">
63       <port name="out"/>
64     </origin>
65     <target name="inputchannel">
66       <port name="in"/>
67     </target>
68   </connection>
69
70   <connection name="outputconnection">
71     <origin name="outputchannel">
72       <port name="out"/>
73     </origin>
74     <target name="consumer">
75       <port name="in"/>
76     </target>
77   </connection>
78   
79   <connection name="filterconnectionin">
80     <origin name="inputchannel">
81       <port name="out"/>
82     </origin>
83     <target name="filter">
84       <append function="0"/>
85       <port name="inA"/>
86     </target>
87   </connection>
88
89   <connection name="filterconnectionout">
90     <origin name="filter">
91       <append function="0"/>
92       <port name="outB"/>
93     </origin>
94     <target name="outputchannel">
95       <port name="in"/>
96     </target>
97   </connection>
98
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"/>
105         <port name="outA"/>
106       </origin>
107       <target name="filterchannelA">
108         <append function="i"/>
109         <port name="in"/>
110       </target>
111     </connection>
112  
113     <connection name="filterconnectionoutAinA2">
114       <append function="i"/>
115       <origin name="filterchannelA">
116         <append function="i"/>
117         <port name="out"/>
118       </origin>
119       <target name="filter">
120         <append function="i + 1"/>
121         <port name="inA"/>
122       </target>
123     </connection>
124
125     <connection name="filterconnectionoutBinB1">
126       <append function="i"/>
127       <origin name="filter">
128         <append function="i + 1"/>
129         <port name="outB"/>
130       </origin>
131       <target name="filterchannelB">
132         <append function="i"/>
133         <port name="in"/>
134       </target>
135     </connection>
136  
137     <connection name="filterconnectionoutBinB2">
138       <append function="i"/>
139       <origin name="filterchannelB">
140         <append function="i"/>
141         <port name="out"/>
142       </origin>
143       <target name="filter">
144         <append function="i"/>
145         <port name="inB"/>
146       </target>
147     </connection>
148   </iterator>
149   
150   <!-- connection of bottom filter stage -->
151   <connection name="sinkconnectionA1">
152     <origin name="filter">
153       <append function="N - 1"/>
154       <port name="outA"/>
155     </origin>
156     <target name="feedbackchannel">
157       <port name="in"/>
158     </target>
159   </connection>
160   
161   <connection name="sinkconnectionA2">
162     <origin name="feedbackchannel">
163       <port name="out"/>
164     </origin>
165     <target name="filter">
166       <append function="N - 1"/>
167       <port name="inB"/>
168     </target>
169   </connection>
170 </processnetwork>