summaryrefslogtreecommitdiff
path: root/src/systemc/ext/core/sc_main.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-05-30 14:48:11 -0700
committerGabe Black <gabeblack@google.com>2018-08-15 01:24:45 +0000
commit6915118bbf9bc6136d87895faccb91ee940c3609 (patch)
treed040c90724de6dc6cecee52642fc147742d0a654 /src/systemc/ext/core/sc_main.hh
parente02ec0c24d56bce4a0d8636a340e15cd223d1930 (diff)
downloadgem5-6915118bbf9bc6136d87895faccb91ee940c3609.tar.xz
systemc: Add some missing functions which interact with the scheduler.
Change-Id: Ifc8c8d4a7bb6e941485e80f4884cfa4bb648c17c Reviewed-on: https://gem5-review.googlesource.com/10846 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/ext/core/sc_main.hh')
-rw-r--r--src/systemc/ext/core/sc_main.hh52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/systemc/ext/core/sc_main.hh b/src/systemc/ext/core/sc_main.hh
index 9bf0d0aae..24e93503e 100644
--- a/src/systemc/ext/core/sc_main.hh
+++ b/src/systemc/ext/core/sc_main.hh
@@ -30,6 +30,9 @@
#ifndef __SYSTEMC_EXT_CORE_SC_MAIN_HH__
#define __SYSTEMC_EXT_CORE_SC_MAIN_HH__
+#include "../dt/int/sc_nbdefs.hh"
+#include "sc_time.hh"
+
extern "C" int sc_main(int argc, char *argv[]);
namespace sc_core
@@ -39,6 +42,55 @@ namespace sc_core
// The standard version of this function doesn't have these "const"
// qualifiers, but the canonical SystemC implementation does.
extern "C" const char *const *sc_argv();
+
+ enum sc_starvation_policy
+ {
+ SC_RUN_TO_TIME,
+ SC_EXIT_ON_STARVATION
+ };
+
+ void sc_start();
+ void sc_start(const sc_time &, sc_starvation_policy p=SC_RUN_TO_TIME);
+ static inline void
+ sc_start(double d, sc_time_unit t, sc_starvation_policy p=SC_RUN_TO_TIME)
+ {
+ sc_start(sc_time(d, t), p);
+ }
+
+ void sc_pause();
+
+ enum sc_stop_mode
+ {
+ SC_STOP_FINISH_DELTA,
+ SC_STOP_IMMEDIATE,
+ };
+
+ void sc_set_stop_mode(sc_stop_mode mode);
+ sc_stop_mode sc_get_stop_mode();
+
+ void sc_stop();
+
+ const sc_time &sc_time_stamp();
+ sc_dt::uint64 sc_delta_count();
+ bool sc_is_running();
+ bool sc_pending_activity_at_current_time();
+ bool sc_pending_activity_at_future_time();
+ bool sc_pending_activity();
+ sc_time sc_time_to_pending_activity();
+
+ enum sc_status
+ {
+ SC_ELABORATION = 0x1,
+ SC_BEFORE_END_OF_ELABORATION = 0x02,
+ SC_END_OF_ELABORATION = 0x04,
+ SC_START_OF_SIMULATION = 0x08,
+ SC_RUNNING = 0x10,
+ SC_PAUSED = 0x20,
+ SC_STOPPED = 0x40,
+ SC_END_OF_SIMULATION = 0x80
+ };
+
+ sc_status sc_get_status();
} // namespace sc_core
#endif //__SYSTEMC_EXT_CORE_SC_MAIN_HH__