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 [2023/01/08 18:39]
rajit [Controlled merge]
language:langs:dflow [2023/02/11 12:02]
rajit [Split]
Line 51: Line 51:
 </code> </code>
  
-The bit-width of channel ''c'' should be at most the number of bits needed to specify the number of outputs. If the value of the token on ''c'' is not within the range ''0'' to ''n'' (for ''n+1'' channels on the right hand side), then the dataflow component can fail in an unspecified manner.+The bit-width of channel ''c'' should be at most the number of bits needed to specify the number of outputs. If the value of the token on ''c'' is not within the range ''0'' to ''n'' (for ''n+1'' channels on the right hand side), then the dataflow component can fail in an unspecified manner. Furthermore, the bit-widths of all the data channels  (''I'', ''O0'', etc above) must be the same. 
 + 
 +The control channel, input data, and output data can only be channels. If a control expression is needed, one must use a combination of a split as well as a function. For example, if a split takes an input from ''A'' and sends it to ''X'' if ''c=0'' and ''Y'' otherwise, then the following is a syntax error: 
 + 
 +<code act> 
 +dataflow { 
 +  {c = 0 ? 1 : 0} A -> X, Y 
 +
 +</code> 
 + 
 +Instead, use the following: 
 +<code  act> 
 +dataflow { 
 + c = 0 ? 1 : 0 -> ctrl; 
 +{ctrl} A -> X, Y 
 +
 +</code>
 ===== Controlled merge ===== ===== Controlled merge =====
  
Line 66: Line 82:
 } }
 </code> </code>
-The bit-width of ''c'' has analogous constraints as in the case of a split.+The bit-width of ''c'' has analogous constraints as in the case of a split, and it also has similar syntax restrictions.
 ===== Implicit copy and explicit buffers ===== ===== Implicit copy and explicit buffers =====