summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/alpha/isa/mem.isa2
-rw-r--r--src/arch/arm/isa/templates/mem.isa8
-rw-r--r--src/arch/arm/isa/templates/mem64.isa2
-rw-r--r--src/arch/arm/isa/templates/neon64.isa5
-rw-r--r--src/arch/generic/memhelpers.hh10
-rw-r--r--src/arch/mips/isa/formats/mem.isa2
-rw-r--r--src/arch/power/isa/formats/mem.isa2
-rw-r--r--src/arch/sparc/isa/formats/mem/util.isa2
-rw-r--r--src/arch/x86/isa/formats/monitor_mwait.isa3
-rw-r--r--src/arch/x86/isa/microops/ldstop.isa2
-rw-r--r--src/arch/x86/memhelpers.hh7
11 files changed, 21 insertions, 24 deletions
diff --git a/src/arch/alpha/isa/mem.isa b/src/arch/alpha/isa/mem.isa
index 71b134340..6ba8ee5d0 100644
--- a/src/arch/alpha/isa/mem.isa
+++ b/src/arch/alpha/isa/mem.isa
@@ -223,7 +223,7 @@ def template LoadInitiateAcc {{
%(ea_code)s;
if (fault == NoFault) {
- fault = readMemTiming(xc, traceData, EA, Mem, memAccessFlags);
+ fault = initiateMemRead(xc, traceData, EA, Mem, memAccessFlags);
}
return fault;
diff --git a/src/arch/arm/isa/templates/mem.isa b/src/arch/arm/isa/templates/mem.isa
index bac1cd211..51f598f50 100644
--- a/src/arch/arm/isa/templates/mem.isa
+++ b/src/arch/arm/isa/templates/mem.isa
@@ -438,7 +438,8 @@ def template LoadInitiateAcc {{
if (%(predicate_test)s)
{
if (fault == NoFault) {
- fault = readMemTiming(xc, traceData, EA, Mem, memAccessFlags);
+ fault = initiateMemRead(xc, traceData, EA, Mem,
+ memAccessFlags);
}
} else {
xc->setPredicate(false);
@@ -461,13 +462,10 @@ def template NeonLoadInitiateAcc {{
%(op_rd)s;
%(ea_code)s;
- MemUnion memUnion;
- uint8_t *dataPtr = memUnion.bytes;
-
if (%(predicate_test)s)
{
if (fault == NoFault) {
- fault = xc->readMem(EA, dataPtr, %(size)d, memAccessFlags);
+ fault = xc->initiateMemRead(EA, %(size)d, memAccessFlags);
}
} else {
xc->setPredicate(false);
diff --git a/src/arch/arm/isa/templates/mem64.isa b/src/arch/arm/isa/templates/mem64.isa
index 72ee882a7..e831f17a5 100644
--- a/src/arch/arm/isa/templates/mem64.isa
+++ b/src/arch/arm/isa/templates/mem64.isa
@@ -191,7 +191,7 @@ def template Load64InitiateAcc {{
%(ea_code)s;
if (fault == NoFault) {
- fault = readMemTiming(xc, traceData, EA, Mem, memAccessFlags);
+ fault = initiateMemRead(xc, traceData, EA, Mem, memAccessFlags);
}
return fault;
diff --git a/src/arch/arm/isa/templates/neon64.isa b/src/arch/arm/isa/templates/neon64.isa
index 19dd50910..6356073c5 100644
--- a/src/arch/arm/isa/templates/neon64.isa
+++ b/src/arch/arm/isa/templates/neon64.isa
@@ -313,11 +313,8 @@ def template NeonLoadInitiateAcc64 {{
%(op_rd)s;
%(ea_code)s;
- MemUnion memUnion;
- uint8_t *dataPtr = memUnion.bytes;
-
if (fault == NoFault) {
- fault = xc->readMem(EA, dataPtr, accSize, memAccessFlags);
+ fault = xc->initiateMemRead(EA, accSize, memAccessFlags);
}
return fault;
diff --git a/src/arch/generic/memhelpers.hh b/src/arch/generic/memhelpers.hh
index aa082553a..b12e7b0b1 100644
--- a/src/arch/generic/memhelpers.hh
+++ b/src/arch/generic/memhelpers.hh
@@ -48,13 +48,15 @@
#include "sim/byteswap.hh"
#include "sim/insttracer.hh"
-/// Read from memory in timing mode.
+/// Initiate a read from memory in timing mode. Note that the 'mem'
+/// parameter is unused; only the type of that parameter is used
+/// to determine the size of the access.
template <class XC, class MemT>
Fault
-readMemTiming(XC *xc, Trace::InstRecord *traceData, Addr addr,
- MemT &mem, unsigned flags)
+initiateMemRead(XC *xc, Trace::InstRecord *traceData, Addr addr,
+ MemT &mem, unsigned flags)
{
- return xc->readMem(addr, (uint8_t *)&mem, sizeof(MemT), flags);
+ return xc->initiateMemRead(addr, sizeof(MemT), flags);
}
/// Extract the data returned from a timing mode read.
diff --git a/src/arch/mips/isa/formats/mem.isa b/src/arch/mips/isa/formats/mem.isa
index 80107be8b..052ead82c 100644
--- a/src/arch/mips/isa/formats/mem.isa
+++ b/src/arch/mips/isa/formats/mem.isa
@@ -253,7 +253,7 @@ def template LoadInitiateAcc {{
%(ea_code)s;
if (fault == NoFault) {
- fault = readMemTiming(xc, traceData, EA, Mem, memAccessFlags);
+ fault = initiateMemRead(xc, traceData, EA, Mem, memAccessFlags);
}
return fault;
diff --git a/src/arch/power/isa/formats/mem.isa b/src/arch/power/isa/formats/mem.isa
index 0c0dff6ca..eafd6aea7 100644
--- a/src/arch/power/isa/formats/mem.isa
+++ b/src/arch/power/isa/formats/mem.isa
@@ -109,7 +109,7 @@ def template LoadInitiateAcc {{
%(ea_code)s;
if (fault == NoFault) {
- fault = readMemTiming(xc, traceData, EA, Mem, memAccessFlags);
+ fault = initiateMemRead(xc, traceData, EA, Mem, memAccessFlags);
xc->setEA(EA);
}
diff --git a/src/arch/sparc/isa/formats/mem/util.isa b/src/arch/sparc/isa/formats/mem/util.isa
index 53559e493..a5c64dda5 100644
--- a/src/arch/sparc/isa/formats/mem/util.isa
+++ b/src/arch/sparc/isa/formats/mem/util.isa
@@ -171,7 +171,7 @@ def template LoadInitiateAcc {{
%(fault_check)s;
if (fault == NoFault) {
%(EA_trunc)s
- fault = readMemTiming(xc, traceData, EA, Mem, %(asi_val)s);
+ fault = initiateMemRead(xc, traceData, EA, Mem, %(asi_val)s);
}
return fault;
}
diff --git a/src/arch/x86/isa/formats/monitor_mwait.isa b/src/arch/x86/isa/formats/monitor_mwait.isa
index b26c1f267..c901ceded 100644
--- a/src/arch/x86/isa/formats/monitor_mwait.isa
+++ b/src/arch/x86/isa/formats/monitor_mwait.isa
@@ -67,10 +67,9 @@ def template MwaitInitiateAcc {{
Fault %(class_name)s::initiateAcc(CPU_EXEC_CONTEXT * xc,
Trace::InstRecord * traceData) const
{
- uint64_t m = 0; //mem
unsigned s = 0x8; //size
unsigned f = 0; //flags
- readMemTiming(xc, traceData, xc->getAddrMonitor()->vAddr, m, s, f);
+ initiateMemRead(xc, traceData, xc->getAddrMonitor()->vAddr, s, f);
return NoFault;
}
}};
diff --git a/src/arch/x86/isa/microops/ldstop.isa b/src/arch/x86/isa/microops/ldstop.isa
index a7c201f44..fa8bc6f2b 100644
--- a/src/arch/x86/isa/microops/ldstop.isa
+++ b/src/arch/x86/isa/microops/ldstop.isa
@@ -127,7 +127,7 @@ def template MicroLoadInitiateAcc {{
%(ea_code)s;
DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA);
- fault = readMemTiming(xc, traceData, EA, Mem, dataSize, memFlags);
+ fault = initiateMemRead(xc, traceData, EA, dataSize, memFlags);
return fault;
}
diff --git a/src/arch/x86/memhelpers.hh b/src/arch/x86/memhelpers.hh
index 640327325..705457d67 100644
--- a/src/arch/x86/memhelpers.hh
+++ b/src/arch/x86/memhelpers.hh
@@ -38,12 +38,13 @@
namespace X86ISA
{
+/// Initiate a read from memory in timing mode.
template <class XC>
Fault
-readMemTiming(XC *xc, Trace::InstRecord *traceData, Addr addr,
- uint64_t &mem, unsigned dataSize, unsigned flags)
+initiateMemRead(XC *xc, Trace::InstRecord *traceData, Addr addr,
+ unsigned dataSize, unsigned flags)
{
- return xc->readMem(addr, (uint8_t *)&mem, dataSize, flags);
+ return xc->initiateMemRead(addr, dataSize, flags);
}
static inline uint64_t