misc: Delete the now unnecessary create methods.

Most create() methods are no longer necessary. This change deletes them,
and occasionally moves some code from them into the constructors they
call.

Change-Id: Icbab29ba280144b892f9b12fac9e29a0839477e5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36536
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2020-10-23 19:34:07 -07:00
parent 6c454ee53b
commit d05a0a4ea1
337 changed files with 56 additions and 2960 deletions

View File

@@ -2498,9 +2498,3 @@ WriteAllocator::updateMode(Addr write_addr, unsigned write_size,
}
nextAddr = write_addr + write_size;
}
WriteAllocator*
WriteAllocatorParams::create() const
{
return new WriteAllocator(*this);
}

View File

@@ -67,6 +67,8 @@ Cache::Cache(const CacheParams &p)
: BaseCache(p, p.system->cacheLineSize()),
doFastWrites(true)
{
assert(p.tags);
assert(p.replacement_policy);
}
void
@@ -1429,12 +1431,3 @@ Cache::sendMSHRQueuePacket(MSHR* mshr)
return BaseCache::sendMSHRQueuePacket(mshr);
}
Cache*
CacheParams::create() const
{
assert(tags);
assert(replacement_policy);
return new Cache(*this);
}

View File

@@ -72,39 +72,3 @@ Base16Delta8::Base16Delta8(const Params &p)
}
} // namespace Compressor
Compressor::Base64Delta8*
Base64Delta8Params::create() const
{
return new Compressor::Base64Delta8(*this);
}
Compressor::Base64Delta16*
Base64Delta16Params::create() const
{
return new Compressor::Base64Delta16(*this);
}
Compressor::Base64Delta32*
Base64Delta32Params::create() const
{
return new Compressor::Base64Delta32(*this);
}
Compressor::Base32Delta8*
Base32Delta8Params::create() const
{
return new Compressor::Base32Delta8(*this);
}
Compressor::Base32Delta16*
Base32Delta16Params::create() const
{
return new Compressor::Base32Delta16(*this);
}
Compressor::Base16Delta8*
Base16Delta8Params::create() const
{
return new Compressor::Base16Delta8(*this);
}

View File

@@ -50,9 +50,3 @@ CPack::addToDictionary(DictionaryEntry data)
}
} // namespace Compressor
Compressor::CPack*
CPackParams::create() const
{
return new Compressor::CPack(*this);
}

View File

@@ -95,9 +95,3 @@ FPC::instantiateDictionaryCompData() const
}
} // namespace Compressor
Compressor::FPC*
FPCParams::create() const
{
return new Compressor::FPC(*this);
}

View File

@@ -55,9 +55,3 @@ FPCD::addToDictionary(DictionaryEntry data)
}
} // namespace Compressor
Compressor::FPCD*
FPCDParams::create() const
{
return new Compressor::FPCD(*this);
}

View File

@@ -202,9 +202,3 @@ Multi::MultiStats::regStats()
}
} // namespace Compressor
Compressor::Multi*
MultiCompressorParams::create() const
{
return new Compressor::Multi(*this);
}

View File

@@ -73,9 +73,3 @@ Perfect::decompress(const CompressionData* comp_data,
}
} // namespace Compressor
Compressor::Perfect*
PerfectCompressorParams::create() const
{
return new Compressor::Perfect(*this);
}

View File

@@ -78,9 +78,3 @@ RepeatedQwords::compress(const std::vector<Chunk>& chunks,
}
} // namespace Compressor
Compressor::RepeatedQwords*
RepeatedQwordsCompressorParams::create() const
{
return new Compressor::RepeatedQwords(*this);
}

View File

@@ -76,9 +76,3 @@ Zero::compress(const std::vector<Chunk>& chunks, Cycles& comp_lat,
}
} // namespace Compressor
Compressor::Zero*
ZeroCompressorParams::create() const
{
return new Compressor::Zero(*this);
}

View File

@@ -59,6 +59,8 @@
NoncoherentCache::NoncoherentCache(const NoncoherentCacheParams &p)
: BaseCache(p, p.system->cacheLineSize())
{
assert(p.tags);
assert(p.replacement_policy);
}
void
@@ -347,12 +349,3 @@ NoncoherentCache::evictBlock(CacheBlk *blk)
return pkt;
}
NoncoherentCache*
NoncoherentCacheParams::create() const
{
assert(tags);
assert(replacement_policy);
return new NoncoherentCache(*this);
}

View File

@@ -264,15 +264,3 @@ AMPM::calculatePrefetch(const PrefetchInfo &pfi,
}
} // namespace Prefetcher
Prefetcher::AccessMapPatternMatching*
AccessMapPatternMatchingParams::create() const
{
return new Prefetcher::AccessMapPatternMatching(*this);
}
Prefetcher::AMPM*
AMPMPrefetcherParams::create() const
{
return new Prefetcher::AMPM(*this);
}

View File

@@ -261,9 +261,3 @@ BOP::notifyFill(const PacketPtr& pkt)
}
} // namespace Prefetcher
Prefetcher::BOP*
BOPPrefetcherParams::create() const
{
return new Prefetcher::BOP(*this);
}

View File

@@ -158,15 +158,3 @@ DCPT::calculatePrefetch(const PrefetchInfo &pfi,
}
} // namespace Prefetcher
Prefetcher::DeltaCorrelatingPredictionTables*
DeltaCorrelatingPredictionTablesParams::create() const
{
return new Prefetcher::DeltaCorrelatingPredictionTables(*this);
}
Prefetcher::DCPT*
DCPTPrefetcherParams::create() const
{
return new Prefetcher::DCPT(*this);
}

View File

@@ -255,9 +255,3 @@ IndirectMemory::checkAccessMatchOnActiveEntries(Addr addr)
}
} // namespace Prefetcher
Prefetcher::IndirectMemory*
IndirectMemoryPrefetcherParams::create() const
{
return new Prefetcher::IndirectMemory(*this);
}

View File

@@ -209,9 +209,3 @@ IrregularStreamBuffer::addStructuralToPhysicalEntry(
}
} // namespace Prefetcher
Prefetcher::IrregularStreamBuffer*
IrregularStreamBufferPrefetcherParams::create() const
{
return new Prefetcher::IrregularStreamBuffer(*this);
}

View File

@@ -80,9 +80,3 @@ Multi::getPacket()
}
} // namespace Prefetcher
Prefetcher::Multi*
MultiPrefetcherParams::create() const
{
return new Prefetcher::Multi(*this);
}

View File

@@ -244,9 +244,3 @@ PIF::addEventProbeRetiredInsts(SimObject *obj, const char *name)
}
} // namespace Prefetcher
Prefetcher::PIF*
PIFPrefetcherParams::create() const
{
return new Prefetcher::PIF(*this);
}

View File

@@ -133,9 +133,3 @@ SBOOE::calculatePrefetch(const PrefetchInfo &pfi,
}
} // namespace Prefetcher
Prefetcher::SBOOE*
SBOOEPrefetcherParams::create() const
{
return new Prefetcher::SBOOE(*this);
}

View File

@@ -317,9 +317,3 @@ SignaturePath::auxiliaryPrefetcher(Addr ppn, stride_t current_block,
}
} // namespace Prefetcher
Prefetcher::SignaturePath*
SignaturePathPrefetcherParams::create() const
{
return new Prefetcher::SignaturePath(*this);
}

View File

@@ -129,9 +129,3 @@ SignaturePathV2::handlePageCrossingLookahead(signature_t signature,
}
} // namespace Prefetcher
Prefetcher::SignaturePathV2*
SignaturePathPrefetcherV2Params::create() const
{
return new Prefetcher::SignaturePathV2(*this);
}

View File

@@ -48,9 +48,3 @@ SlimAMPM::calculatePrefetch(const PrefetchInfo &pfi,
}
} // namespace Prefetcher
Prefetcher::SlimAMPM*
SlimAMPMPrefetcherParams::create() const
{
return new Prefetcher::SlimAMPM(*this);
}

View File

@@ -247,9 +247,3 @@ STeMS::reconstructSequence(
}
} // namespace Prefetcher
Prefetcher::STeMS*
STeMSPrefetcherParams::create() const
{
return new Prefetcher::STeMS(*this);
}

View File

@@ -202,15 +202,3 @@ StridePrefetcherHashedSetAssociative::extractTag(const Addr addr) const
}
} // namespace Prefetcher
Prefetcher::StridePrefetcherHashedSetAssociative*
StridePrefetcherHashedSetAssociativeParams::create() const
{
return new Prefetcher::StridePrefetcherHashedSetAssociative(*this);
}
Prefetcher::Stride*
StridePrefetcherParams::create() const
{
return new Prefetcher::Stride(*this);
}

View File

@@ -56,9 +56,3 @@ Tagged::calculatePrefetch(const PrefetchInfo &pfi,
}
} // namespace Prefetcher
Prefetcher::Tagged*
TaggedPrefetcherParams::create() const
{
return new Prefetcher::Tagged(*this);
}

View File

@@ -57,9 +57,3 @@ BIP::reset(const std::shared_ptr<ReplacementData>& replacement_data) const
}
} // namespace ReplacementPolicy
ReplacementPolicy::BIP*
BIPRPParams::create() const
{
return new ReplacementPolicy::BIP(*this);
}

View File

@@ -145,9 +145,3 @@ BRRIP::instantiateEntry()
}
} // namespace ReplacementPolicy
ReplacementPolicy::BRRIP*
BRRIPRPParams::create() const
{
return new ReplacementPolicy::BRRIP(*this);
}

View File

@@ -92,9 +92,3 @@ FIFO::instantiateEntry()
}
} // namespace ReplacementPolicy
ReplacementPolicy::FIFO*
FIFORPParams::create() const
{
return new ReplacementPolicy::FIFO(*this);
}

View File

@@ -90,9 +90,3 @@ LFU::instantiateEntry()
}
} // namespace ReplacementPolicy
ReplacementPolicy::LFU*
LFURPParams::create() const
{
return new ReplacementPolicy::LFU(*this);
}

View File

@@ -94,9 +94,3 @@ LRU::instantiateEntry()
}
} // namespace ReplacementPolicy
ReplacementPolicy::LRU*
LRURPParams::create() const
{
return new ReplacementPolicy::LRU(*this);
}

View File

@@ -99,9 +99,3 @@ MRU::instantiateEntry()
}
} // namespace ReplacementPolicy
ReplacementPolicy::MRU*
MRURPParams::create() const
{
return new ReplacementPolicy::MRU(*this);
}

View File

@@ -93,9 +93,3 @@ Random::instantiateEntry()
}
} // namespace ReplacementPolicy
ReplacementPolicy::Random*
RandomRPParams::create() const
{
return new ReplacementPolicy::Random(*this);
}

View File

@@ -134,9 +134,3 @@ SecondChance::instantiateEntry()
}
} // namespace ReplacementPolicy
ReplacementPolicy::SecondChance*
SecondChanceRPParams::create() const
{
return new ReplacementPolicy::SecondChance(*this);
}

View File

@@ -212,9 +212,3 @@ TreePLRU::instantiateEntry()
}
} // namespace ReplacementPolicy
ReplacementPolicy::TreePLRU*
TreePLRURPParams::create() const
{
return new ReplacementPolicy::TreePLRU(*this);
}

View File

@@ -122,9 +122,3 @@ WeightedLRU::invalidate(const std::shared_ptr<ReplacementData>&
}
} // namespace ReplacementPolicy
ReplacementPolicy::WeightedLRU*
WeightedLRURPParams::create() const
{
return new ReplacementPolicy::WeightedLRU(*this);
}

View File

@@ -54,6 +54,9 @@ BaseSetAssoc::BaseSetAssoc(const Params &p)
sequentialAccess(p.sequential_access),
replacementPolicy(p.replacement_policy)
{
// There must be a indexing policy
fatal_if(!p.indexing_policy, "An indexing policy is required");
// Check parameters
if (blkSize < 4 || !isPowerOf2(blkSize)) {
fatal("Block size must be at least 4 and a power of 2");
@@ -90,12 +93,3 @@ BaseSetAssoc::invalidate(CacheBlk *blk)
// Invalidate replacement data
replacementPolicy->invalidate(blk->replacementData);
}
BaseSetAssoc *
BaseSetAssocParams::create() const
{
// There must be a indexing policy
fatal_if(!indexing_policy, "An indexing policy is required");
return new BaseSetAssoc(*this);
}

View File

@@ -204,9 +204,3 @@ CompressedTags::anyBlk(std::function<bool(CacheBlk &)> visitor)
}
return false;
}
CompressedTags *
CompressedTagsParams::create() const
{
return new CompressedTags(*this);
}

View File

@@ -279,12 +279,6 @@ FALRU::moveToTail(FALRUBlk *blk)
}
}
FALRU *
FALRUParams::create() const
{
return new FALRU(*this);
}
void
FALRU::CacheTracking::check(const FALRUBlk *head, const FALRUBlk *tail) const
{

View File

@@ -71,9 +71,3 @@ SetAssociative::getPossibleEntries(const Addr addr) const
{
return sets[extractSet(addr)];
}
SetAssociative*
SetAssociativeParams::create() const
{
return new SetAssociative(*this);
}

View File

@@ -216,9 +216,3 @@ SkewedAssociative::getPossibleEntries(const Addr addr) const
return entries;
}
SkewedAssociative *
SkewedAssociativeParams::create() const
{
return new SkewedAssociative(*this);
}

View File

@@ -54,6 +54,9 @@ SectorTags::SectorTags(const SectorTagsParams &p)
sectorShift(floorLog2(blkSize)), sectorMask(numBlocksPerSector - 1),
sectorStats(stats, *this)
{
// There must be a indexing policy
fatal_if(!p.indexing_policy, "An indexing policy is required");
// Check parameters
fatal_if(blkSize < 4 || !isPowerOf2(blkSize),
"Block size must be at least 4 and a power of 2");
@@ -323,12 +326,3 @@ SectorTags::anyBlk(std::function<bool(CacheBlk &)> visitor)
}
return false;
}
SectorTags *
SectorTagsParams::create() const
{
// There must be a indexing policy
fatal_if(!indexing_policy, "An indexing policy is required");
return new SectorTags(*this);
}