Andreas Sandberg has uploaded this change for review. ( https://gem5-review.googlesource.com/2228

Change subject: gpu-compute: Fix Python/C++ object hierarchy discrepancies
......................................................................

gpu-compute: Fix Python/C++ object hierarchy discrepancies

The GPUCoalescer and the Shader classes have different base classes in
C++ and Python. This causes subtle bugs in SWIG and compilation errors
for PyBind.

Change-Id: I1ddd2a8ea43f083470538ddfea891347b21d14d8
Reviewed-by: Andreas Hansson <andreas.hans...@arm.com>
---
M src/gpu-compute/shader.cc
M src/gpu-compute/shader.hh
M src/mem/ruby/system/GPUCoalescer.hh
M src/mem/ruby/system/GPUCoalescer.py
4 files changed, 17 insertions(+), 8 deletions(-)



diff --git a/src/gpu-compute/shader.cc b/src/gpu-compute/shader.cc
index e47edce..e181055 100644
--- a/src/gpu-compute/shader.cc
+++ b/src/gpu-compute/shader.cc
@@ -50,7 +50,7 @@
 #include "mem/ruby/system/RubySystem.hh"
 #include "sim/sim_exit.hh"

-Shader::Shader(const Params *p) : SimObject(p),
+Shader::Shader(const Params *p) : ClockedObject(p),
clock(p->clk_domain->clockPeriod()), cpuThread(nullptr), gpuTc(nullptr),
     cpuPointer(p->cpu_pointer), tickEvent(this), timingSim(p->timing),
     hsail_mode(SIMT), impl_kern_boundary_sync(p->impl_kern_boundary_sync),
diff --git a/src/gpu-compute/shader.hh b/src/gpu-compute/shader.hh
index 13afab9..55c3fee 100644
--- a/src/gpu-compute/shader.hh
+++ b/src/gpu-compute/shader.hh
@@ -73,7 +73,7 @@
 // Class Shader: This describes a single shader instance. Most
 // configurations will only have a single shader.

-class Shader : public SimObject
+class Shader : public ClockedObject
 {
   protected:
       // Shader's clock period in terms of number of ticks of curTime,
diff --git a/src/mem/ruby/system/GPUCoalescer.hh b/src/mem/ruby/system/GPUCoalescer.hh
index 557d392..2b42e19 100644
--- a/src/mem/ruby/system/GPUCoalescer.hh
+++ b/src/mem/ruby/system/GPUCoalescer.hh
@@ -49,7 +49,7 @@
 #include "mem/request.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Consumer.hh"
-#include "mem/ruby/system/RubyPort.hh"
+#include "mem/ruby/system/Sequencer.hh"

 class DataBlock;
 class CacheMsg;
@@ -255,10 +255,6 @@

     bool handleLlsc(Addr address, GPUCoalescerRequest* request);

-    // Private copy constructor and assignment operator
-    GPUCoalescer(const GPUCoalescer& obj);
-    GPUCoalescer& operator=(const GPUCoalescer& obj);
-
     class IssueEvent : public Event
     {
       private:
@@ -370,6 +366,11 @@
     std::vector<Stats::Histogram *> m_InitialToForwardDelayHist;
     std::vector<Stats::Histogram *> m_ForwardToFirstResponseDelayHist;
     std::vector<Stats::Histogram *> m_FirstResponseToCompletionDelayHist;
+
+private:
+    // Private copy constructor and assignment operator
+    GPUCoalescer(const GPUCoalescer& obj);
+    GPUCoalescer& operator=(const GPUCoalescer& obj);
 };

 inline std::ostream&
diff --git a/src/mem/ruby/system/GPUCoalescer.py b/src/mem/ruby/system/GPUCoalescer.py
index 0c19f87..101a5fe 100644
--- a/src/mem/ruby/system/GPUCoalescer.py
+++ b/src/mem/ruby/system/GPUCoalescer.py
@@ -36,7 +36,7 @@
 from m5.proxy import *
 from Sequencer import *

-class RubyGPUCoalescer(RubySequencer):
+class RubyGPUCoalescer(RubyPort):
    type = 'RubyGPUCoalescer'
    cxx_class = 'GPUCoalescer'
    cxx_header = "mem/ruby/system/GPUCoalescer.hh"
@@ -46,3 +46,11 @@
"max requests (incl. prefetches) outstanding")
    assume_rfo = Param.Bool(True, "assume protocol implementes Read for "
                            "Ownership coherence");
+
+   icache = Param.RubyCache("")
+   dcache = Param.RubyCache("")
+   deadlock_threshold = Param.Cycles(500000,
+       "max outstanding cycles for a request before " \
+       "deadlock/livelock declared")
+   garnet_standalone = Param.Bool(False, "")
+   dcache_hit_latency = Param.Cycles(1, "Data cache hit latency")

--
To view, visit https://gem5-review.googlesource.com/2228
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ddd2a8ea43f083470538ddfea891347b21d14d8
Gerrit-Change-Number: 2228
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <andreas.sandb...@arm.com>
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to