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

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

73 if (resultInt)
74 resultStr = "sc_main returned non-zero";
75 else
76 resultStr = "sc_main finished";
77 // Make sure no systemc events/notifications are scheduled
78 // after sc_main returns.
79 } catch (const sc_report &r) {
80 // There was an exception nobody caught.
81 resultStr = r.what();
81 resultStr = "uncaught sc_report";
82 sc_report_handler::get_handler()(
83 r, sc_report_handler::get_catch_actions());
84 } catch (...) {
85 // There was some other type of exception we need to wrap.
84 resultStr = ::sc_gem5::reportifyException().what();
86 resultStr = "uncaught exception";
87 sc_report_handler::get_handler()(
88 ::sc_gem5::reportifyException(),
89 sc_report_handler::get_catch_actions());
90 }
91 ::sc_gem5::Kernel::scMainFinished(true);
92 ::sc_gem5::scheduler.clear();
93 } else {
94 // If python tries to call sc_main but no sc_main was defined...
95 fatal("sc_main called but not defined.\n");
96 }
97 }

--- 268 unchanged lines hidden ---