summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-07-27 00:54:30 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-07-27 00:54:30 -0700
commit52b4a7c36ffbfcf48f6360ace5b69c18adddfa7a (patch)
tree424eaa26a4d69bef98a0825655f5ce516e3c3d8b /src
parent90d3d3535b206fa011ab86ffc278c8851fe997a6 (diff)
downloadgem5-52b4a7c36ffbfcf48f6360ace5b69c18adddfa7a.tar.xz
ARM: Only send information that changed between statetrace and M5.
Diffstat (limited to 'src')
-rw-r--r--src/arch/arm/nativetrace.cc27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/arch/arm/nativetrace.cc b/src/arch/arm/nativetrace.cc
index 469869e56..7c9c70e0c 100644
--- a/src/arch/arm/nativetrace.cc
+++ b/src/arch/arm/nativetrace.cc
@@ -51,10 +51,31 @@ Trace::ArmNativeTrace::ThreadState::update(NativeTrace *parent)
current = (current + 1) % 2;
newState = state[current];
- parent->read(newState, sizeof(newState[0]) * STATE_NUMVALS);
+ memcpy(newState, oldState, sizeof(state[0]));
+
+ uint32_t diffVector;
+ parent->read(&diffVector, sizeof(diffVector));
+ diffVector = ArmISA::gtoh(diffVector);
+
+ int changes = 0;
for (int i = 0; i < STATE_NUMVALS; i++) {
- newState[i] = ArmISA::gtoh(newState[i]);
- changed[i] = (oldState[i] != newState[i]);
+ if (diffVector & 0x1) {
+ changed[i] = true;
+ changes++;
+ } else {
+ changed[i] = false;
+ }
+ diffVector >>= 1;
+ }
+
+ uint32_t values[changes];
+ parent->read(values, sizeof(values));
+ int pos = 0;
+ for (int i = 0; i < STATE_NUMVALS; i++) {
+ if (changed[i]) {
+ newState[i] = ArmISA::gtoh(values[pos++]);
+ changed[i] = (newState[i] != oldState[i]);
+ }
}
}