> 3. Add a phase to the initialization process to make this cleaner.
> Possibilities:
>   a. Add a second-stage init() call in step 1d so that we can keep
> the code in question occurring after the current init(), but move it
> before the checkpoint restore.
>   b. Add a new call in step 3 before startup() that's only called on
> objects that don't get unserialized (this is basically an
> even-more-first-class variant of solution 1b above, since it moves the
> checking of checkpointRestored up into SimObject as well).

I've long thought that it would be nice if we could have multi step
init/startup.  The basic way to do it is to have init() return a bool.
 If it's true, then that object should have init called again in a
second round.  (Same goes for startup()).  The only question is if we
want to have init and startup take an unsigned parameter that
indicates which round is active.  I'd think that we'd want to since
we'd otherwise have to keep track of it ourselves in every object.
I'm even willing to do most of the work since it will give me an
excuse to move the init and startup iteration code into python.

It would involve a lot of search and replace, but would give you
exactly what you need and would be relatively straightforward to use.

  Nate
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to