changeset e4a4cdfb1b81 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=e4a4cdfb1b81
description:
        util: Add ini string as tooltip info in dot output

        This patch adds the config ini string as a tooltip that can be
        displayed in most browsers rendering the resulting svg. Certain
        characters are modified for HTML output.

        Tested on chrome and firefox.

diffstat:

 src/python/m5/util/dot_writer.py |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r 20c07aa9322c -r e4a4cdfb1b81 src/python/m5/util/dot_writer.py
--- a/src/python/m5/util/dot_writer.py  Wed Sep 04 13:22:59 2013 -0400
+++ b/src/python/m5/util/dot_writer.py  Wed Sep 04 13:23:00 2013 -0400
@@ -129,10 +129,22 @@
         callgraph.add_edge(pydot.Edge(full_port_name, peer_port_name))
 
 def dot_create_cluster(simNode, full_path, label):
+    # get the parameter values of the node and use them as a tooltip
+    ini_strings = []
+    for param in sorted(simNode._params.keys()):
+        value = simNode._values.get(param)
+        if value != None:
+            # parameter name = value in HTML friendly format
+            ini_strings.append(str(param) + "=" +
+                               simNode._values[param].ini_str())
+    # join all the parameters with an HTML newline
+    tooltip = "
".join(ini_strings)
+
     return pydot.Cluster( \
                          full_path, \
                          shape = "Mrecord", \
                          label = label, \
+                         tooltip = "\"" + tooltip + "\"", \
                          style = "\"rounded, filled\"", \
                          color = "#000000", \
                          fillcolor = dot_gen_colour(simNode), \
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to