diff options
author | Lisa Hsu <hsul@eecs.umich.edu> | 2006-12-15 13:27:53 -0500 |
---|---|---|
committer | Lisa Hsu <hsul@eecs.umich.edu> | 2006-12-15 13:27:53 -0500 |
commit | 991146218de5c0019fa6f97ef0f9742f1105ccb3 (patch) | |
tree | 194d336cdf736a7972c7fe4b36803a45d48a9a62 /src/mem/cache/miss/blocking_buffer.cc | |
parent | 573d59441e420f02fd7cf3e31158258f5eee3ab1 (diff) | |
parent | a10eff03a529ef79ac9481188cdaf01b269efe16 (diff) | |
download | gem5-991146218de5c0019fa6f97ef0f9742f1105ccb3.tar.xz |
Merge zizzer:/bk/sparcfs
into zed.eecs.umich.edu:/z/hsul/work/sparc/m5
--HG--
extra : convert_revision : 2f11b5f9fa6356cbf9f98c8cd7d4f6fbfaf9d24d
Diffstat (limited to 'src/mem/cache/miss/blocking_buffer.cc')
-rw-r--r-- | src/mem/cache/miss/blocking_buffer.cc | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/mem/cache/miss/blocking_buffer.cc b/src/mem/cache/miss/blocking_buffer.cc index bf741e547..4a431d82d 100644 --- a/src/mem/cache/miss/blocking_buffer.cc +++ b/src/mem/cache/miss/blocking_buffer.cc @@ -33,11 +33,9 @@ * Definitions of a simple buffer for a blocking cache. */ -#include "cpu/smt.hh" //for maxThreadsPerCPU #include "mem/cache/base_cache.hh" #include "mem/cache/miss/blocking_buffer.hh" #include "mem/cache/prefetch/base_prefetcher.hh" -#include "sim/eventq.hh" // for Event declaration. #include "mem/request.hh" /** @@ -46,28 +44,11 @@ void BlockingBuffer::regStats(const std::string &name) { - using namespace Stats; - writebacks - .init(maxThreadsPerCPU) - .name(name + ".writebacks") - .desc("number of writebacks") - .flags(total) - ; + MissBuffer::regStats(name); } -void -BlockingBuffer::setCache(BaseCache *_cache) -{ - cache = _cache; - blkSize = cache->getBlockSize(); -} void -BlockingBuffer::setPrefetcher(BasePrefetcher *_prefetcher) -{ - prefetcher = _prefetcher; -} -void BlockingBuffer::handleMiss(PacketPtr &pkt, int blk_size, Tick time) { Addr blk_addr = pkt->getAddr() & ~(Addr)(blk_size - 1); @@ -241,3 +222,23 @@ BlockingBuffer::doWriteback(PacketPtr &pkt) cache->setBlocked(Blocked_NoWBBuffers); cache->setMasterRequest(Request_WB, curTick); } + + +MSHR * +BlockingBuffer::findMSHR(Addr addr) +{ + if (miss.addr == addr && miss.pkt) + return &miss; + return NULL; +} + + +bool +BlockingBuffer::findWrites(Addr addr, std::vector<MSHR*>& writes) +{ + if (wb.addr == addr && wb.pkt) { + writes.push_back(&wb); + return true; + } + return false; +} |