Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
language:langs:dflow [2022/05/13 12:50] – rajit | language:langs:dflow [2024/07/22 17:54] (current) – [Function] rajit | ||
---|---|---|---|
Line 26: | Line 26: | ||
===== Function ===== | ===== Function ===== | ||
- | The syntax shown above corresponds to the // | + | The syntax shown in the first example |
===== Split ===== | ===== Split ===== | ||
Line 51: | Line 51: | ||
</ | </ | ||
+ | The bit-width of channel '' | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | <code act> | ||
+ | dataflow { | ||
+ | {c = 0 ? 0 : 1} A -> X, Y | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Instead, use the following: | ||
+ | < | ||
+ | dataflow { | ||
+ | c = 0 ? 0 : 1 -> ctrl; | ||
+ | {ctrl} A -> X, Y | ||
+ | } | ||
+ | </ | ||
===== Controlled merge ===== | ===== Controlled merge ===== | ||
Line 65: | Line 82: | ||
} | } | ||
</ | </ | ||
+ | The bit-width of '' | ||
===== Implicit copy and explicit buffers ===== | ===== Implicit copy and explicit buffers ===== | ||
Line 75: | Line 92: | ||
} | } | ||
</ | </ | ||
- | The fact that '' | + | The fact that '' |
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 120: | Line 137: | ||
</ | </ | ||
For each output generated, the control channel '' | For each output generated, the control channel '' | ||
+ | This syntax is also supported for the deterministic merge. | ||
+ | <code act> | ||
+ | dataflow { | ||
+ | {*} I0, I1 -> O, c | ||
+ | } | ||
+ | </ | ||
+ | In both these cases, the control output channel must have the exact bitwidth needed to specify which input token was routed to the output. | ||
===== Sink ===== | ===== Sink ===== | ||
Line 173: | Line 196: | ||
</ | </ | ||
+ | Dataflow clusters are hints to the implementation that these dataflow elements should be grouped together---for example, by having a single control that is shared by all the elements of the cluster. | ||
+ | Finally, consider the following dataflow example: | ||
+ | <code act> | ||
+ | dataflow { | ||
+ | a + b -> c; // produce an output on channel c | ||
+ | d + e -> out // sum d and e and produce the output on out | ||
+ | } | ||
+ | </ | ||
+ | Furthermore, | ||
+ | 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 '' | ||
+ | |||
+ | To simplify optimizations, | ||
+ | <code act> | ||
+ | dataflow { | ||
+ | order { | ||
+ | c < e // c must be produced before e is available | ||
+ | } | ||
+ | a + b -> c; | ||
+ | d + e -> out | ||
+ | } | ||
+ | </ | ||
+ | In general, the order block contains a semi-colon separated list of directives. Each directive is a list of comma-separated channels followed by ''<'' | ||
+ | |||
+ | ====== 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 example, the following syntax is legal (assuming everything is of the right type): | ||
+ | <code act> | ||
+ | dataflow { | ||
+ | {ctrl} l -> (, i : 8 : out[i]) | ||
+ | } | ||
+ | </ |