systemc: Add the nonstandard triggered function sc_event.
authorGabe Black <gabeblack@google.com>
Thu, 14 Jun 2018 23:39:37 +0000 (16:39 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 22 Aug 2018 00:51:43 +0000 (00:51 +0000)
The Accellera implementation of sc_event has a non-standard triggered
function which returns whether or not that particular event has been
triggered in the current delta cycle. The tests call it, so we probably
need to have it.

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

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

index 0cdab2a50864398cf2cab06ca3f38cc2b1766a87..32fdd0afb82f61f2e9c2e70b0b7de420e57ca16d 100644 (file)
@@ -277,6 +277,13 @@ sc_event::cancel()
     warn("%s not implemented.\n", __PRETTY_FUNCTION__);
 }
 
+bool
+sc_event::triggered() const
+{
+    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+    return false;
+}
+
 sc_event_and_expr
 sc_event::operator & (const sc_event &) const
 {
index d4d719b95426d48a1cf8e83f10818c86ad763efb..d110b9178d6c333712598740716b65fea92cdb62 100644 (file)
@@ -132,6 +132,10 @@ class sc_event
     void notify(double, sc_time_unit);
     void cancel();
 
+    // Nonstandard
+    // Returns whether this event is currently triggered.
+    bool triggered() const;
+
     sc_event_and_expr operator & (const sc_event &) const;
     sc_event_and_expr operator & (const sc_event_and_list &) const;
     sc_event_or_expr operator | (const sc_event &) const;