#include "mem/cache/base_cache.hh"
#include "mem/cache/prefetch/prefetcher.hh"
-// forward declarations
-class Bus;
+//Forward decleration
+class MSHR;
+
/**
* A template-policy based cache. The behavior of the cache can be altered by
*/
int busWidth;
+ /**
+ * The latency of a hit in this device.
+ */
+ int hitLatency;
+
/**
* A permanent mem req to always be used to cause invalidations.
* Used to append to target list, to cause an invalidation.
bool doCopy;
bool blockOnCopy;
BaseCache::Params baseParams;
- Bus *in;
- Bus *out;
Prefetcher<TagStore, Buffering> *prefetcher;
bool prefetchAccess;
+ int hitLatency;
Params(TagStore *_tags, Buffering *mq, Coherence *coh,
- bool do_copy, BaseCache::Params params, Bus * in_bus,
- Bus * out_bus, Prefetcher<TagStore, Buffering> *_prefetcher,
- bool prefetch_access)
+ bool do_copy, BaseCache::Params params,
+ Prefetcher<TagStore, Buffering> *_prefetcher,
+ bool prefetch_access, int hit_latency)
: tags(_tags), missQueue(mq), coherence(coh), doCopy(do_copy),
- blockOnCopy(false), baseParams(params), in(in_bus), out(out_bus),
- prefetcher(_prefetcher), prefetchAccess(prefetch_access)
+ blockOnCopy(false), baseParams(params),
+ prefetcher(_prefetcher), prefetchAccess(prefetch_access),
+ hitLatency(hit_latency)
{
}
};
/** Instantiates a basic cache object. */
- Cache(const std::string &_name, HierParams *hier_params, Params ¶ms);
+ Cache(const std::string &_name, Params ¶ms);
+
+ virtual bool doTimingAccess(Packet *pkt, CachePort *cachePort,
+ bool isCpuSide);
+
+ virtual Tick doAtomicAccess(Packet *pkt, bool isCpuSide);
+
+ virtual void doFunctionalAccess(Packet *pkt, bool isCpuSide);
+
+ virtual void recvStatusChange(Port::Status status, bool isCpuSide);
void regStats();
* @param req The request to perform.
* @return The result of the access.
*/
- MemAccessResult access(Packet * &pkt);
+ bool access(Packet * &pkt);
/**
* Selects a request to send on the bus.
* @return The memory request to service.
*/
- Packet * getPacket();
+ virtual Packet * getPacket();
/**
* Was the request was sent successfully?
return missQueue->getMisses();
}
- /**
- * Send a response to the slave interface.
- * @param req The request being responded to.
- * @param time The time the response is ready.
- */
- void respond(Packet * &pkt, Tick time)
- {
- si->respond(pkt,time);
- }
-
/**
* Perform the access specified in the request and return the estimated
* time of completion. This function can either update the hierarchy state