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; --- 52 unchanged lines hidden (view full) --- 61#include "mem/port.hh" 62#include "sim/async.hh" 63#include "sim/builder.hh" 64#include "sim/host.hh" 65#include "sim/serialize.hh" 66#include "sim/sim_events.hh" 67#include "sim/sim_exit.hh" 68#include "sim/sim_object.hh" |
69#include "sim/system.hh" |
70#include "sim/stat_control.hh" 71#include "sim/stats.hh" 72#include "sim/root.hh" 73 74using namespace std; 75 76// See async.h. 77volatile bool async_event = false; --- 358 unchanged lines hidden (view full) --- 436{ 437 BaseCPU *ptr = dynamic_cast<BaseCPU *>(obj); 438 439 if (ptr == NULL) 440 warn("Casting to BaseCPU pointer failed"); 441 return ptr; 442} 443 |
444System * 445convertToSystemPtr(SimObject *obj) 446{ 447 System *ptr = dynamic_cast<System *>(obj); 448 449 if (ptr == NULL) 450 warn("Casting to System pointer failed"); 451 return ptr; 452} 453 454 |
455/** 456 * Do C++ simulator exit processing. Exported to SWIG to be invoked 457 * when simulator terminates via Python's atexit mechanism. 458 */ 459void 460doExitCleanup() 461{ 462 exitCallbacks().process(); 463 exitCallbacks().clear(); 464 465 cout.flush(); 466 467 ParamContext::cleanupAllContexts(); 468 469 // print simulation stats 470 Stats::DumpNow(); 471} |