sim: make Python Root object a singleton

Enforce that the Python Root SimObject is instantiated only
once.  The C++ Root object already panics if more than one is
created.  This change avoids the need to track what the root
object is, since it's available from Root.getInstance() (if it
exists).  It's now redundant to have the user pass the root
object to functions like instantiate(), checkpoint(), and
restoreCheckpoint(), so that arg is gone.  Users who use
configs/common/Simulate.py should not notice.
This commit is contained in:
Steve Reinhardt
2010-08-17 05:06:22 -07:00
parent 0f8b5afd7a
commit 1fbe466345
10 changed files with 53 additions and 20 deletions

View File

@@ -181,7 +181,7 @@ else:
m5.ticks.setGlobalFrequency('1ns')
# instantiate configuration
m5.instantiate(root)
m5.instantiate()
# simulate until program terminates
exit_event = m5.simulate(options.maxtick)