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;
--- 39 unchanged lines hidden (view full) ---
48#include <vector>
49
50#include "base/callback.hh"
51#include "base/inifile.hh"
52#include "base/misc.hh"
53#include "base/output.hh"
54#include "base/pollevent.hh"
55#include "base/statistics.hh"
56#include "base/stats/output.hh"
57#include "base/str.hh"
58#include "base/time.hh"
59#include "config/pythonhome.hh"
60#include "cpu/base.hh"
61#include "cpu/smt.hh"
62#include "mem/mem_object.hh"
63#include "mem/port.hh"
64#include "python/swig/init.hh"
--- 151 unchanged lines hidden (view full) ---
216{
217 resolveFunc = _resolveFunc;
218 configStream = simout.find("config.out");
219
220 // The configuration database is now complete; start processing it.
221 inifile.load(simout.resolve("config.ini"));
222
223 // Initialize statistics database
224 Stats::initSimStats();
225}
226
227
228/**
229 * Look up a MemObject port. Helper function for connectPorts().
230 */
231Port *
232lookupPort(SimObject *so, const std::string &name, int i)
--- 60 unchanged lines hidden (view full) ---
293 Stats::check();
294
295 // Reset to put the stats in a consistent state.
296 Stats::reset();
297
298 SimStartup();
299}
300
301/** Simulate for num_cycles additional cycles. If num_cycles is -1
302 * (the default), do not limit simulation; some other event must
303 * terminate the loop. Exported to Python via SWIG.
304 * @return The SimLoopExitEvent that caused the loop to exit.
305 */
306SimLoopExitEvent *
307simulate(Tick num_cycles = MaxTick)
308{
--- 36 unchanged lines hidden (view full) ---
345
346 return se_event;
347 }
348
349 if (async_event) {
350 async_event = false;
351 if (async_dump) {
352 async_dump = false;
353 Stats::StatEvent(true, false);
354 }
355
356 if (async_dumpreset) {
357 async_dumpreset = false;
358 Stats::StatEvent(true, true);
359 }
360
361 if (async_exit) {
362 async_exit = false;
363 exitSimLoop("user interrupt received");
364 }
365
366 if (async_io || async_alarm) {
--- 93 unchanged lines hidden (view full) ---
460 exitCallbacks().process();
461 exitCallbacks().clear();
462
463 cout.flush();
464
465 ParamContext::cleanupAllContexts();
466
467 // print simulation stats
468 Stats::dump();
469}
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;
--- 39 unchanged lines hidden (view full) ---
48#include <vector>
49
50#include "base/callback.hh"
51#include "base/inifile.hh"
52#include "base/misc.hh"
53#include "base/output.hh"
54#include "base/pollevent.hh"
55#include "base/statistics.hh"
56#include "base/stats/output.hh"
57#include "base/str.hh"
58#include "base/time.hh"
59#include "config/pythonhome.hh"
60#include "cpu/base.hh"
61#include "cpu/smt.hh"
62#include "mem/mem_object.hh"
63#include "mem/port.hh"
64#include "python/swig/init.hh"
--- 151 unchanged lines hidden (view full) ---
216{
217 resolveFunc = _resolveFunc;
218 configStream = simout.find("config.out");
219
220 // The configuration database is now complete; start processing it.
221 inifile.load(simout.resolve("config.ini"));
222
223 // Initialize statistics database
224 Stats::initSimStats();
225}
226
227
228/**
229 * Look up a MemObject port. Helper function for connectPorts().
230 */
231Port *
232lookupPort(SimObject *so, const std::string &name, int i)
--- 60 unchanged lines hidden (view full) ---
293 Stats::check();
294
295 // Reset to put the stats in a consistent state.
296 Stats::reset();
297
298 SimStartup();
299}
300
301/** Simulate for num_cycles additional cycles. If num_cycles is -1
302 * (the default), do not limit simulation; some other event must
303 * terminate the loop. Exported to Python via SWIG.
304 * @return The SimLoopExitEvent that caused the loop to exit.
305 */
306SimLoopExitEvent *
307simulate(Tick num_cycles = MaxTick)
308{
--- 36 unchanged lines hidden (view full) ---
345
346 return se_event;
347 }
348
349 if (async_event) {
350 async_event = false;
351 if (async_dump) {
352 async_dump = false;
353 Stats::StatEvent(true, false);
354 }
355
356 if (async_dumpreset) {
357 async_dumpreset = false;
358 Stats::StatEvent(true, true);
359 }
360
361 if (async_exit) {
362 async_exit = false;
363 exitSimLoop("user interrupt received");
364 }
365
366 if (async_io || async_alarm) {
--- 93 unchanged lines hidden (view full) ---
460 exitCallbacks().process();
461 exitCallbacks().clear();
462
463 cout.flush();
464
465 ParamContext::cleanupAllContexts();
466
467 // print simulation stats
468 Stats::dump();
469}