![]() |
lingua-franca 0.10.1
Lingua Franca code generator
|
This class contains the enclave connection graph. More...
Public Member Functions | |
| void | build (ReactorInstance main, Set< CEnclaveInstance > enclaves) |
| Build the enclave graph. | |
| String | buildCycleString () |
| If a zero-delay cycle is found and stored in the zeroDelayCycle field. | |
| CEnclaveGraph (CEnclavedReactorTransformation ast) | |
| record | EnclaveConnection (TimeValue delay, boolean hasAfterDelay, boolean isPhysical) |
| A record to store the information about an enclave connection. | |
| boolean | hasZeroDelayCycle () |
| Return whether the enclave graph has a zero-delay cycle. | |
Public Attributes | |
| ConnectionGraph< CEnclaveInstance, EnclaveConnection > | graph = new ConnectionGraph<>() |
| The graph. | |
This class contains the enclave connection graph.
This graph is needed to code-generate the topology information in the generated sources. To simplify things we use the AST transformation object. It stores information about the topology as it is doing the AST transformation.
| org.lflang.generator.c.CEnclaveGraph.CEnclaveGraph | ( | CEnclavedReactorTransformation | ast | ) |
| void org.lflang.generator.c.CEnclaveGraph.build | ( | ReactorInstance | main, |
| Set< CEnclaveInstance > | enclaves ) |
Build the enclave graph.
This function takes the main reactor instance and the set of enclave instances and does a breadth-first search. When a reactor instance which is annotated with @enclave is found, we check the AST transformation for what instantiations are connected to this reactor. We then look through the other reactor instances at the same level and find the corresponding reactor instance. Understanding this requires that you understand the difference between the Reactor Instances and Reactor Instantiations. The AST transformation knows how the Reactor Instantiations are connected, but we must translate it to how Reactor Instances are connected.
| main | The main reactor, top-level enclave. |
| enclaves | The set of enclaves to build the graph for. |
| String org.lflang.generator.c.CEnclaveGraph.buildCycleString | ( | ) |
If a zero-delay cycle is found and stored in the zeroDelayCycle field.
Create a string containing the cycle. To be printed to the user.
| record org.lflang.generator.c.CEnclaveGraph.EnclaveConnection | ( | TimeValue | delay, |
| boolean | hasAfterDelay, | ||
| boolean | isPhysical ) |
A record to store the information about an enclave connection.
| delay | The delay of the connection. |
| hasAfterDelay | Whether the connection has an after delay. |
| isPhysical | Whether the connection is physical. |
| boolean org.lflang.generator.c.CEnclaveGraph.hasZeroDelayCycle | ( | ) |
Return whether the enclave graph has a zero-delay cycle.
To find zero delay cycles in the enclave graph. We do a Depth First Search from each node and look for backedges. However, since we are interested in zero-delay cycles. We only consider edges without after delay. Edges with 'after 0' introduce a microstep delay.
| ConnectionGraph<CEnclaveInstance, EnclaveConnection> org.lflang.generator.c.CEnclaveGraph.graph = new ConnectionGraph<>() |
The graph.
Public to expose its API to the code generator also.