summaryrefslogtreecommitdiff
path: root/src/systemc/ext/core
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-08-15 23:35:38 -0700
committerGabe Black <gabeblack@google.com>2018-09-20 01:50:03 +0000
commitf9298649bb4d1f20b244a6e0930bb82be5ec7397 (patch)
tree28a7d86e1e7b26313f674407993b56e7306364fc /src/systemc/ext/core
parent82958266d412e82c910b2ce35ac2a72e6c9fe358 (diff)
downloadgem5-f9298649bb4d1f20b244a6e0930bb82be5ec7397.tar.xz
systemc: Track exports and prim channels, and call their callbacks.
Also call the callbacks on the ports which were already being tracked. Change-Id: I5ba8ea366e87fc48b58712f35b93c27bccf92cb3 Reviewed-on: https://gem5-review.googlesource.com/12210 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/ext/core')
-rw-r--r--src/systemc/ext/core/sc_export.hh16
-rw-r--r--src/systemc/ext/core/sc_port.hh13
-rw-r--r--src/systemc/ext/core/sc_prim.hh2
3 files changed, 23 insertions, 8 deletions
diff --git a/src/systemc/ext/core/sc_export.hh b/src/systemc/ext/core/sc_export.hh
index f3cf81619..f5ce894b8 100644
--- a/src/systemc/ext/core/sc_export.hh
+++ b/src/systemc/ext/core/sc_export.hh
@@ -46,6 +46,14 @@ class sc_export_base : public sc_object
virtual sc_interface *get_iterface() = 0;
virtual const sc_interface *get_interface() const = 0;
+
+ protected:
+ friend class sc_gem5::Kernel;
+
+ virtual void before_end_of_elaboration() = 0;
+ virtual void end_of_elaboration() = 0;
+ virtual void start_of_simulation() = 0;
+ virtual void end_of_simulation() = 0;
};
template <class IF>
@@ -74,10 +82,10 @@ class sc_export : public sc_export_base
const sc_interface *get_interface() const override { return interface; }
protected:
- virtual void before_end_of_elaboration() {}
- virtual void end_of_elaboration() {}
- virtual void start_of_simulation() {}
- virtual void end_of_simulation() {}
+ void before_end_of_elaboration() {}
+ void end_of_elaboration() {}
+ void start_of_simulation() {}
+ void end_of_simulation() {}
private:
IF *interface;
diff --git a/src/systemc/ext/core/sc_port.hh b/src/systemc/ext/core/sc_port.hh
index 6031d5495..73f5362b6 100644
--- a/src/systemc/ext/core/sc_port.hh
+++ b/src/systemc/ext/core/sc_port.hh
@@ -75,6 +75,11 @@ class sc_port_base : public sc_object
virtual int vbind(sc_interface &) = 0;
virtual int vbind(sc_port_base &) = 0;
+ virtual void before_end_of_elaboration() = 0;
+ virtual void end_of_elaboration() = 0;
+ virtual void start_of_simulation() = 0;
+ virtual void end_of_simulation() = 0;
+
private:
friend class ::sc_gem5::PendingSensitivityPort;
friend class ::sc_gem5::Kernel;
@@ -110,10 +115,10 @@ class sc_port_b : public sc_port_base
const sc_interface *get_interface() const { return _interfaces.at(0); }
protected:
- virtual void before_end_of_elaboration() {}
- virtual void end_of_elaboration() {}
- virtual void start_of_elaboration() {}
- virtual void end_of_simulation() {}
+ void before_end_of_elaboration() {}
+ void end_of_elaboration() {}
+ void start_of_simulation() {}
+ void end_of_simulation() {}
explicit sc_port_b(int n, sc_port_policy p) :
sc_port_base(sc_gen_unique_name("port"), n, p)
diff --git a/src/systemc/ext/core/sc_prim.hh b/src/systemc/ext/core/sc_prim.hh
index 106489280..99e231456 100644
--- a/src/systemc/ext/core/sc_prim.hh
+++ b/src/systemc/ext/core/sc_prim.hh
@@ -91,6 +91,8 @@ class sc_prim_channel : public sc_object
void wait(const sc_time &, const sc_event_and_list &);
void wait(double, sc_time_unit, const sc_event_and_list &);
+ friend class sc_gem5::Kernel;
+
virtual void before_end_of_elaboration() {}
virtual void end_of_elaboration() {}
virtual void start_of_simulation() {}