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