From 43820b070057fc7219545980f6706ad78afe8834 Mon Sep 17 00:00:00 2001 From: Gabriel Busnot Date: Tue, 22 Mar 2022 13:17:06 +0100 Subject: [PATCH] misc: Represent Int links as directional edges Int links are uni-directional in Ruby. This patch make them unidirectional in the dot representation as well. Change-Id: I86086d6689bfaa76856b84bf4cac3701d1e5cad9 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61010 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- src/python/m5/util/dot_writer_ruby.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/python/m5/util/dot_writer_ruby.py b/src/python/m5/util/dot_writer_ruby.py index 1794cef759..314ea781fc 100644 --- a/src/python/m5/util/dot_writer_ruby.py +++ b/src/python/m5/util/dot_writer_ruby.py @@ -73,6 +73,17 @@ def _dot_create_ctrl_node(full_path, label): fontcolor = "#000000" \ ) +def _dot_create_int_edge(src, dst): + return pydot.Edge(src, dst, + weight = .5, + color = '#042d50', + dir = 'forward') + +def _dot_create_ext_edge(src, dst): + return pydot.Edge(src, dst, + weight = 1.0, + color = '#381526', + dir = 'both') def _dot_create(network, callgraph): for r in network.routers: @@ -86,7 +97,7 @@ def _dot_create(network, callgraph): (connected[link.src_node.path()] == link.dst_node.path()): continue callgraph.add_edge( - pydot.Edge(link.src_node.path(), link.dst_node.path()) + _dot_create_int_edge(link.src_node.path(), link.dst_node.path()) ) connected[link.dst_node.path()] = link.src_node.path() @@ -114,9 +125,8 @@ def _dot_create(network, callgraph): _dot_create_ctrl_node(ctrl.path(), label) ) - callgraph.add_edge( - pydot.Edge(link.ext_node.path(), link.int_node.path()) - ) + callgraph.add_edge(_dot_create_ext_edge( + link.ext_node.path(), link.int_node.path())) def _do_dot(network, outdir, dotFilename): callgraph = pydot.Dot(graph_type='graph', rankdir='LR')