systemc: "Implement" sc_interface's methods.

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>
This commit is contained in:
Gabe Black
2018-08-07 04:53:01 -07:00
parent a5fabc7064
commit 0ebd72b420
2 changed files with 5 additions and 21 deletions

View File

@@ -28,32 +28,17 @@
*/
#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

View 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