systemc: Don't use write() in sc_clock to set the clock value.
authorGabe Black <gabeblack@google.com>
Tue, 2 Oct 2018 05:47:27 +0000 (22:47 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 16 Oct 2018 00:45:13 +0000 (00:45 +0000)
The two different processes we have to use to match Accellera behavior
would trip the checks in write.

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

src/systemc/ext/channel/sc_clock.hh

index 3713394b68d8d20aa7b1eea092374b9f3374def9..ba9231542f551b393dc8d48b4b92f1d7408d5467 100644 (file)
@@ -101,8 +101,18 @@ class sc_clock : public sc_signal<bool>
     ::sc_gem5::ClockTick *_gem5UpEdge;
     ::sc_gem5::ClockTick *_gem5DownEdge;
 
-    void tickUp() { sc_signal<bool>::write(true); }
-    void tickDown() { sc_signal<bool>::write(false); }
+    void
+    tickUp()
+    {
+        m_new_val = true;
+        request_update();
+    }
+    void
+    tickDown()
+    {
+        m_new_val = false;
+        request_update();
+    }
 };
 
 typedef sc_in<bool> sc_in_clk;