Prefetcher.cc (11108:6342ddf6d733) Prefetcher.cc (11118:75c1e564a725)
1/*
2 * Copyright (c) 1999-2012 Mark D. Hill and David A. Wood
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;

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

130 .name(name() + ".misses_on_prefetched_blocks")
131 .desc("number of misses for blocks that were prefetched, yet missed")
132 ;
133}
134
135void
136Prefetcher::observeMiss(Addr address, const RubyRequestType& type)
137{
1/*
2 * Copyright (c) 1999-2012 Mark D. Hill and David A. Wood
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;

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

130 .name(name() + ".misses_on_prefetched_blocks")
131 .desc("number of misses for blocks that were prefetched, yet missed")
132 ;
133}
134
135void
136Prefetcher::observeMiss(Addr address, const RubyRequestType& type)
137{
138 DPRINTF(RubyPrefetcher, "Observed miss for %s\n", address);
138 DPRINTF(RubyPrefetcher, "Observed miss for %#x\n", address);
139 Addr line_addr = makeLineAddress(address);
140 numMissObserved++;
141
142 // check to see if we have already issued a prefetch for this block
143 uint32_t index = 0;
144 PrefetchEntry *pfEntry = getPrefetchEntry(line_addr, index);
145 if (pfEntry != NULL) {
146 if (pfEntry->requestIssued[index]) {

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

199 return;
200 }
201}
202
203void
204Prefetcher::observePfMiss(Addr address)
205{
206 numPartialHits++;
139 Addr line_addr = makeLineAddress(address);
140 numMissObserved++;
141
142 // check to see if we have already issued a prefetch for this block
143 uint32_t index = 0;
144 PrefetchEntry *pfEntry = getPrefetchEntry(line_addr, index);
145 if (pfEntry != NULL) {
146 if (pfEntry->requestIssued[index]) {

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

199 return;
200 }
201}
202
203void
204Prefetcher::observePfMiss(Addr address)
205{
206 numPartialHits++;
207 DPRINTF(RubyPrefetcher, "Observed partial hit for %s\n", address);
207 DPRINTF(RubyPrefetcher, "Observed partial hit for %#x\n", address);
208 issueNextPrefetch(address, NULL);
209}
210
211void
212Prefetcher::observePfHit(Addr address)
213{
214 numHits++;
208 issueNextPrefetch(address, NULL);
209}
210
211void
212Prefetcher::observePfHit(Addr address)
213{
214 numHits++;
215 DPRINTF(RubyPrefetcher, "Observed hit for %s\n", address);
215 DPRINTF(RubyPrefetcher, "Observed hit for %#x\n", address);
216 issueNextPrefetch(address, NULL);
217}
218
219void
220Prefetcher::issueNextPrefetch(Addr address, PrefetchEntry *stream)
221{
222 // get our corresponding stream fetcher
223 if (stream == NULL) {

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

245 stream->m_is_valid = false;
246 return;
247 }
248 }
249
250 // launch next prefetch
251 stream->m_address = line_addr;
252 stream->m_use_time = m_controller->curCycle();
216 issueNextPrefetch(address, NULL);
217}
218
219void
220Prefetcher::issueNextPrefetch(Addr address, PrefetchEntry *stream)
221{
222 // get our corresponding stream fetcher
223 if (stream == NULL) {

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

245 stream->m_is_valid = false;
246 return;
247 }
248 }
249
250 // launch next prefetch
251 stream->m_address = line_addr;
252 stream->m_use_time = m_controller->curCycle();
253 DPRINTF(RubyPrefetcher, "Requesting prefetch for %s\n", line_addr);
253 DPRINTF(RubyPrefetcher, "Requesting prefetch for %#x\n", line_addr);
254 m_controller->enqueuePrefetch(line_addr, stream->m_type);
255}
256
257uint32_t
258Prefetcher::getLRUindex(void)
259{
260 uint32_t lru_index = 0;
261 Cycles lru_access = m_array[lru_index].m_use_time;

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

309 // deallocate this stream prefetcher
310 mystream->m_is_valid = false;
311 return;
312 }
313 }
314
315 // launch prefetch
316 numPrefetchRequested++;
254 m_controller->enqueuePrefetch(line_addr, stream->m_type);
255}
256
257uint32_t
258Prefetcher::getLRUindex(void)
259{
260 uint32_t lru_index = 0;
261 Cycles lru_access = m_array[lru_index].m_use_time;

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

309 // deallocate this stream prefetcher
310 mystream->m_is_valid = false;
311 return;
312 }
313 }
314
315 // launch prefetch
316 numPrefetchRequested++;
317 DPRINTF(RubyPrefetcher, "Requesting prefetch for %s\n", line_addr);
317 DPRINTF(RubyPrefetcher, "Requesting prefetch for %#x\n", line_addr);
318 m_controller->enqueuePrefetch(line_addr, m_array[index].m_type);
319 }
320
321 // update the address to be the last address prefetched
322 mystream->m_address = line_addr;
323}
324
325PrefetchEntry *

--- 151 unchanged lines hidden ---
318 m_controller->enqueuePrefetch(line_addr, m_array[index].m_type);
319 }
320
321 // update the address to be the last address prefetched
322 mystream->m_address = line_addr;
323}
324
325PrefetchEntry *

--- 151 unchanged lines hidden ---