Matthew Poremba has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/39935 )

Change subject: cpu: Rename GpuThread in gpu_ruby_test tester
......................................................................

cpu: Rename GpuThread in gpu_ruby_test tester

The GpuThread class will be used as an abstract class for any thread
type (CPU, GPU, DMA) therefore changing to a more appropriate name.

Change-Id: If241edb53ea405c95b0315c609176c6470b29931
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39935
Reviewed-by: Matt Sinclair <mattdsincl...@gmail.com>
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Matt Sinclair <mattdsincl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/cpu/testers/gpu_ruby_test/CpuThread.py
M src/cpu/testers/gpu_ruby_test/GpuWavefront.py
M src/cpu/testers/gpu_ruby_test/README
M src/cpu/testers/gpu_ruby_test/SConscript
R src/cpu/testers/gpu_ruby_test/TesterThread.py
M src/cpu/testers/gpu_ruby_test/address_manager.hh
M src/cpu/testers/gpu_ruby_test/cpu_thread.cc
M src/cpu/testers/gpu_ruby_test/cpu_thread.hh
M src/cpu/testers/gpu_ruby_test/episode.cc
M src/cpu/testers/gpu_ruby_test/episode.hh
M src/cpu/testers/gpu_ruby_test/gpu_wavefront.cc
M src/cpu/testers/gpu_ruby_test/gpu_wavefront.hh
M src/cpu/testers/gpu_ruby_test/protocol_tester.cc
M src/cpu/testers/gpu_ruby_test/protocol_tester.hh
R src/cpu/testers/gpu_ruby_test/tester_thread.cc
R src/cpu/testers/gpu_ruby_test/tester_thread.hh
16 files changed, 95 insertions(+), 95 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Matt Sinclair: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/cpu/testers/gpu_ruby_test/CpuThread.py b/src/cpu/testers/gpu_ruby_test/CpuThread.py
index 7124a32..8cb3269 100644
--- a/src/cpu/testers/gpu_ruby_test/CpuThread.py
+++ b/src/cpu/testers/gpu_ruby_test/CpuThread.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+# Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
 # All rights reserved.
 #
 # For use for simulation and test purposes only
@@ -32,8 +32,8 @@
 from m5.params import *
 from m5.proxy import *

-from m5.objects.GpuThread import GpuThread
+from m5.objects.TesterThread import TesterThread

-class CpuThread(GpuThread):
+class CpuThread(TesterThread):
     type = 'CpuThread'
     cxx_header = "cpu/testers/gpu_ruby_test/cpu_thread.hh"
diff --git a/src/cpu/testers/gpu_ruby_test/GpuWavefront.py b/src/cpu/testers/gpu_ruby_test/GpuWavefront.py
index a54870f..d8d7dae 100644
--- a/src/cpu/testers/gpu_ruby_test/GpuWavefront.py
+++ b/src/cpu/testers/gpu_ruby_test/GpuWavefront.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+# Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
 # All rights reserved.
 #
 # For use for simulation and test purposes only
@@ -32,9 +32,9 @@
 from m5.params import *
 from m5.proxy import *

-from m5.objects.GpuThread import GpuThread
+from m5.objects.TesterThread import TesterThread

-class GpuWavefront(GpuThread):
+class GpuWavefront(TesterThread):
     type = 'GpuWavefront'
     cxx_header = "cpu/testers/gpu_ruby_test/gpu_wavefront.hh"
     cu_id = Param.Int("Compute Unit ID")
diff --git a/src/cpu/testers/gpu_ruby_test/README b/src/cpu/testers/gpu_ruby_test/README
index 5627f43..390b503 100644
--- a/src/cpu/testers/gpu_ruby_test/README
+++ b/src/cpu/testers/gpu_ruby_test/README
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -113,11 +113,11 @@
                         location, generates locations for all episodes,
                         maintains per-location last writer and validates
                         values returned from load actions.
-GpuThread.hh/cc         -- This is abstract class for CPU threads and GPU
+TesterThread.hh/cc   -- This is abstract class for CPU threads and GPU
                         wavefronts. It generates and executes a series of
                         episodes.
CpuThread.hh/cc -- Thread class for CPU threads. Not fully implemented yet
-GpuWavefront.hh/cc   -- GpuThread class for GPU wavefronts.
+GpuWavefront.hh/cc   -- Thread class for GPU wavefronts.
 Episode.hh/cc        -- Class to encapsulate an episode, notably including
                         episode load/store structure and ordering.

diff --git a/src/cpu/testers/gpu_ruby_test/SConscript b/src/cpu/testers/gpu_ruby_test/SConscript
index d801130..28c8006 100644
--- a/src/cpu/testers/gpu_ruby_test/SConscript
+++ b/src/cpu/testers/gpu_ruby_test/SConscript
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+# Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
 # All rights reserved.
 #
 # For use for simulation and test purposes only
@@ -40,15 +40,15 @@
     Return()

 SimObject('ProtocolTester.py')
-SimObject('GpuThread.py')
 SimObject('CpuThread.py')
 SimObject('GpuWavefront.py')
+SimObject('TesterThread.py')

 Source('address_manager.cc')
 Source('episode.cc')
 Source('protocol_tester.cc')
-Source('gpu_thread.cc')
 Source('cpu_thread.cc')
 Source('gpu_wavefront.cc')
+Source('tester_thread.cc')

 DebugFlag('ProtocolTest')
diff --git a/src/cpu/testers/gpu_ruby_test/GpuThread.py b/src/cpu/testers/gpu_ruby_test/TesterThread.py
similarity index 88%
rename from src/cpu/testers/gpu_ruby_test/GpuThread.py
rename to src/cpu/testers/gpu_ruby_test/TesterThread.py
index ba849d4..e3e6c01 100644
--- a/src/cpu/testers/gpu_ruby_test/GpuThread.py
+++ b/src/cpu/testers/gpu_ruby_test/TesterThread.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+# Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
 # All rights reserved.
 #
 # For use for simulation and test purposes only
@@ -33,10 +33,10 @@
 from m5.params import *
 from m5.proxy import *

-class GpuThread(ClockedObject):
-    type = 'GpuThread'
+class TesterThread(ClockedObject):
+    type = 'TesterThread'
     abstract = True
-    cxx_header = "cpu/testers/gpu_ruby_test/gpu_thread.hh"
-    thread_id = Param.Int("Unique GpuThread ID")
+    cxx_header = "cpu/testers/gpu_ruby_test/tester_thread.hh"
+    thread_id = Param.Int("Unique TesterThread ID")
     num_lanes = Param.Int("Number of lanes this thread has")
     deadlock_threshold = Param.Cycles(1000000000, "Deadlock threshold")
diff --git a/src/cpu/testers/gpu_ruby_test/address_manager.hh b/src/cpu/testers/gpu_ruby_test/address_manager.hh
index 6b7b312..2ea586f 100644
--- a/src/cpu/testers/gpu_ruby_test/address_manager.hh
+++ b/src/cpu/testers/gpu_ruby_test/address_manager.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -161,7 +161,7 @@

         const std::string print() const
         {
-            return "(GpuThread ID " + std::to_string(threadId) +
+            return "(TesterThread ID " + std::to_string(threadId) +
                    ", CU ID " + std::to_string(cuId) +
                    ", Episode ID " + std::to_string(episodeId) +
                    ", Value " + std::to_string(value) +
diff --git a/src/cpu/testers/gpu_ruby_test/cpu_thread.cc b/src/cpu/testers/gpu_ruby_test/cpu_thread.cc
index cee807a..fa801b3 100644
--- a/src/cpu/testers/gpu_ruby_test/cpu_thread.cc
+++ b/src/cpu/testers/gpu_ruby_test/cpu_thread.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -36,7 +36,7 @@
 #include "debug/ProtocolTest.hh"

 CpuThread::CpuThread(const Params &p)
-    :GpuThread(p)
+    : TesterThread(p)
 {
     threadName = "CpuThread(Thread ID " + std::to_string(threadId) + ")";
     threadEvent.setDesc("CpuThread tick");
diff --git a/src/cpu/testers/gpu_ruby_test/cpu_thread.hh b/src/cpu/testers/gpu_ruby_test/cpu_thread.hh
index 0ee7cb9..1e37c6f 100644
--- a/src/cpu/testers/gpu_ruby_test/cpu_thread.hh
+++ b/src/cpu/testers/gpu_ruby_test/cpu_thread.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -34,11 +34,11 @@
 #ifndef CPU_TESTERS_PROTOCOL_TESTER_CPU_THREAD_HH_
 #define CPU_TESTERS_PROTOCOL_TESTER_CPU_THREAD_HH_

-#include "cpu/testers/gpu_ruby_test/gpu_thread.hh"
+#include "cpu/testers/gpu_ruby_test/tester_thread.hh"
 #include "params/CpuThread.hh"
 #include "sim/clocked_object.hh"

-class CpuThread : public GpuThread
+class CpuThread : public TesterThread
 {
   public:
     typedef CpuThreadParams Params;
diff --git a/src/cpu/testers/gpu_ruby_test/episode.cc b/src/cpu/testers/gpu_ruby_test/episode.cc
index 10ce070..2094317 100644
--- a/src/cpu/testers/gpu_ruby_test/episode.cc
+++ b/src/cpu/testers/gpu_ruby_test/episode.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -36,10 +36,10 @@
 #include <fstream>
 #include <unordered_set>

-#include "cpu/testers/gpu_ruby_test/gpu_thread.hh"
 #include "cpu/testers/gpu_ruby_test/protocol_tester.hh"
+#include "cpu/testers/gpu_ruby_test/tester_thread.hh"

-Episode::Episode(ProtocolTester* _tester, GpuThread* _thread, int num_loads, +Episode::Episode(ProtocolTester* _tester, TesterThread* _thread, int num_loads,
                  int num_stores)
       : tester(_tester),
         thread(_thread),
@@ -156,8 +156,8 @@
                                                 normal_loc, false) ||
                             !this->checkDRF(atomicLocs[lane], normal_loc,
                                             false, lane)) {
- panic("GpuTh %d - Data race detected. STOPPED!\n",
-                                  thread->getGpuThreadId());
+ panic("TestTh %d - Data race detected. STOPPED!\n",
+                                  thread->getTesterThreadId());
                         }
                     }

@@ -175,8 +175,8 @@
                                                 normal_loc, true) ||
                             !this->checkDRF(atomicLocs[lane], normal_loc,
                                             true, lane)) {
- panic("GpuTh %d - Data race detected. STOPPED!\n",
-                                  thread->getGpuThreadId());
+ panic("TestTh %d - Data race detected. STOPPED!\n",
+                                  thread->getTesterThreadId());
                         }
                     }

@@ -250,13 +250,13 @@
                     !action->isMemFenceAction()) {
                     if (isStore && loc == action->getLocation(lane)) {
                         warn("ST at location %d races against thread %d\n",
-                             loc, thread->getGpuThreadId());
+                             loc, thread->getTesterThreadId());
                         return false;
                     } else if (!isStore &&
                                action->getType() == Action::Type::STORE &&
                                loc == action->getLocation(lane)) {
                         warn("LD at location %d races against thread %d\n",
-                             loc, thread->getGpuThreadId());
+                             loc, thread->getTesterThreadId());
                         return false;
                     }
                 }
diff --git a/src/cpu/testers/gpu_ruby_test/episode.hh b/src/cpu/testers/gpu_ruby_test/episode.hh
index 1962351..e10025e 100644
--- a/src/cpu/testers/gpu_ruby_test/episode.hh
+++ b/src/cpu/testers/gpu_ruby_test/episode.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -39,7 +39,7 @@
 #include "cpu/testers/gpu_ruby_test/address_manager.hh"

 class ProtocolTester;
-class GpuThread;
+class TesterThread;

 class Episode
 {
@@ -74,7 +74,7 @@
         LocationList locations;
     };

-    Episode(ProtocolTester* tester, GpuThread* thread, int num_loads,
+    Episode(ProtocolTester* tester, TesterThread* thread, int num_loads,
             int num_stores);
     ~Episode();

@@ -97,7 +97,7 @@
   private:
     // pointers to tester, thread and address amanger structures
     ProtocolTester *tester;
-    GpuThread *thread;
+    TesterThread *thread;
     AddressManager *addrManager;

     // a unique episode id
diff --git a/src/cpu/testers/gpu_ruby_test/gpu_wavefront.cc b/src/cpu/testers/gpu_ruby_test/gpu_wavefront.cc
index 6b3c3a0..f2f1343 100644
--- a/src/cpu/testers/gpu_ruby_test/gpu_wavefront.cc
+++ b/src/cpu/testers/gpu_ruby_test/gpu_wavefront.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -36,9 +36,9 @@
 #include "debug/ProtocolTest.hh"

 GpuWavefront::GpuWavefront(const Params &p)
-      : GpuThread(p), cuId(p.cu_id)
+      : TesterThread(p), cuId(p.cu_id)
 {
- threadName = "GpuWavefront(GpuThread ID = " + std::to_string(threadId) + + threadName = "GpuWavefront(TesterThread ID = " + std::to_string(threadId) +
                  ", CU ID = " + std::to_string(cuId) + ")";
     threadEvent.setDesc("GpuWavefront tick");
 }
diff --git a/src/cpu/testers/gpu_ruby_test/gpu_wavefront.hh b/src/cpu/testers/gpu_ruby_test/gpu_wavefront.hh
index be8b36a..dfc4898 100644
--- a/src/cpu/testers/gpu_ruby_test/gpu_wavefront.hh
+++ b/src/cpu/testers/gpu_ruby_test/gpu_wavefront.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -34,11 +34,11 @@
 #ifndef CPU_TESTERS_PROTOCOL_TESTER_GPU_WAVEFRONT_HH_
 #define CPU_TESTERS_PROTOCOL_TESTER_GPU_WAVEFRONT_HH_

-#include "cpu/testers/gpu_ruby_test/gpu_thread.hh"
+#include "cpu/testers/gpu_ruby_test/tester_thread.hh"
 #include "params/GpuWavefront.hh"
 #include "sim/clocked_object.hh"

-class GpuWavefront : public GpuThread
+class GpuWavefront : public TesterThread
 {
   public:
     typedef GpuWavefrontParams Params;
diff --git a/src/cpu/testers/gpu_ruby_test/protocol_tester.cc b/src/cpu/testers/gpu_ruby_test/protocol_tester.cc
index c4baa20..dd50bb2 100644
--- a/src/cpu/testers/gpu_ruby_test/protocol_tester.cc
+++ b/src/cpu/testers/gpu_ruby_test/protocol_tester.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -39,8 +39,8 @@
 #include <random>

 #include "cpu/testers/gpu_ruby_test/cpu_thread.hh"
-#include "cpu/testers/gpu_ruby_test/gpu_thread.hh"
 #include "cpu/testers/gpu_ruby_test/gpu_wavefront.hh"
+#include "cpu/testers/gpu_ruby_test/tester_thread.hh"
 #include "debug/ProtocolTest.hh"
 #include "mem/request.hh"
 #include "sim/sim_exit.hh"
@@ -183,7 +183,7 @@

     // connect cpu threads to cpu's ports
     for (int cpu_id = 0; cpu_id < numCpus; ++cpu_id) {
-        cpuThreads[cpu_id]->attachGpuThreadToPorts(this,
+        cpuThreads[cpu_id]->attachTesterThreadToPorts(this,
static_cast<SeqPort*>(cpuPorts[cpu_id]));
         cpuThreads[cpu_id]->scheduleWakeup();
         cpuThreads[cpu_id]->scheduleDeadlockCheckEvent();
@@ -202,7 +202,7 @@

         for (int i = 0; i < numWfsPerCu; ++i) {
             wfId = cu_id * numWfsPerCu + i;
-            wfs[wfId]->attachGpuThreadToPorts(this,
+            wfs[wfId]->attachTesterThreadToPorts(this,
static_cast<SeqPort*>(cuVectorPorts[vectorPortId]),
                            cuTokenPorts[vectorPortId],
                            static_cast<SeqPort*>(cuSqcPorts[sqcPortId]),
@@ -270,12 +270,12 @@
 {
     if (debugTester) {
         // go through all active episodes in all threads
-        for (const GpuThread* th : wfs) {
+        for (const TesterThread* th : wfs) {
             if (!th->checkDRF(atomic_loc, loc, isStore))
                 return false;
         }

-        for (const GpuThread* th : cpuThreads) {
+        for (const TesterThread* th : cpuThreads) {
             if (!th->checkDRF(atomic_loc, loc, isStore))
                 return false;
         }
@@ -314,7 +314,7 @@
     // get the requesting thread from the original sender state
     ProtocolTester::SenderState* senderState =
safe_cast<ProtocolTester::SenderState*>(pkt->senderState);
-    GpuThread *th = senderState->th;
+    TesterThread *th = senderState->th;

     th->hitCallback(pkt);

diff --git a/src/cpu/testers/gpu_ruby_test/protocol_tester.hh b/src/cpu/testers/gpu_ruby_test/protocol_tester.hh
index 1d01fd2..3ecc067 100644
--- a/src/cpu/testers/gpu_ruby_test/protocol_tester.hh
+++ b/src/cpu/testers/gpu_ruby_test/protocol_tester.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -37,9 +37,9 @@
 /*
* The tester includes the main ProtocolTester that manages all ports to the
  * memory system.
- * GpuThreads are mapped to certain data port(s)
+ * TesterThreads are mapped to certain data port(s)
  *
- * GpuThreads inject memory requests through their data ports.
+ * TesterThreads inject memory requests through their data ports.
  * The tester receives and validates responses from the memory.
  *
  * Main components
@@ -61,7 +61,7 @@
 #include "mem/token_port.hh"
 #include "params/ProtocolTester.hh"

-class GpuThread;
+class TesterThread;
 class CpuThread;
 class GpuWavefront;

@@ -98,8 +98,8 @@

     struct SenderState : public Packet::SenderState
     {
-        GpuThread* th;
-        SenderState(GpuThread* _th)
+        TesterThread* th;
+        SenderState(TesterThread* _th)
         {
             assert(_th);
             th = _th;
diff --git a/src/cpu/testers/gpu_ruby_test/gpu_thread.cc b/src/cpu/testers/gpu_ruby_test/tester_thread.cc
similarity index 92%
rename from src/cpu/testers/gpu_ruby_test/gpu_thread.cc
rename to src/cpu/testers/gpu_ruby_test/tester_thread.cc
index fbf5d0d..9d12489 100644
--- a/src/cpu/testers/gpu_ruby_test/gpu_thread.cc
+++ b/src/cpu/testers/gpu_ruby_test/tester_thread.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -31,15 +31,15 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */

-#include "cpu/testers/gpu_ruby_test/gpu_thread.hh"
+#include "cpu/testers/gpu_ruby_test/tester_thread.hh"

 #include <fstream>

 #include "debug/ProtocolTest.hh"

-GpuThread::GpuThread(const Params &p)
+TesterThread::TesterThread(const Params &p)
       : ClockedObject(p),
-        threadEvent(this, "GpuThread tick"),
+        threadEvent(this, "TesterThread tick"),
         deadlockCheckEvent(this),
         threadId(p.thread_id),
         numLanes(p.num_lanes),
@@ -51,7 +51,7 @@
 {
 }

-GpuThread::~GpuThread()
+TesterThread::~TesterThread()
 {
     for (auto ep : episodeHistory) {
         assert(ep != nullptr);
@@ -60,7 +60,7 @@
 }

 void
-GpuThread::wakeup()
+TesterThread::wakeup()
 {
     // this thread is waken up by one of the following events
     //      - hitCallback is called
@@ -108,14 +108,14 @@
 }

 void
-GpuThread::scheduleWakeup()
+TesterThread::scheduleWakeup()
 {
     assert(!threadEvent.scheduled());
     schedule(threadEvent, nextCycle());
 }

 void
-GpuThread::scheduleDeadlockCheckEvent()
+TesterThread::scheduleDeadlockCheckEvent()
 {
     // after this first schedule, the deadlock event is scheduled by itself
     assert(!deadlockCheckEvent.scheduled());
@@ -123,7 +123,7 @@
 }

 void
-GpuThread::attachGpuThreadToPorts(ProtocolTester *_tester,
+TesterThread::attachTesterThreadToPorts(ProtocolTester *_tester,
                             ProtocolTester::SeqPort *_port,
                             ProtocolTester::GMTokenPort *_tokenPort,
                             ProtocolTester::SeqPort *_scalarPort,
@@ -141,7 +141,7 @@
 }

 void
-GpuThread::issueNewEpisode()
+TesterThread::issueNewEpisode()
 {
     int num_reg_loads = random() % tester->getEpisodeLength();
     int num_reg_stores = tester->getEpisodeLength() - num_reg_loads;
@@ -152,7 +152,7 @@
 }

 bool
-GpuThread::isNextActionReady()
+TesterThread::isNextActionReady()
 {
     if (!curEpisode->hasMoreActions()) {
         return false;
@@ -241,7 +241,7 @@
 }

 void
-GpuThread::issueNextAction()
+TesterThread::issueNextAction()
 {
     switch(curAction->getType()) {
         case Episode::Action::Type::ATOMIC:
@@ -278,7 +278,7 @@
 }

 void
-GpuThread::addOutstandingReqs(OutstandingReqTable& req_table, Addr address,
+TesterThread::addOutstandingReqs(OutstandingReqTable& req_table, Addr address,
                            int lane, Location loc, Value stored_val)
 {
     OutstandingReqTable::iterator it = req_table.find(address);
@@ -294,8 +294,8 @@
     }
 }

-GpuThread::OutstandingReq
-GpuThread::popOutstandingReq(OutstandingReqTable& req_table, Addr addr)
+TesterThread::OutstandingReq
+TesterThread::popOutstandingReq(OutstandingReqTable& req_table, Addr addr)
 {
     OutstandingReqTable::iterator it = req_table.find(addr);

@@ -321,7 +321,7 @@
 }

 void
-GpuThread::validateAtomicResp(Location loc, int lane, Value ret_val)
+TesterThread::validateAtomicResp(Location loc, int lane, Value ret_val)
 {
     if (!addrManager->validateAtomicResp(loc, ret_val)) {
         std::stringstream ss;
@@ -345,7 +345,7 @@
 }

 void
-GpuThread::validateLoadResp(Location loc, int lane, Value ret_val)
+TesterThread::validateLoadResp(Location loc, int lane, Value ret_val)
 {
     if (ret_val != addrManager->getLoggedValue(loc)) {
         std::stringstream ss;
@@ -354,7 +354,7 @@
         // basic info
         ss << threadName << ": Loaded value is not consistent with "
            << "the last stored value\n"
-           << "\tGpuThread " << threadId << "\n"
+           << "\tTesterThread " << threadId << "\n"
            << "\tEpisode " << curEpisode->getEpisodeId() << "\n"
            << "\tLane ID " << lane << "\n"
            << "\tAddress " << printAddress(addr) << "\n"
@@ -372,7 +372,7 @@
 }

 bool
-GpuThread::checkDRF(Location atomic_loc, Location loc, bool isStore) const
+TesterThread::checkDRF(Location atomic_loc, Location loc, bool isStore) const
 {
     if (curEpisode && curEpisode->isEpsActive()) {
         // check against the current episode this thread is executing
@@ -383,7 +383,7 @@
 }

 void
-GpuThread::checkDeadlock()
+TesterThread::checkDeadlock()
 {
     if ((curCycle() - lastActiveCycle) > deadlockThreshold) {
         // deadlock detected
@@ -408,7 +408,7 @@
 }

 void
-GpuThread::printOutstandingReqs(const OutstandingReqTable& table,
+TesterThread::printOutstandingReqs(const OutstandingReqTable& table,
                              std::stringstream& ss) const
 {
     Cycles cur_cycle = curCycle();
@@ -423,7 +423,7 @@
 }

 void
-GpuThread::printAllOutstandingReqs(std::stringstream& ss) const
+TesterThread::printAllOutstandingReqs(std::stringstream& ss) const
 {
     // dump all outstanding requests of this thread
     ss << "\t\tOutstanding Loads:\n";
diff --git a/src/cpu/testers/gpu_ruby_test/gpu_thread.hh b/src/cpu/testers/gpu_ruby_test/tester_thread.hh
similarity index 88%
rename from src/cpu/testers/gpu_ruby_test/gpu_thread.hh
rename to src/cpu/testers/gpu_ruby_test/tester_thread.hh
index 1c9fedc..bee4fda 100644
--- a/src/cpu/testers/gpu_ruby_test/gpu_thread.hh
+++ b/src/cpu/testers/gpu_ruby_test/tester_thread.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Advanced Micro Devices, Inc.
+ * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * For use for simulation and test purposes only
@@ -32,11 +32,11 @@
  */

 /*
- * GPU thread issues requests to and receives responses from Ruby memory
+ * Tester thread issues requests to and receives responses from Ruby memory
  */

-#ifndef CPU_TESTERS_PROTOCOL_TESTER_GPU_THREAD_HH_
-#define CPU_TESTERS_PROTOCOL_TESTER_GPU_THREAD_HH_
+#ifndef CPU_TESTERS_PROTOCOL_TESTER_TESTER_THREAD_HH_
+#define CPU_TESTERS_PROTOCOL_TESTER_TESTER_THREAD_HH_

 #include "cpu/testers/gpu_ruby_test/address_manager.hh"
 #include "cpu/testers/gpu_ruby_test/episode.hh"
@@ -45,12 +45,12 @@
 #include "mem/token_port.hh"
 #include "sim/clocked_object.hh"

-class GpuThread : public ClockedObject
+class TesterThread : public ClockedObject
 {
   public:
-    typedef GpuThreadParams Params;
-    GpuThread(const Params &p);
-    virtual ~GpuThread();
+    typedef TesterThreadParams Params;
+    TesterThread(const Params &p);
+    virtual ~TesterThread();

     typedef AddressManager::Location Location;
     typedef AddressManager::Value Value;
@@ -60,7 +60,7 @@
     void checkDeadlock();
     void scheduleDeadlockCheckEvent();

-    void attachGpuThreadToPorts(ProtocolTester *_tester,
+    void attachTesterThreadToPorts(ProtocolTester *_tester,
                              ProtocolTester::SeqPort *_port,
ProtocolTester::GMTokenPort *_tokenPort = nullptr,
                              ProtocolTester::SeqPort *_sqcPort = nullptr,
@@ -71,7 +71,7 @@
     // must be implemented by a child class
     virtual void hitCallback(PacketPtr pkt) = 0;

-    int getGpuThreadId() const { return threadId; }
+    int getTesterThreadId() const { return threadId; }
     int getNumLanes() const { return numLanes; }
     // check if the input location would satisfy DRF constraint
     bool checkDRF(Location atomic_loc, Location loc, bool isStore) const;
@@ -79,14 +79,14 @@
     void printAllOutstandingReqs(std::stringstream& ss) const;

   protected:
-    class GpuThreadEvent : public Event
+    class TesterThreadEvent : public Event
     {
       private:
-        GpuThread* thread;
+        TesterThread* thread;
         std::string desc;

       public:
-        GpuThreadEvent(GpuThread* _thread, std::string _description)
+        TesterThreadEvent(TesterThread* _thread, std::string _description)
             : Event(CPU_Tick_Pri), thread(_thread), desc(_description)
         {}
         void setDesc(std::string _description) { desc = _description; }
@@ -94,15 +94,15 @@
         const std::string name() const override { return desc; }
     };

-    GpuThreadEvent threadEvent;
+    TesterThreadEvent threadEvent;

     class DeadlockCheckEvent : public Event
     {
       private:
-        GpuThread* thread;
+        TesterThread* thread;

       public:
-        DeadlockCheckEvent(GpuThread* _thread)
+        DeadlockCheckEvent(TesterThread* _thread)
             : Event(CPU_Tick_Pri), thread(_thread)
         {}
         void process() override { thread->checkDeadlock(); }
@@ -204,4 +204,4 @@
                               std::stringstream& ss) const;
 };

-#endif /* CPU_TESTERS_PROTOCOL_TESTER_GPU_THREAD_HH_ */
+#endif /* CPU_TESTERS_PROTOCOL_TESTER_TESTER_THREAD_HH_ */

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/39935
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If241edb53ea405c95b0315c609176c6470b29931
Gerrit-Change-Number: 39935
Gerrit-PatchSet: 2
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Matt Sinclair <mattdsincl...@gmail.com>
Gerrit-Reviewer: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to