misc: Bail out of DVFS dot if we cannot resolve the domains
This changeset updates the dot output to bail out if it is unable to resolve the voltage or clock domains (which will cause it to raise an AttributeError). Additionally, the DVFS dot output is disabled by default for speed purposes. Minor fixup for 0aeca8f.
This commit is contained in:
parent
fd52a63e24
commit
1097aa1638
3 changed files with 18 additions and 9 deletions
|
@ -91,7 +91,7 @@ def parse_options():
|
|||
help="Create JSON output of the configuration [Default: %default]")
|
||||
option("--dot-config", metavar="FILE", default="config.dot",
|
||||
help="Create DOT & pdf outputs of the configuration [Default: %default]")
|
||||
option("--dot-dvfs-config", metavar="FILE", default="config_dvfs.dot",
|
||||
option("--dot-dvfs-config", metavar="FILE", default=None,
|
||||
help="Create DOT & pdf outputs of the DVFS configuration" + \
|
||||
" [Default: %default]")
|
||||
|
||||
|
|
|
@ -129,6 +129,7 @@ def instantiate(ckpt_dir=None):
|
|||
# We want to generate the DVFS diagram for the system. This can only be
|
||||
# done once all of the CPP objects have been created and initialised so
|
||||
# that we are able to figure out which object belongs to which domain.
|
||||
if options.dot_dvfs_config:
|
||||
do_dvfs_dot(root, options.outdir, options.dot_dvfs_config)
|
||||
|
||||
# We're done registering statistics. Enable the stats package now.
|
||||
|
|
|
@ -310,7 +310,7 @@ def dot_create_dvfs_nodes(simNode, callgraph, domain=None):
|
|||
except AttributeError:
|
||||
# Just re-use the domain from above
|
||||
c_dom = domain
|
||||
c_dom.__getattr__('voltage_domain')
|
||||
v_dom = c_dom.__getattr__('voltage_domain')
|
||||
pass
|
||||
|
||||
if c_dom == domain or c_dom == None:
|
||||
|
@ -329,7 +329,7 @@ def dot_create_dvfs_nodes(simNode, callgraph, domain=None):
|
|||
except AttributeError:
|
||||
# Just re-use the domain from above
|
||||
c_dom = domain
|
||||
c_dom.__getattr__('voltage_domain')
|
||||
v_dom = c_dom.__getattr__('voltage_domain')
|
||||
pass
|
||||
|
||||
if c_dom == domain or c_dom == None:
|
||||
|
@ -370,11 +370,19 @@ def do_dot(root, outdir, dotFilename):
|
|||
def do_dvfs_dot(root, outdir, dotFilename):
|
||||
if not pydot:
|
||||
return
|
||||
|
||||
# There is a chance that we are unable to resolve the clock or
|
||||
# voltage domains. If so, we fail silently.
|
||||
try:
|
||||
dvfsgraph = pydot.Dot(graph_type='digraph', ranksep='1.3')
|
||||
dot_create_dvfs_nodes(root, dvfsgraph)
|
||||
dot_create_edges(root, dvfsgraph)
|
||||
dot_filename = os.path.join(outdir, dotFilename)
|
||||
dvfsgraph.write(dot_filename)
|
||||
except:
|
||||
warn("Failed to generate dot graph for DVFS domains")
|
||||
return
|
||||
|
||||
try:
|
||||
# dot crashes if the figure is extremely wide.
|
||||
# So avoid terminating simulation unnecessarily
|
||||
|
|
Loading…
Reference in a new issue