summaryrefslogtreecommitdiff
path: root/src/arch/alpha
diff options
context:
space:
mode:
authorVincentius Robby <acolyte@umich.edu>2007-08-08 14:18:09 -0400
committerVincentius Robby <acolyte@umich.edu>2007-08-08 14:18:09 -0400
commit13d10e844c7465b4f7375da6e196cd36ffd0e37d (patch)
tree5ce24f04043b232bb7a658884f5e8adbf7f68d2e /src/arch/alpha
parentef32494e723283c5a0a8c27bcb657a0e9ca9e25c (diff)
downloadgem5-13d10e844c7465b4f7375da6e196cd36ffd0e37d.tar.xz
alpha: Make the TLB cache to actually work.
Improve MRU checking for StaticInst, Bus, TLB --HG-- extra : convert_revision : 9116b5655cd2986aeb4205438aad4a0f5a440006
Diffstat (limited to 'src/arch/alpha')
-rw-r--r--src/arch/alpha/tlb.cc28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/arch/alpha/tlb.cc b/src/arch/alpha/tlb.cc
index 205b81baf..16aaca54d 100644
--- a/src/arch/alpha/tlb.cc
+++ b/src/arch/alpha/tlb.cc
@@ -80,16 +80,21 @@ TLB::lookup(Addr vpn, uint8_t asn) const
// assume not found...
PTE *retval = NULL;
- if (PTECache[0] && vpn == PTECache[0]->tag &&
- (PTECache[0]->asma || PTECache[0]->asn == asn))
- retval = PTECache[0];
- else if (PTECache[1] && vpn == PTECache[1]->tag &&
- (PTECache[1]->asma || PTECache[1]->asn == asn))
- retval = PTECache[1];
- else if (PTECache[2] && vpn == PTECache[2]->tag &&
- (PTECache[2]->asma || PTECache[2]->asn == asn))
- retval = PTECache[2];
- else {
+ if (PTECache[0]) {
+ if (vpn == PTECache[0]->tag &&
+ (PTECache[0]->asma || PTECache[0]->asn == asn))
+ retval = PTECache[0];
+ else if (PTECache[1]) {
+ if (vpn == PTECache[1]->tag &&
+ (PTECache[1]->asma || PTECache[1]->asn == asn))
+ retval = PTECache[1];
+ else if (PTECache[2] && vpn == PTECache[2]->tag &&
+ (PTECache[2]->asma || PTECache[2]->asn == asn))
+ retval = PTECache[2];
+ }
+ }
+
+ if (retval == NULL)
PageTable::const_iterator i = lookupTable.find(vpn);
if (i != lookupTable.end()) {
while (i->first == vpn) {
@@ -98,6 +103,9 @@ TLB::lookup(Addr vpn, uint8_t asn) const
assert(pte->valid);
if (vpn == pte->tag && (pte->asma || pte->asn == asn)) {
retval = pte;
+ PTECache[2] = PTECache[1];
+ PTECache[1] = PTECache[0];
+ PTECache[0] = pte;
break;
}