Deleted Added
sdiff udiff text old ( 2770:07a93a0da45b ) new ( 2797:b5f26b4eacef )
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;

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

57#include "base/time.hh"
58#include "cpu/base.hh"
59#include "cpu/smt.hh"
60#include "mem/mem_object.hh"
61#include "mem/port.hh"
62#include "sim/async.hh"
63#include "sim/builder.hh"
64#include "sim/host.hh"
65#include "sim/sim_events.hh"
66#include "sim/sim_exit.hh"
67#include "sim/sim_object.hh"
68#include "sim/stat_control.hh"
69#include "sim/stats.hh"
70#include "sim/root.hh"
71
72using namespace std;

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

516 pollQueue.service();
517 }
518 }
519 }
520
521 // not reached... only exit is return on SimLoopExitEvent
522}
523
524/**
525 * Queue of C++ callbacks to invoke on simulator exit.
526 */
527CallbackQueue exitCallbacks;
528
529/**
530 * Register an exit callback.
531 */
532void
533registerExitCallback(Callback *callback)
534{
535 exitCallbacks.add(callback);
536}
537
538/**
539 * Do C++ simulator exit processing. Exported to SWIG to be invoked
540 * when simulator terminates via Python's atexit mechanism.
541 */
542void
543doExitCleanup()
544{
545 exitCallbacks.process();
546 exitCallbacks.clear();
547
548 cout.flush();
549
550 ParamContext::cleanupAllContexts();
551
552 // print simulation stats
553 Stats::DumpNow();
554}