base.cc (10714:9ba5e70964a4) base.cc (10815:169af9a2779f)
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

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

778
779 setDrainState(Drainable::Drained);
780 return 0;
781}
782
783BaseCache *
784BaseCacheParams::create()
785{
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

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

778
779 setDrainState(Drainable::Drained);
780 return 0;
781}
782
783BaseCache *
784BaseCacheParams::create()
785{
786 unsigned numSets = size / (assoc * system->cacheLineSize());
787
788 assert(tags);
789
786 assert(tags);
787
790 if (dynamic_cast<FALRU*>(tags)) {
791 if (numSets != 1)
792 fatal("Got FALRU tags with more than one set\n");
793 return new Cache<FALRU>(this);
794 } else if (dynamic_cast<LRU*>(tags)) {
795 if (numSets == 1)
796 warn("Consider using FALRU tags for a fully associative cache\n");
797 return new Cache<LRU>(this);
798 } else if (dynamic_cast<RandomRepl*>(tags)) {
799 return new Cache<RandomRepl>(this);
800 } else {
801 fatal("No suitable tags selected\n");
802 }
788 return new Cache(this);
803}
789}