Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
language:langs:dflow [2020/08/03 06:28]
rajit [The dataflow sublanguage]
language:langs:dflow [2020/12/22 10:17]
rajit [Deterministic and non-deterministic merge]
Line 43: Line 43:
 </code> </code>
 The ''*'' indicates a token sink. The ''*'' indicates a token sink.
 +
 +Splits with more than two outputs use the same syntax. The control token is assumed to take on an integer value specifying which output channel is used.
 +<code>
 +dataflow {
 +  {c} I -> O0, O1, O2, ..., On
 +}
 +</code>
  
 ===== Controlled merge ===== ===== Controlled merge =====
Line 52: Line 59:
 } }
 </code> </code>
-In this example, if a 0 is received on ''c'', then the data token on ''I0'' is sent to the output ''O''.+In this example, if a 0 is received on ''c'', then the data token on ''I0'' is sent to the output ''O''Multi-way merges use a syntax analogous to splits: 
 +<code> 
 +dataflow { 
 +  {c} I0, I1, ..., Ik -> O 
 +
 +</code>
  
 ===== Implicit copy and explicit buffers ===== ===== Implicit copy and explicit buffers =====
Line 100: Line 112:
 </code> </code>
 Note that this introduces an arbiter.  Note that this introduces an arbiter. 
 +
 +Often it is helpful to know what decision was made by the arbiter. To support this, we permit an optional second channel on the right hand side of the dataflow expression as follows:
 +<code>
 +dataflow {
 + {|} I0, I1 -> O, c
 +}
 +</code>
 +For each output generated, the control channel ''c'' will produce a 0 or 1 token depending on the choice made by the arbiter.
  
 ====== Examples ====== ====== Examples ======