Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/10846
Change subject: systemc: Add some missing functions which interact with the
scheduler.
......................................................................
systemc: Add some missing functions which interact with the scheduler.
Change-Id: Ifc8c8d4a7bb6e941485e80f4884cfa4bb648c17c
---
M src/systemc/core/sc_main.cc
M src/systemc/ext/core/_using.hh
M src/systemc/ext/core/sc_main.hh
3 files changed, 152 insertions(+), 0 deletions(-)
diff --git a/src/systemc/core/sc_main.cc b/src/systemc/core/sc_main.cc
index 5a6108a..2a38b41 100644
--- a/src/systemc/core/sc_main.cc
+++ b/src/systemc/core/sc_main.cc
@@ -121,4 +121,91 @@
return _argv;
}
+void
+sc_start()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+}
+
+void
+sc_start(const sc_time &time, sc_starvation_policy p)
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+}
+
+void
+sc_set_stop_mode(sc_stop_mode mode)
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+}
+
+sc_stop_mode
+sc_get_stop_mode()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ return SC_STOP_FINISH_DELTA;
+}
+
+void
+sc_stop()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+}
+
+const sc_time &
+sc_time_stamp()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ return *(sc_time *)nullptr;
+}
+
+sc_dt::uint64
+sc_delta_count()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ return 0;
+}
+
+bool
+sc_is_running()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ return false;
+}
+
+bool
+sc_pending_activity_at_current_time()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ return false;
+}
+
+bool
+sc_pending_activity_at_future_time()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ return false;
+}
+
+bool
+sc_pending_activity()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ return false;
+}
+
+sc_time
+sc_time_to_pending_activity()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ return sc_time();
+}
+
+sc_status
+sc_get_status()
+{
+ warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ return SC_ELABORATION;
+}
+
} // namespace sc_core
diff --git a/src/systemc/ext/core/_using.hh b/src/systemc/ext/core/_using.hh
index 6c4c431..95ffc32 100644
--- a/src/systemc/ext/core/_using.hh
+++ b/src/systemc/ext/core/_using.hh
@@ -53,6 +53,19 @@
using sc_core::sc_argc;
using sc_core::sc_argv;
+using sc_core::sc_start;
+using sc_core::sc_pause;
+using sc_core::sc_set_stop_mode;
+using sc_core::sc_get_stop_mode;
+using sc_core::sc_stop;
+using sc_core::sc_time_stamp;
+using sc_core::sc_delta_count;
+using sc_core::sc_is_running;
+using sc_core::sc_pending_activity_at_current_time;
+using sc_core::sc_pending_activity_at_future_time;
+using sc_core::sc_pending_activity;
+using sc_core::sc_time_to_pending_activity;
+using sc_core::sc_get_status;
using sc_core::sc_bind_proxy;
using sc_core::SC_BIND_PROXY_NIL;
diff --git a/src/systemc/ext/core/sc_main.hh
b/src/systemc/ext/core/sc_main.hh
index 9bf0d0a..24e9350 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 @@
// 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__
--
To view, visit https://gem5-review.googlesource.com/10846
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ifc8c8d4a7bb6e941485e80f4884cfa4bb648c17c
Gerrit-Change-Number: 10846
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev