Deleted Added
sdiff udiff text old ( 12727:56c23b54bcb1 ) new ( 13416:d90887d0c889 )
full compact
1/*
2 * Copyright (c) 2013-2014 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

46 * Hardware Prefetcher Definition.
47 */
48
49#include "mem/cache/prefetch/base.hh"
50
51#include <cassert>
52
53#include "base/intmath.hh"
54#include "mem/cache/base.hh"
55#include "params/BasePrefetcher.hh"
56#include "sim/system.hh"
57
58BasePrefetcher::BasePrefetcher(const BasePrefetcherParams *p)
59 : ClockedObject(p), cache(nullptr), blkSize(0), lBlkSize(0),
60 system(p->sys), onMiss(p->on_miss), onRead(p->on_read),
61 onWrite(p->on_write), onData(p->on_data), onInst(p->on_inst),
62 masterId(system->getMasterId(this)),
63 pageBytes(system->getPageBytes())
64{
65}
66
67void
68BasePrefetcher::setCache(BaseCache *_cache)
69{
70 assert(!cache);
71 cache = _cache;

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

158 return a & (pageBytes - 1);
159}
160
161Addr
162BasePrefetcher::pageIthBlockAddress(Addr page, uint32_t blockIndex) const
163{
164 return page + (blockIndex << lBlkSize);
165}