changeset b0a7c7b7748a in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=b0a7c7b7748a
description:
        inorder: support for compare and swap insts
        dont treat read() and write() fields as mut. exclusive

diffstat:

 src/cpu/inorder/resources/cache_unit.cc |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 440835b0179a -r b0a7c7b7748a src/cpu/inorder/resources/cache_unit.cc
--- a/src/cpu/inorder/resources/cache_unit.cc   Sun Jun 19 21:43:37 2011 -0400
+++ b/src/cpu/inorder/resources/cache_unit.cc   Sun Jun 19 21:43:37 2011 -0400
@@ -833,9 +833,17 @@
                                             Packet::Broadcast,
                                             cache_req->instIdx);
 
-    if (cache_req->dataPkt->isRead()) {
+    bool is_read = cache_req->dataPkt->isRead();
+    bool is_write = cache_req->dataPkt->isWrite();
+
+    //@note: a compare and swap will both marked both read and write
+    if (is_read && !is_write) {
+        DPRINTF(InOrderCachePort, "Read Data Set in Packet\n");
+
         cache_req->dataPkt->dataStatic(cache_req->reqData);
-    } else if (cache_req->dataPkt->isWrite()) {        
+    }
+
+    if (is_write) {
         if (inst->split2ndAccess) {            
             cache_req->dataPkt->dataStatic(inst->split2ndStoreDataPtr);
         } else {
@@ -858,7 +866,7 @@
 
     Request *memReq = cache_req->dataPkt->req;
 
-    if (cache_req->dataPkt->isWrite() && cache_req->memReq->isLLSC()) {
+    if (is_write && cache_req->memReq->isLLSC()) {
         assert(cache_req->inst->isStoreConditional());
         DPRINTF(InOrderCachePort, "Evaluating Store Conditional access\n");
         do_access = TheISA::handleLockedWrite(cpu, memReq);
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to