simulate.cc (9174:2171e04a2ee5) simulate.cc (9356:b279bad40aa3)
1/*
2 * Copyright (c) 2006 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;

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

28 * Authors: Nathan Binkert
29 * Steve Reinhardt
30 */
31
32#include "base/misc.hh"
33#include "base/pollevent.hh"
34#include "base/types.hh"
35#include "sim/async.hh"
1/*
2 * Copyright (c) 2006 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;

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

28 * Authors: Nathan Binkert
29 * Steve Reinhardt
30 */
31
32#include "base/misc.hh"
33#include "base/pollevent.hh"
34#include "base/types.hh"
35#include "sim/async.hh"
36#include "sim/eventq.hh"
36#include "sim/eventq_impl.hh"
37#include "sim/sim_events.hh"
38#include "sim/sim_exit.hh"
39#include "sim/simulate.hh"
40#include "sim/stat_control.hh"
41
42/** Simulate for num_cycles additional cycles. If num_cycles is -1
43 * (the default), do not limit simulation; some other event must
44 * terminate the loop. Exported to Python via SWIG.

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

60
61 while (1) {
62 // there should always be at least one event (the SimLoopExitEvent
63 // we just scheduled) in the queue
64 assert(!mainEventQueue.empty());
65 assert(curTick() <= mainEventQueue.nextTick() &&
66 "event scheduled in the past");
67
37#include "sim/sim_events.hh"
38#include "sim/sim_exit.hh"
39#include "sim/simulate.hh"
40#include "sim/stat_control.hh"
41
42/** Simulate for num_cycles additional cycles. If num_cycles is -1
43 * (the default), do not limit simulation; some other event must
44 * terminate the loop. Exported to Python via SWIG.

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

60
61 while (1) {
62 // there should always be at least one event (the SimLoopExitEvent
63 // we just scheduled) in the queue
64 assert(!mainEventQueue.empty());
65 assert(curTick() <= mainEventQueue.nextTick() &&
66 "event scheduled in the past");
67
68 // forward current cycle to the time of the first event on the
69 // queue
70 curTick(mainEventQueue.nextTick());
71 Event *exit_event = mainEventQueue.serviceOne();
72 if (exit_event != NULL) {
73 // hit some kind of exit event; return to Python
74 // event must be subclass of SimLoopExitEvent...
75 SimLoopExitEvent *se_event;
76 se_event = dynamic_cast<SimLoopExitEvent *>(exit_event);
77
78 if (se_event == NULL)

--- 41 unchanged lines hidden ---
68 Event *exit_event = mainEventQueue.serviceOne();
69 if (exit_event != NULL) {
70 // hit some kind of exit event; return to Python
71 // event must be subclass of SimLoopExitEvent...
72 SimLoopExitEvent *se_event;
73 se_event = dynamic_cast<SimLoopExitEvent *>(exit_event);
74
75 if (se_event == NULL)

--- 41 unchanged lines hidden ---