Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I've been working on some utilities to analyze the DOT files generated by Verilator, using the GraphViz cgraph library (more about this shortly). Verilator labels its graphs by creating a custom node, nTITLE, formatted with a black box around it. However this is mildly inconvenient - it creates a "special" node, which has to be found to determine the title.
I've modified V3Graph.cpp to generate instead a "label" attribute for the graph title, along with labelloc and labeljust to position it at the top left of the graph. This is not quite as powerful visually as a custom node (you can't specify a box around it), but it avoids having a "special" node, and allows the graph title to be easily found. Details of the permitted attributes can be found at http://www.graphviz.org/doc/info/attrs.html
It seems from cgraph that GraphViz prefers DOT graph attributes to be specified as attributes of the graph entity, rather than just within the graph itself. I.e. rather than:
This patch also makes this change. Please pull the patch from the graphviz-fix branch at git://github.com/jeremybennett/verilator.git.