Deleted Added
sdiff udiff text old ( 3681:129a68314264 ) new ( 3999:ba54519a7a92 )
full compact
1# Copyright (c) 2006 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
9# notice, this list of conditions and the following disclaimer in the

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

139
140 cpts.sort(lambda a,b: cmp(long(a), long(b)))
141
142 cpt_num = options.checkpoint_restore
143
144 if cpt_num > len(cpts):
145 m5.panic('Checkpoint %d not found' % cpt_num)
146
147 m5.restoreCheckpoint(root,
148 joinpath(cptdir, "cpt.%s" % cpts[cpt_num - 1]))
149
150 if options.standard_switch or cpu_class:
151 exit_event = m5.simulate(10000)
152
153 ## when you change to Timing (or Atomic), you halt the system given
154 ## as argument. When you are finished with the system changes

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

180 exit_event = m5.simulate(when - m5.curTick())
181
182 if exit_event.getCause() == "simulate() limit reached":
183 m5.checkpoint(root, joinpath(cptdir, "cpt.%d"))
184 num_checkpoints += 1
185
186 sim_ticks = when
187 exit_cause = "maximum %d checkpoints dropped" % max_checkpoints
188 while num_checkpoints < max_checkpoints:
189 if (sim_ticks + period) > maxtick:
190 exit_event = m5.simulate(maxtick - sim_ticks)
191 exit_cause = exit_event.getCause()
192 break
193 else:
194 exit_event = m5.simulate(period)
195 sim_ticks += period
196 while exit_event.getCause() == "checkpoint":
197 exit_event = m5.simulate(sim_ticks - m5.curTick())
198 if exit_event.getCause() == "simulate() limit reached":
199 m5.checkpoint(root, joinpath(cptdir, "cpt.%d"))
200 num_checkpoints += 1
201
202 else: #no checkpoints being taken via this script
203 exit_event = m5.simulate(maxtick)
204
205 while exit_event.getCause() == "checkpoint":
206 m5.checkpoint(root, joinpath(cptdir, "cpt.%d"))
207 num_checkpoints += 1
208 if num_checkpoints == max_checkpoints:
209 exit_cause = "maximum %d checkpoints dropped" % max_checkpoints
210 break
211
212 exit_event = m5.simulate(maxtick - m5.curTick())
213 exit_cause = exit_event.getCause()
214
215 if exit_cause == '':
216 exit_cause = exit_event.getCause()
217 print 'Exiting @ cycle %i because %s' % (m5.curTick(), exit_cause)
218