base.cc (8232:b28d06a175be) base.cc (8509:afb40c3d4ba6)
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;

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

134 DPRINTF(HWPrefetch, "Requesting a hw_pf to issue\n");
135
136 if (pf.empty()) {
137 DPRINTF(HWPrefetch, "No HW_PF found\n");
138 return NULL;
139 }
140
141 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;

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

134 DPRINTF(HWPrefetch, "Requesting a hw_pf to issue\n");
135
136 if (pf.empty()) {
137 DPRINTF(HWPrefetch, "No HW_PF found\n");
138 return NULL;
139 }
140
141 PacketPtr pkt;
142 bool keep_trying = false;
143 do {
142 while (!pf.empty()) {
144 pkt = *pf.begin();
145 pf.pop_front();
146
143 pkt = *pf.begin();
144 pf.pop_front();
145
147 if (keep_trying) {
148 DPRINTF(HWPrefetch, "addr 0x%x in cache, skipping\n",
149 pkt->getAddr());
150 delete pkt->req;
151 delete pkt;
152 }
146 Addr blk_addr = pkt->getAddr() & ~(Addr)(blkSize-1);
153
147
148 if (!inCache(blk_addr) && !inMissQueue(blk_addr))
149 // we found a prefetch, return it
150 break;
151
152 DPRINTF(HWPrefetch, "addr 0x%x in cache, skipping\n", pkt->getAddr());
153 delete pkt->req;
154 delete pkt;
155
154 if (pf.empty()) {
155 cache->deassertMemSideBusRequest(BaseCache::Request_PF);
156 if (pf.empty()) {
157 cache->deassertMemSideBusRequest(BaseCache::Request_PF);
156 if (keep_trying) {
157 return NULL; // None left, all were in cache
158 }
158 return NULL; // None left, all were in cache
159 }
159 }
160 } while (keep_trying);
160 }
161
162 pfIssued++;
163 assert(pkt != NULL);
164 DPRINTF(HWPrefetch, "returning 0x%x\n", pkt->getAddr());
165 return pkt;
166}
167
168

--- 110 unchanged lines hidden ---
161
162 pfIssued++;
163 assert(pkt != NULL);
164 DPRINTF(HWPrefetch, "returning 0x%x\n", pkt->getAddr());
165 return pkt;
166}
167
168

--- 110 unchanged lines hidden ---