From 9bd3bb7bc804a16b2f0de03fa6d3d9d0928f38a2 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 22 Jun 2018 14:19:44 -0700 Subject: systemc: Implement most of sc_object. To avoid making it hard to change sc_object's implementation in the future, this change keeps most of the data members out of sc_object and keeps them in a seperate Object which is managed independently but still matches to the sc_objects one to one. This change also moves away from the SystemC/sc_gem5 namespace pair in favor of sc_gem5. Having two namespaces with classes, etc, living in both was complicating things. Having to use a namespace that doesn't fit in one scheme or the other isn't great, but it's the lesser of two evils. Change-Id: Ib59c3c515ca98c7fe519c59e9fe9270304b71cc0 Reviewed-on: https://gem5-review.googlesource.com/11611 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/ext/core/sc_object.hh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/systemc/ext/core') diff --git a/src/systemc/ext/core/sc_object.hh b/src/systemc/ext/core/sc_object.hh index 653df874e..2dcc7faa7 100644 --- a/src/systemc/ext/core/sc_object.hh +++ b/src/systemc/ext/core/sc_object.hh @@ -34,6 +34,13 @@ #include #include +namespace sc_gem5 +{ + +class Object; + +} // namespace sc_gem5 + namespace sc_core { @@ -48,7 +55,7 @@ class sc_object const char *name() const; const char *basename() const; - virtual const char *kind() const; + virtual const char *kind() const { return "sc_object"; } virtual void print(std::ostream & =std::cout) const; virtual void dump(std::ostream & =std::cout) const; @@ -66,8 +73,7 @@ class sc_object const sc_attr_cltn &attr_cltn() const; // Deprecated - sc_simcontext * - simcontext() const; + sc_simcontext *simcontext() const; protected: sc_object(); @@ -75,6 +81,10 @@ class sc_object sc_object(const sc_object &); sc_object &operator = (const sc_object &); virtual ~sc_object(); + + private: + friend class sc_gem5::Object; + sc_gem5::Object *_gem5_object; }; const std::vector &sc_get_top_level_objects(); -- cgit v1.2.3