Dataflow Ports & Connectivity🔗
Legend🔗
Shape | Meaning |
---|---|
or | A dataflow design |
A dataflow port. Arrow enters a dataflow design shape = INPUT port Arrow exists a dataflow design shape = OUTPUT port |
|
A dataflow variable (mutable) | |
A constant (immutable literal). In this case, the value is 5. |
|
A dataflow join calculation junction (immutable). In this case, the calculation is the addition + arithmetic operation. |
|
A dataflow state element, via .prev(rank) (immutable).In this case, the rank is 3. |
|
A single-line arrow indicates a dataflow dependency assignment from a producer (arrow tail) to a consumer (arrow head) |
|
A double-line diamond arrow indicates a dataflow dependency connection from a producer (arrow tail) to a consumer (arrow head) and an initial conditions dependency |
|
A double-line arrow indicates a dataflow dependency reference from a producer (arrow tail) to a consumer (arrow head) and an initial conditions dependency |
Table of Contents🔗
- Dataflow Ports & Connectivity
- Legend
- Table of Contents
- Key Differences Between <> and :=
- Connection <> Rules
- Dataflow Port Connections
- Dataflow Value Connections
- Dataflow Input Port Assignment := Rule
- Immutable Value Connections
- Different Type Connections
- Multiple Connections
- Mixing Assignments and Connections
- Connection Statement Order
- Connection and Initial Conditions
- Open (Unconnected) Ports
- Initial Condition Cyclic Loop Errors
- Valid Connection and Assignment Examples
- Future Work
Key Differences Between <>
and :=
🔗
Criteria | <> Connection |
:= Assignment |
---|---|---|
Code | ||
Functional Diagram |
We use a double line arrow to indicate a dataflow dependency with an initial condition dependency. |
We use a single line arrow to indicate a dataflow dependency without affecting initial conditions of the consumer. |
Directionality & Commutativity |
The operator is commutative, meaning a <> b is equivalent to b b <> a . One argument is the producer, while the other consumer. The dataflow direction is sensitive to the context in which the operator is applied. |
The operator is non-commutative, meaning a := b determines that b is the producer, transferring data to the consumer a . |
Initialization | Initialization is transferred to the consumer. | The consumer initialization is not affected. |
Mutation | A consumer can only be connected once. | Consumer assignments are unlimited. |
Statement Order | Connections statements can be placed in any order. | Assignment statements |
Connection <>
Rules🔗
Dataflow Port Connections🔗
Connections annotation is generally used to connect parent designs to their child designs (components) and connect between sibling designs (children of the same parent). Opposed to VHDL/Verilog, there is no need to go through 'signals' to connect sibling design ports, e.g.:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Dataflow Value Connections🔗
At least one of the connected sides must be a dataflow port (cannot connect two dataflow values together), e.g.:
1 2 3 4 5 6 7 |
|
Dataflow Input Port Assignment :=
Rule🔗
An input port cannot be assigned to. A connection must be used to transfer data to an input port, e.g.:
1 2 3 4 5 6 7 8 9 10 11 |
|
Immutable Value Connections🔗
When connecting a port to an immutable value, the port must be a consumer, meaning the connection is done internally to an output port or externally to an input port, e.g.:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Different Type Connections🔗
Connecting between different types is possible, but depends on the specific type: if it enables automatic conversion for the connection to succeed. Different port widths are considered different types and casting is required. An alias/casted/converted dataflow value is considered immutable for the connection (see above). Here are some examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Multiple Connections🔗
Two or more dataflow producers cannot be connected to the same consumer (a single producer can be connected to more than one consumer), e.g.:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Mixing Assignments and Connections🔗
The same consumer cannot be both assigned to and connected to as the consumer, e.g.:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Connection Statement Order🔗
The connection <>
statement ordering does not matter.
Connection and Initial Conditions🔗
A connection <>
transfers initial conditions to the consumer, but if the consumer is already initialized then the consumer keeps its existing initial conditions. Here is an example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
We learn from the above that port initial conditions are often overridden due to connections. So why should we apply initial conditions to a port? Answer: If we want to define what happens when a port is open (unconnected). Read the next two sections for more information.
Open (Unconnected) Ports🔗
Ports have two connection sides: a consumer side and a producer side. Typically ports have both sides connected, except for top-level ports. When either port side is unconnected, we refer to it as open, and expect the following behavior:
-
When the port consumer side is open, the port produces tokens according to its initial condition. Uninitialized open-consumer ports generate bubble tokens.
-
When the port producer side is open (unless it is a top-level output port), the port is considered as not used, and is pruned during compilation. All dataflow streams that are only used by this port will be pruned as well.
Note: the current compiler implementation does not warn of open ports.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Initial Condition Cyclic Loop Errors🔗
Connections enable dataflow feedbacks and even dataflow dependency loops. There is no problem in dependency loops, other than pipelining limitations (see chapter TBD for more information). However, if we only apply connections and references that transfer initial conditions, we end up with a cyclic dependency for initial condition which is illegal. Therefore to enable dependency loops, at least one link in the loop must be an assignment, which has an implicit state and does not affect initial conditions. Consider the following examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
Note: when following the drawing convention within this document, we want to avoid a double-lined loop in order to avoid a cyclic initial conditions dependency.
Valid Connection and Assignment Examples🔗
1 2 3 4 5 |
|
1 2 3 4 5 6 7 |
|
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 7 |
|
1 2 3 4 5 6 7 8 9 |
|
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Note: although there is a feedback in this design, there is no circular initial conditions dependency.
Future Work🔗
- In the future
<>
will be used to connect multi-port interfaces. - We will add support to treat an alias of a port as a port when connection
<>
rules are enforced. - Connecting between any ancestor which is not a parent and child. Currently not supported fully.