dol: initial dol commit
[jump.git] / dol / examples / example2 / example2.xml
diff --git a/dol/examples/example2/example2.xml b/dol/examples/example2/example2.xml
new file mode 100644 (file)
index 0000000..9a915a4
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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
+http://www.tik.ee.ethz.ch/~shapes/schema/processnetwork.xsd" name="example2"> 
+
+  <variable value="3" name="N"/>
+
+  <!-- instantiate resources -->
+  <process name="generator">
+    <port type="output" name="10"/>
+    <source type="c" location="generator.c"/>
+  </process>
+
+  <iterator variable="i" range="N">
+    <process name="square">
+      <append function="i"/>
+      <port type="input" name="0"/>
+      <port type="output" name="1"/>
+      <source type="c" location="square.c"/>
+    </process>
+  </iterator>
+
+  <process name="consumer">
+    <port type="input" name="100"/>
+    <source type="c" location="consumer.c"/>
+  </process>
+
+  <iterator variable="i" range="N + 1">
+    <sw_channel type="fifo" size="10" name="C2">
+      <append function="i"/>
+      <port type="input" name="0"/>
+      <port type="output" name="1"/>
+    </sw_channel>
+  </iterator>
+
+  <!-- instantiate connection -->
+  <iterator variable="i" range="N">
+    <connection name="to_square">
+      <append function="i"/>
+      <origin name="C2">
+        <append function="i"/>
+        <port name="1"/>
+      </origin>
+      <target name="square">
+        <append function="i"/>
+        <port name="0"/>
+      </target>
+    </connection>
+
+    <connection name="from_square">
+        <append function="i"/>
+        <origin name="square">
+          <append function="i"/>
+          <port name="1"/>
+        </origin>
+        <target name="C2">
+          <append function="i + 1"/>
+          <port name="0"/>
+        </target>
+    </connection>
+  </iterator>
+
+  <connection name="g_">
+    <origin name="generator">
+     <port name="10"/>
+    </origin>
+    <target name="C2"> 
+      <append function="0"/>
+      <port name="0"/>
+    </target>
+  </connection>
+
+  <connection name="_c">
+    <origin name="C2">
+      <append function="N"/>
+      <port name="1"/>
+    </origin>
+    <target name="consumer">
+      <port name="100"/>
+    </target>
+  </connection>
+
+</processnetwork>