changeset 79e0b89fe408 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=79e0b89fe408
description:
Merged with Gabe's recent changes.
diffstat:
src/arch/alpha/isa/main.isa | 1 +
src/arch/alpha/isa/mem.isa | 18 +-
src/arch/arm/isa/includes.isa | 1 +
src/arch/arm/isa/templates/mem.isa | 45 +-
src/arch/generic/memhelpers.hh | 100 ++
src/arch/mips/isa/formats/mem.isa | 39 +-
src/arch/mips/isa/includes.isa | 1 +
src/arch/power/isa/formats/mem.isa | 14 +-
src/arch/power/isa/includes.isa | 1 +
src/arch/sparc/isa/formats/mem/swap.isa | 11 +-
src/arch/sparc/isa/formats/mem/util.isa | 12 +-
src/arch/sparc/isa/includes.isa | 1 +
src/arch/x86/insts/microldstop.hh | 67 -
src/arch/x86/isa/includes.isa | 1 +
src/arch/x86/isa/microops/ldstop.isa | 12 +-
src/arch/x86/memhelpers.hh | 120 +++
src/cpu/base_dyn_inst.hh | 63 +-
src/cpu/exec_context.hh | 17 +-
src/cpu/inorder/inorder_dyn_inst.cc | 144 +---
src/cpu/inorder/inorder_dyn_inst.hh | 27 +-
src/cpu/simple/atomic.cc | 148 +---
src/cpu/simple/atomic.hh | 12 +-
src/cpu/simple/timing.cc | 149 +---
src/cpu/simple/timing.hh | 17 +-
tests/long/00.gzip/ref/x86/linux/o3-timing/simerr | 3 -
tests/long/00.gzip/ref/x86/linux/o3-timing/simout | 18 +-
tests/long/00.gzip/ref/x86/linux/o3-timing/stats.txt | 18 +-
tests/long/10.mcf/ref/x86/linux/o3-timing/simerr | 3 -
tests/long/10.mcf/ref/x86/linux/o3-timing/simout | 18 +-
tests/long/10.mcf/ref/x86/linux/o3-timing/stats.txt | 130 +-
tests/long/20.parser/ref/x86/linux/o3-timing/simerr | 3 -
tests/long/20.parser/ref/x86/linux/o3-timing/simout | 20 +-
tests/long/20.parser/ref/x86/linux/o3-timing/stats.txt | 673 ++++++++--------
tests/long/70.twolf/ref/x86/linux/o3-timing/config.ini | 2 +-
tests/long/70.twolf/ref/x86/linux/o3-timing/simerr | 3 -
tests/long/70.twolf/ref/x86/linux/o3-timing/simout | 18 +-
tests/long/70.twolf/ref/x86/linux/o3-timing/stats.txt | 198 ++--
tests/quick/00.hello/ref/x86/linux/o3-timing/simerr | 3 -
tests/quick/00.hello/ref/x86/linux/o3-timing/simout | 18 +-
tests/quick/00.hello/ref/x86/linux/o3-timing/stats.txt | 20 +-
util/tracediff | 6 +-
41 files changed, 894 insertions(+), 1281 deletions(-)
diffs (truncated from 3311 to 300 lines):
diff -r be8f4157c8f4 -r 79e0b89fe408 src/arch/alpha/isa/main.isa
--- a/src/arch/alpha/isa/main.isa Sun Jul 03 11:33:46 2011 -0500
+++ b/src/arch/alpha/isa/main.isa Sun Jul 03 11:38:25 2011 -0500
@@ -73,6 +73,7 @@
#include "arch/alpha/registers.hh"
#include "arch/alpha/regredir.hh"
+#include "arch/generic/memhelpers.hh"
#include "base/cp_annotate.hh"
#include "base/fenv.hh"
#include "config/ss_compatible_fp.hh"
diff -r be8f4157c8f4 -r 79e0b89fe408 src/arch/alpha/isa/mem.isa
--- a/src/arch/alpha/isa/mem.isa Sun Jul 03 11:33:46 2011 -0500
+++ b/src/arch/alpha/isa/mem.isa Sun Jul 03 11:38:25 2011 -0500
@@ -197,7 +197,7 @@
%(ea_code)s;
if (fault == NoFault) {
- fault = xc->read(EA, (uint%(mem_acc_size)d_t&)Mem, memAccessFlags);
+ fault = readMemAtomic(xc, traceData, EA, Mem, memAccessFlags);
%(memacc_code)s;
}
@@ -223,7 +223,7 @@
%(ea_code)s;
if (fault == NoFault) {
- fault = xc->read(EA, (uint%(mem_acc_size)d_t &)Mem,
memAccessFlags);
+ fault = readMemTiming(xc, traceData, EA, Mem, memAccessFlags);
}
return fault;
@@ -241,7 +241,7 @@
%(fp_enable_check)s;
%(op_decl)s;
- Mem = pkt->get<typeof(Mem)>();
+ getMem(pkt, Mem, traceData);
if (fault == NoFault) {
%(memacc_code)s;
@@ -273,8 +273,8 @@
}
if (fault == NoFault) {
- fault = xc->write((uint%(mem_acc_size)d_t&)Mem, EA,
- memAccessFlags, NULL);
+ fault = writeMemAtomic(xc, traceData, Mem, EA,
+ memAccessFlags, NULL);
}
if (fault == NoFault) {
@@ -307,8 +307,8 @@
}
if (fault == NoFault) {
- fault = xc->write((uint%(mem_acc_size)d_t&)Mem, EA,
- memAccessFlags, &write_result);
+ fault = writeMemAtomic(xc, traceData, Mem, EA,
+ memAccessFlags, &write_result);
}
if (fault == NoFault) {
@@ -340,8 +340,8 @@
}
if (fault == NoFault) {
- fault = xc->write((uint%(mem_acc_size)d_t&)Mem, EA,
- memAccessFlags, NULL);
+ fault = writeMemTiming(xc, traceData, Mem, EA,
+ memAccessFlags, NULL);
}
return fault;
diff -r be8f4157c8f4 -r 79e0b89fe408 src/arch/arm/isa/includes.isa
--- a/src/arch/arm/isa/includes.isa Sun Jul 03 11:33:46 2011 -0500
+++ b/src/arch/arm/isa/includes.isa Sun Jul 03 11:38:25 2011 -0500
@@ -80,6 +80,7 @@
#include "arch/arm/faults.hh"
#include "arch/arm/isa_traits.hh"
#include "arch/arm/utility.hh"
+#include "arch/generic/memhelpers.hh"
#include "base/condcodes.hh"
#include "sim/pseudo_inst.hh"
#if defined(linux)
diff -r be8f4157c8f4 -r 79e0b89fe408 src/arch/arm/isa/templates/mem.isa
--- a/src/arch/arm/isa/templates/mem.isa Sun Jul 03 11:33:46 2011 -0500
+++ b/src/arch/arm/isa/templates/mem.isa Sun Jul 03 11:38:25 2011 -0500
@@ -87,8 +87,8 @@
%(preacc_code)s;
if (fault == NoFault) {
- fault = xc->write((uint%(mem_acc_size)d_t&)Mem,
- EA, memAccessFlags, &memData);
+ fault = writeMemAtomic(xc, traceData, Mem, EA, memAccessFlags,
+ &memData);
}
if (fault == NoFault) {
@@ -123,8 +123,8 @@
%(preacc_code)s;
if (fault == NoFault) {
- fault = xc->write((uint%(mem_acc_size)d_t&)Mem, EA,
- memAccessFlags, &memData);
+ fault = writeMemTiming(xc, traceData, Mem, EA, memAccessFlags,
+ &memData);
}
} else {
xc->setPredicate(false);
@@ -147,7 +147,8 @@
if (%(predicate_test)s)
{
// ARM instructions will not have a pkt if the predicate is false
- uint64_t memData = pkt->get<typeof(Mem)>();
+ getMem(pkt, Mem, traceData);
+ uint64_t memData = Mem;
%(postacc_code)s;
@@ -174,7 +175,7 @@
if (%(predicate_test)s)
{
if (fault == NoFault) {
- fault = xc->read(EA, (uint%(mem_acc_size)d_t&)Mem,
memAccessFlags);
+ fault = readMemAtomic(xc, traceData, EA, Mem, memAccessFlags);
%(memacc_code)s;
}
@@ -208,7 +209,7 @@
if (%(predicate_test)s)
{
if (fault == NoFault) {
- fault = xc->readBytes(EA, dataPtr, %(size)d, memAccessFlags);
+ fault = xc->readMem(EA, dataPtr, %(size)d, memAccessFlags);
%(memacc_code)s;
}
@@ -241,8 +242,8 @@
}
if (fault == NoFault) {
- fault = xc->write((uint%(mem_acc_size)d_t&)Mem, EA,
- memAccessFlags, NULL);
+ fault = writeMemAtomic(xc, traceData, Mem, EA,
+ memAccessFlags, NULL);
}
if (fault == NoFault) {
@@ -279,8 +280,8 @@
}
if (fault == NoFault) {
- fault = xc->writeBytes(dataPtr, %(size)d, EA,
- memAccessFlags, NULL);
+ fault = xc->writeMem(dataPtr, %(size)d, EA,
+ memAccessFlags, NULL);
}
if (fault == NoFault) {
@@ -314,8 +315,8 @@
uint64_t writeResult;
if (fault == NoFault) {
- fault = xc->write((uint%(mem_acc_size)d_t&)Mem, EA,
- memAccessFlags, &writeResult);
+ fault = writeMemAtomic(xc, traceData, Mem, EA, memAccessFlags,
+ &writeResult);
}
if (fault == NoFault) {
@@ -351,8 +352,8 @@
}
if (fault == NoFault) {
- fault = xc->write((uint%(mem_acc_size)d_t&)Mem, EA,
- memAccessFlags, NULL);
+ fault = writeMemTiming(xc, traceData, Mem, EA, memAccessFlags,
+ NULL);
}
} else {
xc->setPredicate(false);
@@ -380,8 +381,8 @@
}
if (fault == NoFault) {
- fault = xc->write((uint%(mem_acc_size)d_t&)Mem, EA,
- memAccessFlags, NULL);
+ fault = writeMemTiming(xc, traceData, Mem, EA, memAccessFlags,
+ NULL);
}
} else {
xc->setPredicate(false);
@@ -412,8 +413,8 @@
}
if (fault == NoFault) {
- fault = xc->writeBytes(memUnion.bytes, %(size)d, EA,
- memAccessFlags, NULL);
+ fault = xc->writeMem(memUnion.bytes, %(size)d, EA,
+ memAccessFlags, NULL);
}
} else {
xc->setPredicate(false);
@@ -437,7 +438,7 @@
if (%(predicate_test)s)
{
if (fault == NoFault) {
- fault = xc->read(EA, (uint%(mem_acc_size)d_t &)Mem,
memAccessFlags);
+ fault = readMemTiming(xc, traceData, EA, Mem, memAccessFlags);
}
} else {
xc->setPredicate(false);
@@ -466,7 +467,7 @@
if (%(predicate_test)s)
{
if (fault == NoFault) {
- fault = xc->readBytes(EA, dataPtr, %(size)d, memAccessFlags);
+ fault = xc->readMem(EA, dataPtr, %(size)d, memAccessFlags);
}
} else {
xc->setPredicate(false);
@@ -489,7 +490,7 @@
if (%(predicate_test)s)
{
// ARM instructions will not have a pkt if the predicate is false
- Mem = pkt->get<typeof(Mem)>();
+ getMem(pkt, Mem, traceData);
if (fault == NoFault) {
%(memacc_code)s;
diff -r be8f4157c8f4 -r 79e0b89fe408 src/arch/generic/memhelpers.hh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/arch/generic/memhelpers.hh Sun Jul 03 11:38:25 2011 -0500
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2011 Google
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Gabe Black
+ */
+
+#ifndef __ARCH_GENERIC_MEMHELPERS_HH__
+#define __ARCH_GENERIC_MEMHELPERS_HH__
+
+#include "base/types.hh"
+#include "sim/byteswap.hh"
+#include "sim/fault_fwd.hh"
+#include "sim/insttracer.hh"
+
+/// Read from memory in timing mode.
+template <class XC, class MemT>
+Fault
+readMemTiming(XC *xc, Trace::InstRecord *traceData, Addr addr,
+ MemT &mem, unsigned flags)
+{
+ return xc->readMem(addr, (uint8_t *)&mem, sizeof(MemT), flags);
+}
+
+/// Extract the data returned from a timing mode read.
+template <class MemT>
+void
+getMem(PacketPtr pkt, MemT &mem, Trace::InstRecord *traceData)
+{
+ mem = pkt->get<MemT>();
+ if (traceData)
+ traceData->setData(mem);
+}
+
+/// Read from memory in atomic mode.
+template <class XC, class MemT>
+Fault
+readMemAtomic(XC *xc, Trace::InstRecord *traceData, Addr addr, MemT &mem,
+ unsigned flags)
+{
+ memset(&mem, 0, sizeof(mem));
+ Fault fault = readMemTiming(xc, traceData, addr, mem, flags);
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev