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" |
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; |
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 } |
365} 366 367void 368Scheduler::stop() 369{ 370 status(StatusStopped); 371 kernel->stop(); 372 373 clear(); 374 375 runOnce = false; |
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 } |
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 --- |