Dataflow Software Stack
032db78
Master Thesis of Mathijs Saey at the VUB
|
DVM Intermediate Graph Representation. More...
Namespaces | |
dot | |
IGR dot parser. | |
graph | |
Complete program. | |
literal | |
Literal definitions. | |
node | |
Node definitions. | |
port | |
Port definitions. | |
subgraph | |
SubGraph definitions. | |
traverse | |
IGR Traversals. | |
Functions | |
Graph | |
def | getSubGraphs |
Get a list of all the non-compound subgraphs in the program. More... | |
def | getSubGraph |
Get a subgraph by name. More... | |
def | removeSubGraph |
Remove a subgraph from the program. More... | |
Subgraphs | |
def | createGeneralSubGraph |
Create a new subgraph. More... | |
def | createSubGraph |
Create a subgraph and add it to the program graph. More... | |
def | createCompoundSubGraph |
Create a subgraph for a compound node. More... | |
Nodes | |
def | createNode |
Create a node, add it to it's subgraph and return it. More... | |
def | createOperationNode |
Create an operation node. More... | |
def | createCompoundNode |
Create a Compound node. More... | |
def | createCallNode |
Create a call node. More... | |
def | createConstantNode |
Create a constant node. More... | |
Edges and Literals | |
def | addLiteral |
Add a literal to a port. More... | |
def | connect |
Connect 2 ports with an implicit edge. More... | |
DVM Intermediate Graph Representation.
This python module contains the DVM intermediate form, called Intermediate Graph Representation (IGR).
The general idea behind IGR is that it doesn't know anything about the outside world. It is only a graph representation that can be modified by both the front and the backend. However, IGR should not depend on either the front or backend, instead, IGR should be rich enough to work with a variety of front and backends.
This module should be considerd a stable frontend of the module, external modules (such as parsers) should only use these functions to create and modify the IGR.
This module also exports 2 functions, dot::dot() and traverse::traverse()
def IGR.getSubGraphs | ( | ) |
Get a list of all the non-compound subgraphs in the program.
def IGR.getSubGraph | ( | name | ) |
Get a subgraph by name.
name | The name of the subgraph we want to retrieve. |
def IGR.removeSubGraph | ( | subGraph | ) |
Remove a subgraph from the program.
This only works for subgraphs that are not a part of a compound node. Care should be taken to avoid calling this method while iterating over the subgraph list.
subGraph | A reference to the subgraph to remove. |
def IGR.createGeneralSubGraph | ( | name, | |
inputs, | |||
outputs, | |||
isFunc | |||
) |
Create a new subgraph.
inputs | The amount of inputs the subgraph accepts |
outputs | The amount of data the subgraph returns |
def IGR.createSubGraph | ( | name, | |
inputs, | |||
outputs | |||
) |
Create a subgraph and add it to the program graph.
def IGR.createCompoundSubGraph | ( | ) |
Create a subgraph for a compound node.
def IGR.createNode | ( | constructor, | |
subGraph, | |||
arguments = [] |
|||
) |
Create a node, add it to it's subgraph and return it.
constructor | The constructor to create the node. |
subGraph | The subgraph that contains this node. |
arguments | The arguments to pass to the constructor (not including the subgraph) |
def IGR.createOperationNode | ( | subGraph, | |
operation | |||
) |
Create an operation node.
subGraph | The subGraph that this node is part of |
operation | The operation that this node performs |
def IGR.createCompoundNode | ( | type, | |
subGraph, | |||
subGraphs | |||
) |
Create a Compound node.
type | The type of the compound node (e.g. forAll) |
subGraph | The subgraph this node belongs too |
subGraphss | The subgraphs that are part of this compound node |
def IGR.createCallNode | ( | subGraph, | |
function | |||
) |
Create a call node.
subGraph | the subgraph this node belongs to |
inputs | the amount of inputs this |
def IGR.createConstantNode | ( | subGraph, | |
value | |||
) |
Create a constant node.
subGraph | The subgraph this node belongs to |
value | The value of this subgraph |
def IGR.addLiteral | ( | value, | |
dstNode, | |||
dstPort | |||
) |
Add a literal to a port.
value | The value of the literal |
dstNode | The node that the literal targets |
dstPort | The idx of the port on this node |
def IGR.connect | ( | srcNode, | |
srcPort, | |||
dstNode, | |||
dstPort | |||
) |
Connect 2 ports with an implicit edge.
srcNode | The node that provides data |
srcPort | The idx of the output port on src |
dstNode | The node that accepts the data |
dstPort | The idx of the port on dst that accepts the data. |