wtk-viz relation_file.rel relation_graph.dot dot -Tsvg relation_graph.dot -o relation_graph.svg
Viz (Visualization)
For assistance in visualizing the IR, we came up with an IR to Graphviz converter (called wtk-viz
).
wtk-viz
expects its input to be a relation, and produces a dot graph as output.
It traverses the IR Syntax Tree, and in most cases makes a fairly naive translation into the Dot language.
In the case of for-loops, wtk-viz
repeats the loop scope mappings for each iteration of the loop, as it shows a better picture of the web created by repeated mappings.
Command Line Usage
wtk-viz
accepts arguments in a [ options… ] <input.rel> [ <output.rel> ]
form.
These are the available options.
--fg <color>
|
Changes the color of nodes, edges, and text ("foreground") to the given HTML color. |
--bg <color>
|
Changes the color of the background to the given HTML color. |
-f
|
Use FlatBuffers to parse the binary relation (defaults to Text/IRRegular). |
-h or --help`
|
Print the help text. |
-v or --version`
|
Print the version information. |
Example invocations
wtk-viz
is invoked first to produce dot source, followed by the dot
compiler to generate an image.
dot
invocation may take a long time for large circuits.