tagged.cc (12727:56c23b54bcb1) | tagged.cc (13422:4ec52da74cd5) |
---|---|
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; --- 33 unchanged lines hidden (view full) --- 42{ 43 44} 45 46void 47TaggedPrefetcher::calculatePrefetch(const PacketPtr &pkt, 48 std::vector<AddrPriority> &addresses) 49{ | 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; --- 33 unchanged lines hidden (view full) --- 42{ 43 44} 45 46void 47TaggedPrefetcher::calculatePrefetch(const PacketPtr &pkt, 48 std::vector<AddrPriority> &addresses) 49{ |
50 Addr blkAddr = pkt->getAddr() & ~(Addr)(blkSize-1); | 50 Addr blkAddr = pkt->getBlockAddr(blkSize); |
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} | 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} |