simulate.cc (4385:5beaa4f8f821) simulate.cc (5606:6da7a58b0bc8)
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;

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

51
52 if (num_cycles < 0)
53 fatal("simulate: num_cycles must be >= 0 (was %d)\n", num_cycles);
54 else if (curTick + num_cycles < 0) //Overflow
55 num_cycles = MaxTick;
56 else
57 num_cycles = curTick + num_cycles;
58
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;

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

51
52 if (num_cycles < 0)
53 fatal("simulate: num_cycles must be >= 0 (was %d)\n", num_cycles);
54 else if (curTick + num_cycles < 0) //Overflow
55 num_cycles = MaxTick;
56 else
57 num_cycles = curTick + num_cycles;
58
59 Event *limit_event;
60 limit_event = schedExitSimLoop("simulate() limit reached", num_cycles);
59 Event *limit_event =
60 new SimLoopExitEvent("simulate() limit reached", 0);
61 mainEventQueue.schedule(limit_event, num_cycles);
61
62 while (1) {
63 // there should always be at least one event (the SimLoopExitEvent
64 // we just scheduled) in the queue
65 assert(!mainEventQueue.empty());
66 assert(curTick <= mainEventQueue.nextTick() &&
67 "event scheduled in the past");
68

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

77 se_event = dynamic_cast<SimLoopExitEvent *>(exit_event);
78
79 if (se_event == NULL)
80 panic("Bogus exit event class!");
81
82 // if we didn't hit limit_event, delete it
83 if (se_event != limit_event) {
84 assert(limit_event->scheduled());
62
63 while (1) {
64 // there should always be at least one event (the SimLoopExitEvent
65 // we just scheduled) in the queue
66 assert(!mainEventQueue.empty());
67 assert(curTick <= mainEventQueue.nextTick() &&
68 "event scheduled in the past");
69

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

78 se_event = dynamic_cast<SimLoopExitEvent *>(exit_event);
79
80 if (se_event == NULL)
81 panic("Bogus exit event class!");
82
83 // if we didn't hit limit_event, delete it
84 if (se_event != limit_event) {
85 assert(limit_event->scheduled());
85 limit_event->deschedule();
86 delete limit_event;
86 limit_event->squash();
87 warn_once("be nice to actually delete the event here");
87 }
88
89 return se_event;
90 }
91
92 if (async_event) {
93 async_event = false;
94 if (async_statdump || async_statreset) {

--- 26 unchanged lines hidden ---
88 }
89
90 return se_event;
91 }
92
93 if (async_event) {
94 async_event = false;
95 if (async_statdump || async_statreset) {

--- 26 unchanged lines hidden ---