1/* 2 * Copyright (c) 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; --- 30 unchanged lines hidden (view full) --- 39 40TaggedPrefetcher::TaggedPrefetcher(const TaggedPrefetcherParams *p) 41 : QueuedPrefetcher(p), degree(p->degree) 42{ 43 44} 45 46void |
47TaggedPrefetcher::calculatePrefetch(const PrefetchInfo &pfi, |
48 std::vector<AddrPriority> &addresses) 49{ |
50 Addr blkAddr = blockAddress(pfi.getAddr()); |
51 52 for (int d = 1; d <= degree; d++) { 53 Addr newAddr = blkAddr + d*(blkSize); 54 if (!samePage(blkAddr, newAddr)) { 55 // Count number of unissued prefetches due to page crossing 56 pfSpanPage += degree - d + 1; 57 return; 58 } else { 59 addresses.push_back(AddrPriority(newAddr,0)); 60 } 61 } 62} 63 64TaggedPrefetcher* 65TaggedPrefetcherParams::create() 66{ 67 return new TaggedPrefetcher(this); 68} |