Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
language:langs:dflow [2023/04/09 23:43] – [Clusters and Ordering] rajitlanguage:langs:dflow [2024/07/22 17:54] (current) – [Function] rajit
Line 26: Line 26:
 ===== Function ===== ===== Function =====
  
-The syntax shown above corresponds to the //function// dataflow block. A function dataflow element receives one input token on each of its input channels, computes a function of the values received, and produces one output token with the value computed. The example above shows the function syntax. The left hand side of the arrow is a channel expression that corresponds to the function being computed, and the right hand side is the name of the channel on which the output is produced.+The syntax shown in the first example above corresponds to the //function// dataflow block. A function dataflow element receives one input token on each of its input channels, computes a function of the values received, and produces one output token with the value computed. The example above shows the function syntax. The left hand side of the arrow is a channel expression that corresponds to the function being computed, and the right hand side is the name of the channel on which the output is produced.
  
 ===== Split ===== ===== Split =====
Line 57: Line 57:
 <code act> <code act>
 dataflow { dataflow {
-  {c = 0 ? 1 : 0} A -> X, Y+  {c = 0 ? 0 : 1} A -> X, Y
 } }
 </code> </code>
Line 64: Line 64:
 <code  act> <code  act>
 dataflow { dataflow {
- c = 0 ? 1 : 0 -> ctrl;+ c = 0 ? 0 : 1 -> ctrl;
 {ctrl} A -> X, Y {ctrl} A -> X, Y
 } }
Line 92: Line 92:
 } }
 </code> </code>
-The fact that ''a'' is used twice on the left hand side implies that there will be a token copy circuit introduced. Note also that semicolon is used as a separator, like in the CHP language.+The fact that ''a'' is used twice on the left hand side implies that there will be a token copy circuit introduced. Note also that semicolon is used as a separator, so there is no semicolon after the last dataflow statement in the block.
  
 In pipelined circuits, it is important to be able to introduce slack to optimize performance. The syntax for this is the following: In pipelined circuits, it is important to be able to introduce slack to optimize performance. The syntax for this is the following:
Line 207: Line 207:
 Furthermore, suppose that the ''c'' output is passed to another process where it is transformed to a new value, and it is this new value that is provided on channel ''e'' that is part of this dataflow block.  Furthermore, suppose that the ''c'' output is passed to another process where it is transformed to a new value, and it is this new value that is provided on channel ''e'' that is part of this dataflow block. 
  
-When optimizing the dataflow block, one may decide to group the control for the two dataflow elements. However, doing so would result in deadlock, because the combined dataflow block would wait for inputs to arrive on ''a'', ''b'', ''d'', and ''e''  //before producing an output on ''c''//+When optimizing the dataflow block, one may decide to group the control for the two dataflow elements. However, doing so would result in deadlock, because the combined dataflow block would wait for inputs to arrive on ''a'', ''b'', ''d'', and ''e''  //before producing an output on ''c''//It is not possible to determine that ''e'' in fact depends on ''c'' without a full analysis of the entire ACT program.  
 + 
 +To simplify optimizations, the dataflow language also supports the ''order'' directive as the first item in the dataflow block. The same example above would be specified: 
 +<code act> 
 +dataflow { 
 +  order { 
 +     c < e    // c must be produced before e is available 
 +   } 
 +   a + b -> c;  
 +   d + e -> out 
 + } 
 +</code> 
 +In general, the order block contains a semi-colon separated list of directives. Each directive is a list of comma-separated channels followed by ''<'' followed by a second comma-separated list of channels. The directive means that all the channels in the first group must produce outputs before any of the channels in the second group can receive inputs. 
 + 
 +====== Syntactic replication ====== 
 + 
 +The dataflow sub-language has support for syntactic replication for splits, merges, mixers, and arbiters. For a split, the output side can use syntactic replication; for the others, the input side can use syntactic replication. 
 +For example, the following syntax is legal (assuming everything is of the right type): 
 +<code act> 
 +dataflow { 
 +  {ctrl} l -> (, i : 8 : out[i]) 
 + } 
 +</code>