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 --- 27 unchanged lines hidden (view full) --- 36#include "sim/core.hh" 37#include "sim/eventq.hh" 38#include "sim/init.hh" 39#include "systemc/core/kernel.hh" 40#include "systemc/core/python.hh" 41#include "systemc/core/scheduler.hh" 42#include "systemc/ext/core/sc_main.hh" 43#include "systemc/ext/utils/sc_report_handler.hh" |
44#include "systemc/utils/report.hh" |
45 46// A weak symbol to detect if sc_main has been defined, and if so where it is. 47[[gnu::weak]] int sc_main(int argc, char *argv[]); 48 49namespace sc_core 50{ 51 52namespace --- 22 unchanged lines hidden (view full) --- 75 resultStr = "sc_main returned non-zero"; 76 else 77 resultStr = "sc_main finished"; 78 // Make sure no systemc events/notifications are scheduled 79 // after sc_main returns. 80 } catch (const sc_report &r) { 81 // There was an exception nobody caught. 82 resultStr = "uncaught sc_report"; |
83 sc_gem5::reportHandlerProc( |
84 r, sc_report_handler::get_catch_actions()); 85 } catch (...) { 86 // There was some other type of exception we need to wrap. 87 resultStr = "uncaught exception"; |
88 sc_gem5::reportHandlerProc( |
89 ::sc_gem5::reportifyException(), 90 sc_report_handler::get_catch_actions()); 91 } 92 ::sc_gem5::Kernel::scMainFinished(true); 93 ::sc_gem5::scheduler.clear(); 94 } else { 95 // If python tries to call sc_main but no sc_main was defined... 96 fatal("sc_main called but not defined.\n"); --- 270 unchanged lines hidden --- |