fa_lru.cc (2814:b723c79f5349) fa_lru.cc (2991:60cd98c72fd9)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 131 unchanged lines hidden (view full) ---

140 tagIterator iter = tagHash.find(addr);
141 if (iter != tagHash.end()) {
142 return (*iter).second;
143 }
144 return NULL;
145}
146
147bool
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 131 unchanged lines hidden (view full) ---

140 tagIterator iter = tagHash.find(addr);
141 if (iter != tagHash.end()) {
142 return (*iter).second;
143 }
144 return NULL;
145}
146
147bool
148FALRU::probe(int asid, Addr addr) const
148FALRU::probe(Addr addr) const
149{
150 Addr blkAddr = blkAlign(addr);
151 FALRUBlk* blk = hashLookup(blkAddr);
152 return blk && blk->tag == blkAddr && blk->isValid();
153}
154
155void
149{
150 Addr blkAddr = blkAlign(addr);
151 FALRUBlk* blk = hashLookup(blkAddr);
152 return blk && blk->tag == blkAddr && blk->isValid();
153}
154
155void
156FALRU::invalidateBlk(int asid, Addr addr)
156FALRU::invalidateBlk(Addr addr)
157{
158 Addr blkAddr = blkAlign(addr);
159 FALRUBlk* blk = (*tagHash.find(blkAddr)).second;
160 if (blk) {
161 assert(blk->tag == blkAddr);
162 blk->status = 0;
163 blk->isTouched = false;
164 tagsInUse--;
165 }
166}
167
168FALRUBlk*
157{
158 Addr blkAddr = blkAlign(addr);
159 FALRUBlk* blk = (*tagHash.find(blkAddr)).second;
160 if (blk) {
161 assert(blk->tag == blkAddr);
162 blk->status = 0;
163 blk->isTouched = false;
164 tagsInUse--;
165 }
166}
167
168FALRUBlk*
169FALRU::findBlock(Addr addr, int asid, int &lat, int *inCache)
169FALRU::findBlock(Addr addr, int &lat, int *inCache)
170{
171 accesses++;
172 int tmp_in_cache = 0;
173 Addr blkAddr = blkAlign(addr);
174 FALRUBlk* blk = hashLookup(blkAddr);
175
176 if (blk && blk->isValid()) {
177 assert(blk->tag == blkAddr);

--- 59 unchanged lines hidden (view full) ---

237 }
238
239 lat = hitLatency;
240 //assert(check());
241 return blk;
242}
243
244FALRUBlk*
170{
171 accesses++;
172 int tmp_in_cache = 0;
173 Addr blkAddr = blkAlign(addr);
174 FALRUBlk* blk = hashLookup(blkAddr);
175
176 if (blk && blk->isValid()) {
177 assert(blk->tag == blkAddr);

--- 59 unchanged lines hidden (view full) ---

237 }
238
239 lat = hitLatency;
240 //assert(check());
241 return blk;
242}
243
244FALRUBlk*
245FALRU::findBlock(Addr addr, int asid) const
245FALRU::findBlock(Addr addr) const
246{
247 Addr blkAddr = blkAlign(addr);
248 FALRUBlk* blk = hashLookup(blkAddr);
249
250 if (blk && blk->isValid()) {
251 assert(blk->tag == blkAddr);
252 } else {
253 blk = NULL;

--- 81 unchanged lines hidden ---
246{
247 Addr blkAddr = blkAlign(addr);
248 FALRUBlk* blk = hashLookup(blkAddr);
249
250 if (blk && blk->isValid()) {
251 assert(blk->tag == blkAddr);
252 } else {
253 blk = NULL;

--- 81 unchanged lines hidden ---