fa_lru.cc (5716:ee56bb539212) fa_lru.cc (5717:6ed48cba2217)
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;

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

202 assert(blk->tag == blkAddr);
203 } else {
204 blk = NULL;
205 }
206 return blk;
207}
208
209FALRUBlk*
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;

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

202 assert(blk->tag == blkAddr);
203 } else {
204 blk = NULL;
205 }
206 return blk;
207}
208
209FALRUBlk*
210FALRU::findReplacement(Addr addr, PacketList &writebacks)
210FALRU::findVictim(Addr addr, PacketList &writebacks)
211{
212 FALRUBlk * blk = tail;
213 assert(blk->inCache == 0);
214 moveToHead(blk);
215 tagHash.erase(blk->tag);
216 tagHash[blkAlign(addr)] = blk;
217 if (blk->isValid()) {
218 replacements[0]++;

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

224 warmupCycle = curTick;
225 }
226 }
227 //assert(check());
228 return blk;
229}
230
231void
211{
212 FALRUBlk * blk = tail;
213 assert(blk->inCache == 0);
214 moveToHead(blk);
215 tagHash.erase(blk->tag);
216 tagHash[blkAlign(addr)] = blk;
217 if (blk->isValid()) {
218 replacements[0]++;

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

224 warmupCycle = curTick;
225 }
226 }
227 //assert(check());
228 return blk;
229}
230
231void
232FALRU::insertBlock(Addr addr, FALRU::BlkType *blk)
233{
234}
235
236void
232FALRU::moveToHead(FALRUBlk *blk)
233{
234 int updateMask = blk->inCache ^ cacheMask;
235 for (int i = 0; i < numCaches; i++){
236 if ((1<<i) & updateMask) {
237 cacheBoundaries[i]->inCache &= ~(1<<i);
238 cacheBoundaries[i] = cacheBoundaries[i]->prev;
239 } else if (cacheBoundaries[i] == blk) {

--- 45 unchanged lines hidden ---
237FALRU::moveToHead(FALRUBlk *blk)
238{
239 int updateMask = blk->inCache ^ cacheMask;
240 for (int i = 0; i < numCaches; i++){
241 if ((1<<i) & updateMask) {
242 cacheBoundaries[i]->inCache &= ~(1<<i);
243 cacheBoundaries[i] = cacheBoundaries[i]->prev;
244 } else if (cacheBoundaries[i] == blk) {

--- 45 unchanged lines hidden ---