From: Tony Gutierrez Date: Thu, 2 May 2019 23:03:50 +0000 (-0400) Subject: mem-ruby: Add support for MemSync reqs in VIPER X-Git-Tag: v20.1.0.0~464 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a408b1ada7fea0fd8ba59b9214a312eb351b61d2;p=gem5.git mem-ruby: Add support for MemSync reqs in VIPER Change-Id: Ib129e82be5348c641a8ae18093324bcedfb38abe Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29939 Reviewed-by: Jason Lowe-Power Maintainer: Anthony Gutierrez Tested-by: kokoro --- diff --git a/src/mem/ruby/system/GPUCoalescer.cc b/src/mem/ruby/system/GPUCoalescer.cc index d9793fafd..80bc19a64 100644 --- a/src/mem/ruby/system/GPUCoalescer.cc +++ b/src/mem/ruby/system/GPUCoalescer.cc @@ -553,24 +553,25 @@ GPUCoalescer::makeRequest(PacketPtr pkt) assert(pkt->req->hasInstSeqNum()); if (pkt->cmd == MemCmd::MemSyncReq) { - // let the child coalescer handle MemSyncReq because this is - // cache coherence protocol specific - return RequestStatus_Issued; - } - // otherwise, this must be either read or write command - assert(pkt->isRead() || pkt->isWrite()); - - // the pkt is temporarily stored in the uncoalesced table until - // it's picked for coalescing process later in this cycle or in a - // future cycle - uncoalescedTable.insertPacket(pkt); - DPRINTF(GPUCoalescer, "Put pkt with addr 0x%X to uncoalescedTable\n", - pkt->getAddr()); - - // we schedule an issue event here to process the uncoalesced table - // and try to issue Ruby request to cache system - if (!issueEvent.scheduled()) { - schedule(issueEvent, curTick()); + // issue mem_sync requests immediately to the cache system without + // going through uncoalescedTable like normal LD/ST/Atomic requests + issueMemSyncRequest(pkt); + } else { + // otherwise, this must be either read or write command + assert(pkt->isRead() || pkt->isWrite()); + + // the pkt is temporarily stored in the uncoalesced table until + // it's picked for coalescing process later in this cycle or in a + // future cycle + uncoalescedTable.insertPacket(pkt); + DPRINTF(GPUCoalescer, "Put pkt with addr 0x%X to uncoalescedTable\n", + pkt->getAddr()); + + // we schedule an issue event here to process the uncoalesced table + // and try to issue Ruby request to cache system + if (!issueEvent.scheduled()) { + schedule(issueEvent, curTick()); + } } // we always return RequestStatus_Issued in this coalescer diff --git a/src/mem/ruby/system/GPUCoalescer.hh b/src/mem/ruby/system/GPUCoalescer.hh index 74236cb36..401f70bd4 100644 --- a/src/mem/ruby/system/GPUCoalescer.hh +++ b/src/mem/ruby/system/GPUCoalescer.hh @@ -367,7 +367,7 @@ class GPUCoalescer : public RubyPort // since the two following issue functions are protocol-specific, // they must be implemented in a derived coalescer virtual void issueRequest(CoalescedRequest* crequest) = 0; -// virtual void issueMemSyncRequest(PacketPtr pkt) = 0; + virtual void issueMemSyncRequest(PacketPtr pkt) {} void kernelCallback(int wavefront_id); diff --git a/src/mem/ruby/system/RubyPort.cc b/src/mem/ruby/system/RubyPort.cc index 0526e6560..4510e3a83 100644 --- a/src/mem/ruby/system/RubyPort.cc +++ b/src/mem/ruby/system/RubyPort.cc @@ -251,7 +251,7 @@ RubyPort::MemSlavePort::recvTimingReq(PacketPtr pkt) } // Check for pio requests and directly send them to the dedicated // pio port. - if (pkt->cmd != MemCmd::MemFenceReq) { + if (pkt->cmd != MemCmd::MemSyncReq) { if (!isPhysMemAddress(pkt)) { assert(ruby_port->memMasterPort.isConnected()); DPRINTF(RubyPort, "Request address %#x assumed to be a " @@ -312,7 +312,7 @@ RubyPort::MemSlavePort::recvAtomic(PacketPtr pkt) // Check for pio requests and directly send them to the dedicated // pio port. - if (pkt->cmd != MemCmd::MemFenceReq) { + if (pkt->cmd != MemCmd::MemSyncReq) { if (!isPhysMemAddress(pkt)) { assert(ruby_port->memMasterPort.isConnected()); DPRINTF(RubyPort, "Request address %#x assumed to be a " @@ -539,7 +539,7 @@ RubyPort::MemSlavePort::hitCallback(PacketPtr pkt) } // Flush, acquire, release requests don't access physical memory - if (pkt->isFlush() || pkt->cmd == MemCmd::MemFenceReq) { + if (pkt->isFlush() || pkt->cmd == MemCmd::MemSyncReq) { accessPhysMem = false; } @@ -649,4 +649,4 @@ RubyPort::functionalWrite(Packet *func_pkt) } } return num_written; -} \ No newline at end of file +}