Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| language:langs:dflow [2024/07/22 17:53] – [Implicit copy and explicit buffers] rajit | language:langs:dflow [2026/05/13 10:58] (current) – [Function] rajit | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| The dataflow language has the following primitives: | The dataflow language has the following primitives: | ||
| * Function: reads tokens on all of its inputs, computes some function of those inputs, and produces an output token in response; | * Function: reads tokens on all of its inputs, computes some function of those inputs, and produces an output token in response; | ||
| - | * Split: conditionally routes an input token to one of its outputs; | + | * Split (a.k.a. demux): conditionally routes an input token to one of its outputs; |
| - | * Controlled merge (a.k.a. | + | * Controlled merge (a.k.a. |
| - | * Deterministic merge: assumes | + | * Merge: this component waits for the arrival of an input token on any one of its inputs, and sends the arriving |
| - | * Non-deterministic merge: | + | * Deterministic merge: assumes input token arrivals are mutually exclusive |
| + | | ||
| * Initial tokens: these are specified directly in the syntax | * Initial tokens: these are specified directly in the syntax | ||
| - | * Copy: implicit, with the same channel is used for multiple inputs | + | * Copy (a.k.a. fork): implicit, with the same channel is used for multiple inputs |
| * Sources and sinks have short-hand syntax. | * Sources and sinks have short-hand syntax. | ||
| ===== Function ===== | ===== Function ===== | ||
| - | The syntax shown above corresponds to the // | + | The syntax shown in the first example |
| - | ===== Split ===== | + | By default, a function implicitly contains a buffer. However, functions can also have additional buffering on their output. The syntax used for this purpose is shown below. |
| + | <code act> | ||
| + | dataflow { | ||
| + | a + b -> [2] c | ||
| + | } | ||
| + | </ | ||
| + | In this example, one extra buffer stage is added to the output of '' | ||
| + | <code act> | ||
| + | dataflow { | ||
| + | a + b -> c1; | ||
| + | c1 -> c | ||
| + | } | ||
| + | </ | ||
| + | The '' | ||
| + | |||
| + | |||
| + | ===== Split or Demux ===== | ||
| The //split// dataflow element receives a control token and a data token, and uses the value of the control token to route the data token to one of the output channels. If the control token=0, the first channel is used; if it is 1, then the next channel is used; etc. The syntax for this is shown below: | The //split// dataflow element receives a control token and a data token, and uses the value of the control token to route the data token to one of the output channels. If the control token=0, the first channel is used; if it is 1, then the next channel is used; etc. The syntax for this is shown below: | ||
| Line 68: | Line 85: | ||
| } | } | ||
| </ | </ | ||
| - | ===== Controlled merge ===== | + | ===== Controlled merge or Mux ===== |
| The // | The // | ||