Deleted Added
sdiff udiff text old ( 4385:5beaa4f8f821 ) new ( 5606:6da7a58b0bc8 )
full compact
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 new SimLoopExitEvent("simulate() limit reached", 0);
61 mainEventQueue.schedule(limit_event, num_cycles);
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());
86 limit_event->squash();
87 warn_once("be nice to actually delete the event here");
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 ---