ruby: Assert for x86 misaligned access
authorBrad Beckmann <Brad.Beckmann@amd.com>
Mon, 7 Feb 2011 06:14:18 +0000 (22:14 -0800)
committerBrad Beckmann <Brad.Beckmann@amd.com>
Mon, 7 Feb 2011 06:14:18 +0000 (22:14 -0800)
This patch ensures only aligned access are passed to ruby and includes a fix
to the DPRINTF address print.

src/mem/ruby/system/RubyPort.cc

index ea1ff04f0d62740f3881ce678270a1e09907af6c..b3225cdca57c98d361c142ca85e726cfe9d440a6 100644 (file)
@@ -226,6 +226,9 @@ RubyPort::M5Port::recvTiming(PacketPtr pkt)
                              pkt->getSize(), pc, type,
                              RubyAccessMode_Supervisor, pkt);
 
+    assert(Address(ruby_request.paddr).getOffset() + ruby_request.len <=
+        RubySystem::getBlockSizeBytes());
+
     // Submit the ruby request
     RequestStatus requestStatus = ruby_port->makeRequest(ruby_request);
 
@@ -237,7 +240,7 @@ RubyPort::M5Port::recvTiming(PacketPtr pkt)
     }
 
     DPRINTF(MemoryAccess,
-            "Request for address #x did not issue because %s\n",
+            "Request for address %#x did not issue because %s\n",
             pkt->getAddr(), RequestStatus_to_string(requestStatus));
 
     SenderState* senderState = safe_cast<SenderState*>(pkt->senderState);