On Wed, Jun 23, 2010 at 10:30 PM, nathan binkert <n...@binkert.org> wrote:
>
> 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.

Is there a big benefit to moving that 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.

The thing this solution doesn't provide is a general facility for
initialization code that's only run if you're not restoring from a
checkpoint.  The more I think about it, the more I think that's the
key here.  You might be able to work around it by doing unnecessary
initialization in init() that just gets overwritten when you
unserialize, but there may be cases where that's not pretty.  For
example, I could see where you need a kernel image to load if you're
not unserializing, but you could skip that parameter if you are.

Steve
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to