Deleted Added
sdiff udiff text old ( 8998:c8bf5a20bc07 ) new ( 8999:6f306dd5cee0 )
full compact
1# Copyright (c) 2005 The Regents of The University of Michigan
2# Copyright (c) 2010 Advanced Micro Devices, Inc.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 18 unchanged lines hidden (view full) ---

27#
28# Authors: Nathan Binkert
29# Steve Reinhardt
30
31import atexit
32import os
33import sys
34
35try:
36 import pydot
37except:
38 pydot = False
39
40
41# import the SWIG-wrapped main C++ functions
42import internal
43import core
44import stats
45import SimObject
46import ticks
47import objects
48from util import fatal
49from util import attrdict
50
51# define a MaxTick parameter
52MaxTick = 2**63 - 1
53
54# The final hook to generate .ini files. Called from the user script
55# once the config is built.

--- 27 unchanged lines hidden (view full) ---

83 import json
84 json_file = file(os.path.join(options.outdir, options.json_config), 'w')
85 d = root.get_config_as_dict()
86 json.dump(d, json_file, indent=4)
87 json_file.close()
88 except ImportError:
89 pass
90
91 if pydot:
92 doDot(root)
93
94 # Initialize the global statistics
95 stats.initSimStats()
96
97 # Create the C++ sim objects and connect ports
98 for obj in root.descendants(): obj.createCCObject()
99 for obj in root.descendants(): obj.connectPorts()
100

--- 14 unchanged lines hidden (view full) ---

115 for obj in root.descendants(): obj.loadState(ckpt)
116 need_resume.append(root)
117 else:
118 for obj in root.descendants(): obj.initState()
119
120 # Reset to put the stats in a consistent state.
121 stats.reset()
122
123def doDot(root):
124 from m5 import options
125 dot = pydot.Dot()
126 root.outputDot(dot)
127 dot.orientation = "portrait"
128 dot.size = "8.5,11"
129 dot.ranksep="equally"
130 dot.rank="samerank"
131 dot_filename = os.path.join(options.outdir, options.dot_config)
132 dot.write(dot_filename)
133 dot.write_pdf(dot_filename + ".pdf")
134
135need_resume = []
136need_startup = True
137def simulate(*args, **kwargs):
138 global need_resume, need_startup
139
140 if need_startup:
141 root = objects.Root.getInstance()
142 for obj in root.descendants(): obj.startup()

--- 96 unchanged lines hidden ---