Deleted Added
sdiff udiff text old ( 13416:d90887d0c889 ) new ( 13422:4ec52da74cd5 )
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

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

58
59void
60BasePrefetcher::PrefetchListener::notify(const PacketPtr &pkt)
61{
62 parent.probeNotify(pkt);
63}
64
65BasePrefetcher::BasePrefetcher(const BasePrefetcherParams *p)
66 : ClockedObject(p), listeners(), cache(nullptr), blkSize(0), lBlkSize(0),
67 system(p->sys), onMiss(p->on_miss), onRead(p->on_read),
68 onWrite(p->on_write), onData(p->on_data), onInst(p->on_inst),
69 masterId(system->getMasterId(this)),
70 pageBytes(system->getPageBytes()),
71 prefetchOnAccess(p->prefetch_on_access)
72{
73}
74
75void
76BasePrefetcher::setCache(BaseCache *_cache)
77{
78 assert(!cache);
79 cache = _cache;
80 blkSize = cache->getBlockSize();
81 lBlkSize = floorLog2(blkSize);
82}
83
84void
85BasePrefetcher::regStats()
86{
87 ClockedObject::regStats();

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

116 }
117
118 return true;
119}
120
121bool
122BasePrefetcher::inCache(Addr addr, bool is_secure) const
123{
124 if (cache->inCache(addr, is_secure)) {
125 return true;
126 }
127 return false;
128}
129
130bool
131BasePrefetcher::inMissQueue(Addr addr, bool is_secure) const
132{
133 if (cache->inMissQueue(addr, is_secure)) {
134 return true;
135 }
136 return false;
137}
138
139bool
140BasePrefetcher::samePage(Addr a, Addr b) const
141{
142 return roundDown(a, pageBytes) == roundDown(b, pageBytes);
143}
144

--- 64 unchanged lines hidden ---