base.cc (9795:a31d1a0888a2) base.cc (9796:485399270ca1)
1/*
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

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

768
769 setDrainState(Drainable::Drained);
770 return 0;
771}
772
773BaseCache *
774BaseCacheParams::create()
775{
1/*
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

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

768
769 setDrainState(Drainable::Drained);
770 return 0;
771}
772
773BaseCache *
774BaseCacheParams::create()
775{
776 int numSets = size / (assoc * block_size);
776 unsigned numSets = size / (assoc * block_size);
777
777
778 if (numSets == 1) {
779 FALRU *tags = new FALRU(block_size, size, hit_latency);
780 return new Cache<FALRU>(this, tags);
778 assert(tags);
779
780 if (dynamic_cast<FALRU*>(tags)) {
781 if (numSets != 1)
782 fatal("Got FALRU tags with more than one set\n");
783 return new Cache<FALRU>(this);
784 } else if (dynamic_cast<LRU*>(tags)) {
785 if (numSets == 1)
786 warn("Consider using FALRU tags for a fully associative cache\n");
787 return new Cache<LRU>(this);
781 } else {
788 } else {
782 LRU *tags = new LRU(numSets, block_size, assoc, hit_latency);
783 return new Cache<LRU>(this, tags);
789 fatal("No suitable tags selected\n");
784 }
785}
790 }
791}