diff options
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/exec_context.hh | 9 | ||||
-rw-r--r-- | cpu/simple_cpu/simple_cpu.cc | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh index 08879b3b5..b47f5cd08 100644 --- a/cpu/exec_context.hh +++ b/cpu/exec_context.hh @@ -33,6 +33,7 @@ #include "mem/mem_req.hh" #include "mem/functional_mem/functional_memory.hh" #include "sim/serialize.hh" +#include "targetarch/byte_swap.hh" // forward declaration: see functional_memory.hh class FunctionalMemory; @@ -260,7 +261,11 @@ class ExecContext cregs->lock_flag = true; } #endif - return mem->read(req, data); + + Fault error; + error = mem->read(req, data); + data = htoa(data); + return error; } template <class T> @@ -309,7 +314,7 @@ class ExecContext } #endif - return mem->write(req, data); + return mem->write(req, (T)htoa(data)); } virtual bool misspeculating(); diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc index 99e302ca3..bf4cbfbe2 100644 --- a/cpu/simple_cpu/simple_cpu.cc +++ b/cpu/simple_cpu/simple_cpu.cc @@ -710,6 +710,7 @@ SimpleCPU::tick() comInstEventQueue[0]->serviceEvents(numInst); // decode the instruction + inst = htoa(inst); StaticInstPtr<TheISA> si(inst); traceData = Trace::getInstRecord(curTick, xc, this, si, |