mem-ruby, arch-hsail: Removed hit latency from VIPERCoalescer
authorPablo Prieto <pablo.prieto@unican.es>
Thu, 6 Jun 2019 14:33:26 +0000 (16:33 +0200)
committerAnthony Gutierrez <anthony.gutierrez@amd.com>
Mon, 19 Aug 2019 17:00:33 +0000 (17:00 +0000)
Removed the dcache hit latency from VIPERCoalescer so HSAIL_X86
compiles after commit 496d5ed3e1f7dad42b0c2ebe0050d84621be8f99

Change-Id: I050a58d90f0f6356824c3c3bcb3f0b3c76d145e0
Signed-off-by: Pablo Prieto <pablo.prieto@unican.es>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19148
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/ruby/system/VIPERCoalescer.cc

index c332a557abab468331f45e8a59be216ddd02c51b..b7f2561ef9e78402e0dcac9ac3116360e7971c47 100644 (file)
@@ -213,12 +213,16 @@ VIPERCoalescer::invL1()
     for (int i = 0; i < size; i++) {
         Addr addr = m_dataCache_ptr->getAddressAtIdx(i);
         // Evict Read-only data
+        RubyRequestType request_type = RubyRequestType_REPLACEMENT;
         std::shared_ptr<RubyRequest> msg = std::make_shared<RubyRequest>(
             clockEdge(), addr, (uint8_t*) 0, 0, 0,
-            RubyRequestType_REPLACEMENT, RubyAccessMode_Supervisor,
+            request_type, RubyAccessMode_Supervisor,
             nullptr);
         assert(m_mandatory_q_ptr != NULL);
-        m_mandatory_q_ptr->enqueue(msg, clockEdge(), m_data_cache_hit_latency);
+        Tick latency = cyclesToTicks(
+                            m_controller->mandatoryQueueLatency(request_type));
+        assert(latency > 0);
+        m_mandatory_q_ptr->enqueue(msg, clockEdge(), latency);
         m_outstanding_inv++;
     }
     DPRINTF(GPUCoalescer,
@@ -240,12 +244,16 @@ VIPERCoalescer::wbL1()
     for (int i = 0; i < size; i++) {
         Addr addr = m_dataCache_ptr->getAddressAtIdx(i);
         // Write dirty data back
+        RubyRequestType request_type = RubyRequestType_FLUSH;
         std::shared_ptr<RubyRequest> msg = std::make_shared<RubyRequest>(
             clockEdge(), addr, (uint8_t*) 0, 0, 0,
-            RubyRequestType_FLUSH, RubyAccessMode_Supervisor,
+            request_type, RubyAccessMode_Supervisor,
             nullptr);
         assert(m_mandatory_q_ptr != NULL);
-        m_mandatory_q_ptr->enqueue(msg, clockEdge(), m_data_cache_hit_latency);
+        Tick latency = cyclesToTicks(
+                            m_controller->mandatoryQueueLatency(request_type));
+        assert(latency > 0);
+        m_mandatory_q_ptr->enqueue(msg, clockEdge(), latency);
         m_outstanding_wb++;
     }
     DPRINTF(GPUCoalescer,
@@ -264,24 +272,32 @@ VIPERCoalescer::invwbL1()
     for (int i = 0; i < size; i++) {
         Addr addr = m_dataCache_ptr->getAddressAtIdx(i);
         // Evict Read-only data
+        RubyRequestType request_type = RubyRequestType_REPLACEMENT;
         std::shared_ptr<RubyRequest> msg = std::make_shared<RubyRequest>(
             clockEdge(), addr, (uint8_t*) 0, 0, 0,
-            RubyRequestType_REPLACEMENT, RubyAccessMode_Supervisor,
+            request_type, RubyAccessMode_Supervisor,
             nullptr);
         assert(m_mandatory_q_ptr != NULL);
-        m_mandatory_q_ptr->enqueue(msg, clockEdge(), m_data_cache_hit_latency);
+        Tick latency = cyclesToTicks(
+                            m_controller->mandatoryQueueLatency(request_type));
+        assert(latency > 0);
+        m_mandatory_q_ptr->enqueue(msg, clockEdge(), latency);
         m_outstanding_inv++;
     }
     // Walk the cache
     for (int i = 0; i< size; i++) {
         Addr addr = m_dataCache_ptr->getAddressAtIdx(i);
         // Write dirty data back
+        RubyRequestType request_type = RubyRequestType_FLUSH;
         std::shared_ptr<RubyRequest> msg = std::make_shared<RubyRequest>(
             clockEdge(), addr, (uint8_t*) 0, 0, 0,
-            RubyRequestType_FLUSH, RubyAccessMode_Supervisor,
+            request_type, RubyAccessMode_Supervisor,
             nullptr);
         assert(m_mandatory_q_ptr != NULL);
-        m_mandatory_q_ptr->enqueue(msg, clockEdge(), m_data_cache_hit_latency);
+        Tick latency = cyclesToTicks(
+                m_controller->mandatoryQueueLatency(request_type));
+        assert(latency > 0);
+        m_mandatory_q_ptr->enqueue(msg, clockEdge(), latency);
         m_outstanding_wb++;
     }
 }