mem: Fixes a bug in simple_dram write merging
authorAmin Farmahini <aminfar@gmail.com>
Wed, 29 Jan 2014 00:00:49 +0000 (18:00 -0600)
committerAmin Farmahini <aminfar@gmail.com>
Wed, 29 Jan 2014 00:00:49 +0000 (18:00 -0600)
Fixes updating the value of size in the write merge function.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

src/mem/simple_dram.cc

index b2ee4172f2a94541226f7cc41efc205c03f6f3b5..9538ea7197c337f38359846298590045c8cf5639 100644 (file)
@@ -506,8 +506,8 @@ SimpleDRAM::addToWriteQueue(PacketPtr pkt, unsigned int pktCount)
                     merged = true;
                     // the existing queue item needs to be adjusted with
                     // respect to both address and size
-                    (*w)->addr = addr;
                     (*w)->size = (*w)->addr + (*w)->size - addr;
+                    (*w)->addr = addr;
                 }
             } else {
                 // the new one starts after the current one, figure