changeset 056a88043835 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=056a88043835
description:
        CPU: Set a default value when readBytes faults.

        This was being done in read(), but if readBytes was called directly it
        wouldn't happen. Also, instead of setting the memory blob being read to 
-1
        which would (I believe) require using memset with -1 as a parameter, 
this now
        uses bzero. It's hoped that it's more specialized behavior will make it
        slightly faster.

diffstat:

 src/cpu/base_dyn_inst.hh |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (28 lines):

diff -r 4154f3e1edae -r 056a88043835 src/cpu/base_dyn_inst.hh
--- a/src/cpu/base_dyn_inst.hh  Mon Aug 23 11:18:39 2010 -0500
+++ b/src/cpu/base_dyn_inst.hh  Mon Aug 23 11:18:39 2010 -0500
@@ -899,6 +899,12 @@
         this->setExecuted();
     }
 
+    if (fault != NoFault) {
+        // Return a fixed value to keep simulation deterministic even
+        // along misspeculated paths.
+        bzero(data, size);
+    }
+
     if (traceData) {
         traceData->setAddr(addr);
     }
@@ -913,11 +919,6 @@
 {
     Fault fault = readBytes(addr, (uint8_t *)&data, sizeof(T), flags);
 
-    if (fault != NoFault) {
-        // Return a fixed value to keep simulation deterministic even
-        // along misspeculated paths.
-        data = (T)-1;
-    }
     data = TheISA::gtoh(data);
 
     if (traceData) {
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to