systemc: Add a minimal version of the deprecated sc_process_b.
authorGabe Black <gabeblack@google.com>
Tue, 19 Jun 2018 00:04:28 +0000 (17:04 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 28 Aug 2018 21:24:32 +0000 (21:24 +0000)
This type is deprecated, but some tests still rely on it. This change
adds just enough of it to satisfy the tests, and also the several
different mechanisms for retrieving the sc_process_b which refers to
the currently active process.

Change-Id: Id122ae5df23744b5de1e1c97573412f97a73b77a
Reviewed-on: https://gem5-review.googlesource.com/11351
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/sc_process_handle.cc
src/systemc/ext/core/_using.hh
src/systemc/ext/core/sc_process_handle.hh
src/systemc/tests/working.filt

index 06fd0b30fb7c5fefb3813e9f709565c940f11f1e..cf81f9ff5526513ed0923e3533bf2acf0705b95e 100644 (file)
@@ -63,6 +63,29 @@ sc_unwind_exception::~sc_unwind_exception() throw()
 }
 
 
+const char *
+sc_process_b::name()
+{
+    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+    return "";
+}
+
+const char *
+sc_process_b::kind()
+{
+    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+    return "";
+}
+
+
+sc_process_b *
+sc_get_curr_process_handle()
+{
+    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+    return nullptr;
+}
+
+
 sc_process_handle::sc_process_handle()
 {
     warn("%s not implemented.\n", __PRETTY_FUNCTION__);
index efc6341cd309a53ff4f34eec921f007f8eff4582..255df336f708c7ec47345519cbf4b5f6515aa942 100644 (file)
@@ -124,6 +124,11 @@ using sc_core::sc_descendent_inclusion_info;
 using sc_core::SC_NO_DESCENDANTS;
 using sc_core::SC_INCLUDE_DESCENDANTS;
 using sc_core::sc_unwind_exception;
+using sc_core::sc_process_b;
+using sc_core::sc_get_curr_process_handle;
+using sc_core::sc_get_current_process_b;
+using sc_core::sc_curr_proc_info;
+using sc_core::sc_curr_proc_handle;
 using sc_core::sc_process_handle;
 using sc_core::sc_get_current_process_handle;
 using sc_core::sc_is_unwinding;
index 55fa2b7db3f7feb440fa4c2e888bedc80206d6f8..e577b9e47af8bf8d1979b55a1ea05c4ec69155c6 100644 (file)
@@ -77,6 +77,34 @@ class sc_unwind_exception : public std::exception
     sc_unwind_exception();
 };
 
+// Deprecated
+// An incomplete version of sc_process_b to satisfy the tests.
+class sc_process_b
+{
+  public:
+    const char *file;
+    int lineno;
+    const char *name();
+    const char *kind();
+};
+
+// Deprecated
+sc_process_b *sc_get_curr_process_handle();
+static inline sc_process_b *
+sc_get_current_process_b()
+{
+    return sc_get_curr_process_handle();
+}
+
+// Deprecated/nonstandard
+struct sc_curr_proc_info
+{
+    sc_process_b *process_handle;
+    sc_curr_proc_kind kind;
+    sc_curr_proc_info() : process_handle(NULL), kind(SC_NO_PROC_) {}
+};
+typedef const sc_curr_proc_info *sc_curr_proc_handle;
+
 class sc_process_handle
 {
   private:
index 96047687812211cba72e553107d11758ddc27d08..801a05176c63a239282f1be884e77717b3e34776 100644 (file)
@@ -8,10 +8,6 @@ name == "sc_elab_and_sim",
 path.startswith("systemc/tracing/wif_trace"),
 path.startswith("systemc/misc/stars/wif_trace"),
 
-# These tests refers to sc_get_current_process_b which is a deprecated type and
-# something we're not currently planning to support.
-path.startswith("systemc/kernel/sc_process_b"),
-
 # Phase callbacks are an experimental feature. Also calling all the interested
 # sc_objects whenever time advances would add a non-trivial amount of
 # complexity and is probably not worth implementing in general.
@@ -22,6 +18,7 @@ path in (
     # Uses sc_get_curr_simcontext.
     "systemc/kernel/sc_object_manager/test01",
     "systemc/kernel/sc_name_gen/test1",
+    "systemc/kernel/sc_process_b/test2",
 
     # Uses sc_elab_and_sim.
     "systemc/kernel/sc_main_main",