Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up DOT file output #555

Closed
veripoolbot opened this issue Aug 27, 2012 · 1 comment
Closed

Tidy up DOT file output #555

veripoolbot opened this issue Aug 27, 2012 · 1 comment

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Aug 27, 2012


Author Name: Jeremy Bennett (@jeremybennett)
Original Redmine Issue: 555 from https://www.veripool.org
Original Date: 2012-08-27
Original Assignee: Jeremy Bennett (@jeremybennett)


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:

digraph v3graph {
         label="obj_dir/t_unopt_array/Vt_unopt_array_58_gate_opt.dot";
         labelloc=t;
         labeljust=l;
         //size="7.5,10";
         rankdir=TB;

Use

digraph v3graph {
         graph   [label="obj_dir/t_unopt_array/Vt_unopt_array_58_gate_opt.dot",
                  labelloc=t, labeljust=l,
                  //size="7.5,10",
                  rankdir=TB];

This patch also makes this change. Please pull the patch from the graphviz-fix branch at git://github.com/jeremybennett/verilator.git.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Aug 27, 2012


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-08-27T23:03:27Z


Makes sense; pushed to git for 3.841.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.