systemc: "Implement" sc_interface's methods.
authorGabe Black <gabeblack@google.com>
Tue, 7 Aug 2018 11:53:01 +0000 (04:53 -0700)
committerGabe Black <gabeblack@google.com>
Thu, 20 Sep 2018 01:41:17 +0000 (01:41 +0000)
Most don't do anything. Make default_event() return a dummy event to
avoid dereferencing a null pointer.

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

src/systemc/core/sc_interface.cc
src/systemc/ext/core/sc_interface.hh

index e01bdccfdcf898ba24f46b489c9f84863377ebc4..171422d312e7c2b097879b8adce146277bbd82c7 100644 (file)
  */
 
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_event.hh"
 #include "systemc/ext/core/sc_interface.hh"
 
 namespace sc_core
 {
 
-void
-sc_interface::register_port(sc_port_base &, const char *)
-{
-    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
-}
-
 const sc_event &
 sc_interface::default_event() const
 {
-    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
-    return *(sc_event *)nullptr;
-}
-
-sc_interface::~sc_interface()
-{
-    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
-}
-
-sc_interface::sc_interface()
-{
-    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+    static sc_event dummy;
+    return dummy;
 }
 
 } // namespace sc_core
index 2073f53625a2411ff4eff1728dddce4406948eab..3c6a27deae6d7f904875c2c91cdaff9674e15b51 100644 (file)
@@ -39,12 +39,11 @@ class sc_event;
 class sc_interface
 {
   public:
-    virtual void register_port(sc_port_base &, const char *);
     virtual const sc_event &default_event() const;
-    virtual ~sc_interface();
+    virtual ~sc_interface() {};
 
   protected:
-    sc_interface();
+    sc_interface() {};
 
   private:
     // Disabled