scheduler.cc (13702:f2d184ad0886) scheduler.cc (13703:bedf6da29c9b)
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

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

27 * Authors: Gabe Black
28 */
29
30#include "systemc/core/scheduler.hh"
31
32#include "base/fiber.hh"
33#include "base/logging.hh"
34#include "sim/eventq.hh"
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

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

27 * Authors: Gabe Black
28 */
29
30#include "systemc/core/scheduler.hh"
31
32#include "base/fiber.hh"
33#include "base/logging.hh"
34#include "sim/eventq.hh"
35#include "sim/sim_exit.hh"
35#include "systemc/core/kernel.hh"
36#include "systemc/core/sc_main_fiber.hh"
37#include "systemc/ext/core/messages.hh"
38#include "systemc/ext/core/sc_main.hh"
39#include "systemc/ext/utils/sc_report.hh"
40#include "systemc/ext/utils/sc_report_handler.hh"
41#include "systemc/utils/report.hh"
42#include "systemc/utils/tracefile.hh"

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

347}
348
349void
350Scheduler::pause()
351{
352 status(StatusPaused);
353 kernel->status(::sc_core::SC_PAUSED);
354 runOnce = false;
36#include "systemc/core/kernel.hh"
37#include "systemc/core/sc_main_fiber.hh"
38#include "systemc/ext/core/messages.hh"
39#include "systemc/ext/core/sc_main.hh"
40#include "systemc/ext/utils/sc_report.hh"
41#include "systemc/ext/utils/sc_report_handler.hh"
42#include "systemc/utils/report.hh"
43#include "systemc/utils/tracefile.hh"

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

348}
349
350void
351Scheduler::pause()
352{
353 status(StatusPaused);
354 kernel->status(::sc_core::SC_PAUSED);
355 runOnce = false;
355 if (scMainFiber.called() && !scMainFiber.finished())
356 scMainFiber.run();
356 if (scMainFiber.called()) {
357 if (!scMainFiber.finished())
358 scMainFiber.run();
359 } else {
360 if (scMainFiber.finished())
361 fatal("Pausing systemc after sc_main completed.");
362 else
363 exitSimLoopNow("systemc pause");
364 }
357}
358
359void
360Scheduler::stop()
361{
362 status(StatusStopped);
363 kernel->stop();
364
365 clear();
366
367 runOnce = false;
365}
366
367void
368Scheduler::stop()
369{
370 status(StatusStopped);
371 kernel->stop();
372
373 clear();
374
375 runOnce = false;
368 if (scMainFiber.called() && !scMainFiber.finished())
369 scMainFiber.run();
376 if (scMainFiber.called()) {
377 if (!scMainFiber.finished())
378 scMainFiber.run();
379 } else {
380 if (scMainFiber.finished())
381 fatal("Stopping systemc after sc_main completed.");
382 else
383 exitSimLoopNow("systemc stop");
384 }
370}
371
372void
373Scheduler::start(Tick max_tick, bool run_to_time)
374{
375 _started = true;
376 status(StatusOther);
377 runToTime = run_to_time;

--- 134 unchanged lines hidden ---
385}
386
387void
388Scheduler::start(Tick max_tick, bool run_to_time)
389{
390 _started = true;
391 status(StatusOther);
392 runToTime = run_to_time;

--- 134 unchanged lines hidden ---