Deleted Added
sdiff udiff text old ( 3102:225b76c8ac68 ) new ( 3132:a7dbdfa5958f )
full compact
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

409unserializeAll(const std::string &cpt_dir)
410{
411 Serializable::unserializeAll(cpt_dir);
412}
413
414/**
415 * Queue of C++ callbacks to invoke on simulator exit.
416 */
417CallbackQueue exitCallbacks;
418
419/**
420 * Register an exit callback.
421 */
422void
423registerExitCallback(Callback *callback)
424{
425 exitCallbacks.add(callback);
426}
427
428BaseCPU *
429convertToBaseCPUPtr(SimObject *obj)
430{
431 BaseCPU *ptr = dynamic_cast<BaseCPU *>(obj);
432
433 if (ptr == NULL)
434 warn("Casting to BaseCPU pointer failed");
435 return ptr;
436}
437
438/**
439 * Do C++ simulator exit processing. Exported to SWIG to be invoked
440 * when simulator terminates via Python's atexit mechanism.
441 */
442void
443doExitCleanup()
444{
445 exitCallbacks.process();
446 exitCallbacks.clear();
447
448 cout.flush();
449
450 ParamContext::cleanupAllContexts();
451
452 // print simulation stats
453 Stats::DumpNow();
454}