cache.hh (9445:5963165c00cb) cache.hh (9529:28d6d9663a7e)
1/*
1/*
2 * Copyright (c) 2012 ARM Limited
2 * Copyright (c) 2012-2013 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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

285 * @note This shouldn't normally happen, but we need to handle it
286 * since some architecture models don't implement cache
287 * maintenance operations. We won't even try to get a decent
288 * timing here since the line should have been flushed earlier by
289 * a cache maintenance operation.
290 */
291 void uncacheableFlush(PacketPtr pkt);
292
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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

285 * @note This shouldn't normally happen, but we need to handle it
286 * since some architecture models don't implement cache
287 * maintenance operations. We won't even try to get a decent
288 * timing here since the line should have been flushed earlier by
289 * a cache maintenance operation.
290 */
291 void uncacheableFlush(PacketPtr pkt);
292
293 public:
294 /** Instantiates a basic cache object. */
295 Cache(const Params *p, TagStore *tags);
296
297 void regStats();
298
299 /**
300 * Performs the access specified by the request.
301 * @param pkt The request to perform.
302 * @return The result of the access.
303 */
304 bool timingAccess(PacketPtr pkt);
305
306 /**

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

351 * @param blk The block currently in the cache corresponding to
352 * cpu_pkt (NULL if none).
353 * @param needsExclusive Indicates that an exclusive copy is required
354 * even if the request in cpu_pkt doesn't indicate that.
355 * @return A new Packet containing the request, or NULL if the
356 * current request in cpu_pkt should just be forwarded on.
357 */
358 PacketPtr getBusPacket(PacketPtr cpu_pkt, BlkType *blk,
293 /**
294 * Performs the access specified by the request.
295 * @param pkt The request to perform.
296 * @return The result of the access.
297 */
298 bool timingAccess(PacketPtr pkt);
299
300 /**

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

345 * @param blk The block currently in the cache corresponding to
346 * cpu_pkt (NULL if none).
347 * @param needsExclusive Indicates that an exclusive copy is required
348 * even if the request in cpu_pkt doesn't indicate that.
349 * @return A new Packet containing the request, or NULL if the
350 * current request in cpu_pkt should just be forwarded on.
351 */
352 PacketPtr getBusPacket(PacketPtr cpu_pkt, BlkType *blk,
359 bool needsExclusive);
353 bool needsExclusive) const;
360
361 /**
362 * Return the next MSHR to service, either a pending miss from the
363 * mshrQueue, a buffered write from the write buffer, or something
364 * from the prefetcher. This function is responsible for
365 * prioritizing among those sources on the fly.
366 */
367 MSHR *getNextMSHR();

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

384 /**
385 * Return whether there are any outstanding misses.
386 */
387 bool outstandingMisses() const
388 {
389 return mshrQueue.allocated != 0;
390 }
391
354
355 /**
356 * Return the next MSHR to service, either a pending miss from the
357 * mshrQueue, a buffered write from the write buffer, or something
358 * from the prefetcher. This function is responsible for
359 * prioritizing among those sources on the fly.
360 */
361 MSHR *getNextMSHR();

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

378 /**
379 * Return whether there are any outstanding misses.
380 */
381 bool outstandingMisses() const
382 {
383 return mshrQueue.allocated != 0;
384 }
385
392 CacheBlk *findBlock(Addr addr) {
386 CacheBlk *findBlock(Addr addr) const {
393 return tags->findBlock(addr);
394 }
395
387 return tags->findBlock(addr);
388 }
389
396 bool inCache(Addr addr) {
390 bool inCache(Addr addr) const {
397 return (tags->findBlock(addr) != 0);
398 }
399
391 return (tags->findBlock(addr) != 0);
392 }
393
400 bool inMissQueue(Addr addr) {
394 bool inMissQueue(Addr addr) const {
401 return (mshrQueue.findMatch(addr) != 0);
402 }
403
404 /**
405 * Find next request ready time from among possible sources.
406 */
395 return (mshrQueue.findMatch(addr) != 0);
396 }
397
398 /**
399 * Find next request ready time from among possible sources.
400 */
407 Tick nextMSHRReadyTime();
401 Tick nextMSHRReadyTime() const;
408
402
403 public:
404 /** Instantiates a basic cache object. */
405 Cache(const Params *p, TagStore *tags);
406
407 void regStats();
408
409 /** serialize the state of the caches
410 * We currently don't support checkpointing cache state, so this panics.
411 */
412 virtual void serialize(std::ostream &os);
413 void unserialize(Checkpoint *cp, const std::string &section);
414};
415
416#endif // __CACHE_HH__
409 /** serialize the state of the caches
410 * We currently don't support checkpointing cache state, so this panics.
411 */
412 virtual void serialize(std::ostream &os);
413 void unserialize(Checkpoint *cp, const std::string &section);
414};
415
416#endif // __CACHE_HH__