summaryrefslogtreecommitdiff
path: root/src/python/m5/simulate.py
diff options
context:
space:
mode:
authorUri Wiener <uri.wiener@arm.com>2012-05-10 18:04:27 -0500
committerUri Wiener <uri.wiener@arm.com>2012-05-10 18:04:27 -0500
commitcb1b63ea61c597e680adf80540ad65abeceb76a8 (patch)
treeb6831287e68560541031484a9fafcb3919474580 /src/python/m5/simulate.py
parentf2f7fa1a1c23da74c6ca8da8e6539f3330b06da4 (diff)
downloadgem5-cb1b63ea61c597e680adf80540ad65abeceb76a8.tar.xz
DOT: fixed broken code for visualizing configuration using dot
Fixed broken code which visualizes the system configuration by generating a tree from each component's children, starting from root. Requires DOT (hence pydot).
Diffstat (limited to 'src/python/m5/simulate.py')
-rw-r--r--src/python/m5/simulate.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py
index 38129592c..b1d01db3b 100644
--- a/src/python/m5/simulate.py
+++ b/src/python/m5/simulate.py
@@ -32,6 +32,12 @@ import atexit
import os
import sys
+try:
+ import pydot
+except:
+ pydot = False
+
+
# import the SWIG-wrapped main C++ functions
import internal
import core
@@ -82,6 +88,8 @@ def instantiate(ckpt_dir=None):
except ImportError:
pass
+ if pydot:
+ doDot(root)
# Initialize the global statistics
stats.initSimStats()
@@ -113,14 +121,16 @@ def instantiate(ckpt_dir=None):
stats.reset()
def doDot(root):
+ from m5 import options
dot = pydot.Dot()
- instance.outputDot(dot)
+ root.outputDot(dot)
dot.orientation = "portrait"
dot.size = "8.5,11"
dot.ranksep="equally"
dot.rank="samerank"
- dot.write("config.dot")
- dot.write_ps("config.ps")
+ dot_filename = os.path.join(options.outdir, options.dot_config)
+ dot.write(dot_filename)
+ dot.write_pdf(dot_filename + ".pdf")
need_resume = []
need_startup = True