lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.generator.c.CEnclaveGraph Class Reference

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, EnclaveConnectiongraph = new ConnectionGraph<>()
 The graph.

Detailed Description

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.

Constructor & Destructor Documentation

◆ CEnclaveGraph()

org.lflang.generator.c.CEnclaveGraph.CEnclaveGraph ( CEnclavedReactorTransformation ast)

Member Function Documentation

◆ build()

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.

Parameters
mainThe main reactor, top-level enclave.
enclavesThe set of enclaves to build the graph for.

◆ buildCycleString()

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.

Returns
The string representing the cycle.

◆ EnclaveConnection()

record org.lflang.generator.c.CEnclaveGraph.EnclaveConnection ( TimeValue delay,
boolean hasAfterDelay,
boolean isPhysical )

A record to store the information about an enclave connection.

Parameters
delayThe delay of the connection.
hasAfterDelayWhether the connection has an after delay.
isPhysicalWhether the connection is physical.

◆ hasZeroDelayCycle()

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.

Member Data Documentation

◆ graph

ConnectionGraph<CEnclaveInstance, EnclaveConnection> org.lflang.generator.c.CEnclaveGraph.graph = new ConnectionGraph<>()

The graph.

Public to expose its API to the code generator also.


The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/generator/c/CEnclaveGraph.java