DOT: improved dot-based system visualization

Revised system visualization to reflect structure and memory hierarchy.
Improved visualization: less congested and cluttered; more colorful.
Nodes reflect components; directed edges reflect dirctional relation, from
a master port to a slave port. Requires pydot.
This commit is contained in:
Uri Wiener
2012-05-10 18:04:27 -05:00
parent cb1b63ea61
commit 29a5e6ff35
4 changed files with 195 additions and 63 deletions

View File

@@ -44,11 +44,6 @@
import sys
from types import FunctionType, MethodType, ModuleType
try:
import pydot
except:
pydot = False
import m5
from m5.util import *
@@ -1060,44 +1055,6 @@ class SimObject(object):
def takeOverFrom(self, old_cpu):
self._ccObject.takeOverFrom(old_cpu._ccObject)
# generate output file for 'dot' to display as a pretty graph.
def outputDot(self, dot):
if isRoot(self):
label = "{root|"
else:
label = "{%s|" % self._name
if isSimObject(self._base):
label += '%s|' % self.type
if self._children:
for c in self._children:
child = self._children[c]
if isSimObjectVector(child):
for obj in child:
dot.add_edge(pydot.Edge(self.path(), obj.path(), style="bold"))
else:
dot.add_edge(pydot.Edge(self.path(), child.path(), style="bold"))
for param in self._params.keys():
value = self._values.get(param)
if value != None:
ini_str_value = self._values[param].ini_str()
label += '%s = %s\\n' % (param, re.sub(':', '-', ini_str_value))
label += '}'
dot.add_node(pydot.Node(self.path(), shape="Mrecord",label=label))
# recursively dump out children
for c in self._children:
child = self._children[c]
if isSimObjectVector(child):
for obj in child:
obj.outputDot(dot)
else:
child.outputDot(dot)
# Function to provide to C++ so it can look up instances based on paths
def resolveSimObject(name):
obj = instanceDict[name]