Matthew Poremba has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/39937 )

Change subject: cpu: Implement DMA atomic issue in Ruby GPU tester
......................................................................

cpu: Implement DMA atomic issue in Ruby GPU tester

This adds the ability to generatic atomic DMA requests using the Ruby
GPU tester.

Change-Id: I2142816b4601229877bb6968cd8ceef54029fa00
---
M src/cpu/testers/gpu_ruby_test/dma_thread.cc
1 file changed, 36 insertions(+), 1 deletion(-)



diff --git a/src/cpu/testers/gpu_ruby_test/dma_thread.cc b/src/cpu/testers/gpu_ruby_test/dma_thread.cc
index 254158d..0da3590 100644
--- a/src/cpu/testers/gpu_ruby_test/dma_thread.cc
+++ b/src/cpu/testers/gpu_ruby_test/dma_thread.cc
@@ -174,7 +174,42 @@
     assert(pendingLdStCount == 0);
     assert(pendingAtomicCount == 0);

-    // no-op: No DMA protocol exists with Atomics
+    Request::Flags flags = Request::ATOMIC_RETURN_OP;
+    int lane = 0;
+
+    Location location = curAction->getLocation(lane);
+    assert(location >= 0);
+
+    Addr address = addrManager->getAddress(location);
+
+    DPRINTF(ProtocolTest, "%s Episode %d: Issuing Atomic_Inc - Addr %s\n",
+            this->getName(), curEpisode->getEpisodeId(),
+            printAddress(address));
+
+    // must be aligned with store size
+    assert(address % sizeof(Value) == 0);
+    AtomicOpFunctor *amo_op = new AtomicOpInc<Value>();
+    auto req = std::make_shared<Request>(address, sizeof(Value),
+                                         flags, tester->requestorId(),
+                                         0, threadId,
+                                         AtomicOpFunctorPtr(amo_op));
+    req->setPaddr(address);
+    req->setReqInstSeqNum(tester->getActionSeqNum());
+
+    PacketPtr pkt = new Packet(req, MemCmd::SwapReq);
+    uint8_t* data = new uint8_t[sizeof(Value)];
+    pkt->dataDynamic(data);
+    pkt->senderState = new ProtocolTester::SenderState(this);
+
+    if (!port->sendTimingReq(pkt)) {
+        panic("Not expecting failed sendTimingReq\n");
+    }
+
+    // add an outstanding atomic
+    addOutstandingReqs(outstandingAtomics, address, lane, location);
+
+    // increment the number of outstanding atomic ops
+    pendingAtomicCount++;
 }

 void

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/39937
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: I2142816b4601229877bb6968cd8ceef54029fa00
Gerrit-Change-Number: 39937
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-MessageType: newchange
_______________________________________________
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