main.cc (3356:39c17056dd41) main.cc (3511:8cb26619b6ec)
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;

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

304
305
306/** Simulate for num_cycles additional cycles. If num_cycles is -1
307 * (the default), do not limit simulation; some other event must
308 * terminate the loop. Exported to Python via SWIG.
309 * @return The SimLoopExitEvent that caused the loop to exit.
310 */
311SimLoopExitEvent *
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;

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

304
305
306/** Simulate for num_cycles additional cycles. If num_cycles is -1
307 * (the default), do not limit simulation; some other event must
308 * terminate the loop. Exported to Python via SWIG.
309 * @return The SimLoopExitEvent that caused the loop to exit.
310 */
311SimLoopExitEvent *
312simulate(Tick num_cycles = -1)
312simulate(Tick num_cycles = MaxTick)
313{
314 warn("Entering event queue @ %d. Starting simulation...\n", curTick);
315
313{
314 warn("Entering event queue @ %d. Starting simulation...\n", curTick);
315
316 // Fix up num_cycles. Special default value -1 means simulate
317 // "forever"... schedule event at MaxTick just to be safe.
318 // Otherwise it's a delta for additional cycles to simulate past
319 // curTick, and thus must be non-negative.
320 if (num_cycles == -1)
321 num_cycles = MaxTick;
322 else if (num_cycles < 0)
316 if (num_cycles < 0)
323 fatal("simulate: num_cycles must be >= 0 (was %d)\n", num_cycles);
317 fatal("simulate: num_cycles must be >= 0 (was %d)\n", num_cycles);
318 else if (curTick + num_cycles < 0) //Overflow
319 num_cycles = MaxTick;
324 else
325 num_cycles = curTick + num_cycles;
326
327 Event *limit_event = schedExitSimLoop("simulate() limit reached",
328 num_cycles);
329
330 while (1) {
331 // there should always be at least one event (the SimLoopExitEvent

--- 146 unchanged lines hidden ---
320 else
321 num_cycles = curTick + num_cycles;
322
323 Event *limit_event = schedExitSimLoop("simulate() limit reached",
324 num_cycles);
325
326 while (1) {
327 // there should always be at least one event (the SimLoopExitEvent

--- 146 unchanged lines hidden ---