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

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

34# import the SWIG-wrapped main C++ functions
35import internal
36import core
37import stats
38from main import options
39import SimObject
40import ticks
41import objects
42
43# define a MaxTick parameter
44MaxTick = 2**63 - 1
45
46# The final hook to generate .ini files. Called from the user script
47# once the config is built.
48def instantiate(root):
49 # we need to fix the global frequency
50 ticks.fixGlobalFrequency()
51
52 root.unproxy_all()
53
54 if options.dump_config:
55 ini_file = file(os.path.join(options.outdir, options.dump_config), 'w')
56 root.print_ini(ini_file)

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

131 else:
132 all_drained = True
133 internal.event.cleanupCountedDrain(drain_event)
134 return all_drained
135
136def resume(root):
137 root.resume()
138
139def checkpoint(root, dir):
140 if not isinstance(root, objects.Root):
141 raise TypeError, "Checkpoint must be called on a root object."
142 doDrain(root)
143 print "Writing checkpoint"
144 internal.core.serializeAll(dir)
145 resume(root)
146
147def restoreCheckpoint(root, dir):
148 print "Restoring from checkpoint"
149 internal.core.unserializeAll(dir)
150 need_resume.append(root)
151 stats.reset()
152
153def changeToAtomic(system):
154 if not isinstance(system, (objects.Root, objects.System)):
155 raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \

--- 38 unchanged lines hidden ---