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; --- 28 unchanged lines hidden (view full) --- 37 38#include "arch/isa_traits.hh" 39#include "base/trace.hh" 40#include "config/the_isa.hh" 41#include "debug/HWPrefetch.hh" 42#include "mem/cache/prefetch/base.hh" 43#include "mem/cache/base.hh" 44#include "mem/request.hh" |
45#include "sim/system.hh" |
46 47BasePrefetcher::BasePrefetcher(const Params *p) 48 : SimObject(p), size(p->size), latency(p->latency), degree(p->degree), |
49 useMasterId(p->use_master_id), pageStop(!p->cross_pages), 50 serialSquash(p->serial_squash), onlyData(p->data_accesses_only), 51 system(p->sys), masterId(system->getMasterId(name())) |
52{ 53} 54 55void 56BasePrefetcher::setCache(BaseCache *_cache) 57{ 58 cache = _cache; 59 blkSize = cache->getBlockSize(); --- 167 unchanged lines hidden (view full) --- 227 // Check if it is already in the pf buffer 228 if (inPrefetch(addr) != pf.end()) { 229 pfBufferHit++; 230 DPRINTF(HWPrefetch, "Prefetch addr already in pf buffer\n"); 231 continue; 232 } 233 234 // create a prefetch memreq |
235 Request *prefetchReq = new Request(*addrIter, blkSize, 0, masterId); |
236 PacketPtr prefetch = 237 new Packet(prefetchReq, MemCmd::HardPFReq, Packet::Broadcast); 238 prefetch->allocate(); 239 prefetch->req->setThreadContext(pkt->req->contextId(), 240 pkt->req->threadId()); 241 242 prefetch->time = time + (*delayIter); // @todo ADD LATENCY HERE 243 --- 38 unchanged lines hidden --- |