Review Board 2.0.15


sim: revamp unserialization procedure

Review Request #80 - Created July 29, 2010 and submitted

Information
Steve Reinhardt
gem5
Reviewers
Default
sim: revamp unserialization procedure

Replace direct call to unserialize() on each SimObject with a pair of
calls for better control over initialization in both ckpt and non-ckpt
cases.

If restoring from a checkpoint, loadState(ckpt) is called on each
SimObject.  The default implementation simply calls unserialize() if
there is a corresponding checkpoint section, so we get backward
compatibility for existing objects.  However, objects can override
loadState() to get other behaviors, e.g., doing other programmed
initializations after unserialize(), or complaining if no checkpoint
section is found.  (Note that the default warning for a missing
checkpoint section is now gone.)

If not restoring from a checkpoint, we call the new initState() method
on each SimObject instead.  This provides a hook for state
initializations that are only required when *not* restoring from a
checkpoint.

Given this new framework, do some cleanup of LiveProcess subclasses
and X86System, which were (in some cases) emulating initState()
behavior in startup via a local flag or (in other cases) erroneously
doing initializations in startup() that clobbered state loaded earlier
by unserialize().

   
Posted (Aug. 6, 2010, 4:16 a.m.)



  
src/arch/alpha/process.cc (Diff revision 1)
 
 
I think that you can safely get rid of checkpointRestored completely, no?  From the diff, it looks as if it still lingers.
src/sim/sim_object.hh (Diff revision 1)
 
 
Can you please add some comments here explaining exactly what these are for and how they are called?  In one of the older e-mails, you wrote up some pseudo code that described the initialization procedure.  Perhaps you can put it here as well.