X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmem%2Fcache%2Ftags%2Fbase.cc;h=8b52b746eaa2809080b0acba1331219a8acd15fd;hb=a66fe6a8c36c9ab49cb3a35065bfc645d51036c8;hp=2ec1379b00a0e7ec01d8c73ff8c94ad9bc1fff65;hpb=da4539dc749c3d29c03de9b3130f1c9a7266be9d;p=gem5.git diff --git a/src/mem/cache/tags/base.cc b/src/mem/cache/tags/base.cc index 2ec1379b0..8b52b746e 100644 --- a/src/mem/cache/tags/base.cc +++ b/src/mem/cache/tags/base.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 ARM Limited + * Copyright (c) 2013,2016 ARM Limited * All rights reserved. * * The license below extends only to copyright in the software and shall @@ -46,18 +46,24 @@ * Definitions of BaseTags. */ -#include "config/the_isa.hh" -#include "cpu/smt.hh" //maxThreadsPerCPU #include "mem/cache/tags/base.hh" + +#include "cpu/smt.hh" //maxThreadsPerCPU #include "mem/cache/base.hh" #include "sim/sim_exit.hh" using namespace std; BaseTags::BaseTags(const Params *p) - : ClockedObject(p), blkSize(p->block_size), size(p->size), - hitLatency(p->hit_latency), cache(nullptr), warmupBound(0), - warmedUp(false), numBlocks(0) + : ClockedObject(p), blkSize(p->block_size), blkMask(blkSize - 1), + size(p->size), + lookupLatency(p->tag_latency), + accessLatency(p->sequential_access ? + p->tag_latency + p->data_latency : + std::max(p->tag_latency, p->data_latency)), + cache(nullptr), + warmupBound((p->warmup_percentage/100.0) * (p->size / p->block_size)), + warmedUp(false), numBlocks(p->size / p->block_size) { } @@ -71,7 +77,10 @@ BaseTags::setCache(BaseCache *_cache) void BaseTags::regStats() { + ClockedObject::regStats(); + using namespace Stats; + replacements .init(maxThreadsPerCPU) .name(name() + ".replacements")