#ifndef __MEM_CACHE_BLK_HH__
#define __MEM_CACHE_BLK_HH__
+#include <cassert>
+#include <cstdint>
+#include <iosfwd>
#include <list>
+#include <string>
#include "base/printable.hh"
+#include "base/types.hh"
#include "mem/cache/replacement_policies/base.hh"
#include "mem/packet.hh"
#include "mem/request.hh"
#include "mem/cache/mshr.hh"
-#include <algorithm>
#include <cassert>
#include <string>
-#include <vector>
#include "base/logging.hh"
+#include "base/trace.hh"
#include "base/types.hh"
#include "debug/Cache.hh"
-#include "mem/cache/cache.hh"
+#include "mem/cache/base.hh"
+#include "mem/request.hh"
#include "sim/core.hh"
MSHR::MSHR() : downstreamPending(false),
#ifndef __MEM_CACHE_MSHR_HH__
#define __MEM_CACHE_MSHR_HH__
+#include <cassert>
+#include <iosfwd>
#include <list>
+#include <string>
#include "base/printable.hh"
+#include "base/types.hh"
#include "mem/cache/queue_entry.hh"
+#include "mem/packet.hh"
+#include "sim/core.hh"
class BaseCache;
#include "mem/cache/mshr_queue.hh"
+#include <cassert>
+
+#include "mem/cache/mshr.hh"
+
MSHRQueue::MSHRQueue(const std::string &_label,
int num_entries, int reserve, int demand_reserve)
: Queue<MSHR>(_label, num_entries, reserve),
#ifndef __MEM_CACHE_MSHR_QUEUE_HH__
#define __MEM_CACHE_MSHR_QUEUE_HH__
-#include <vector>
+#include <string>
+#include "base/types.hh"
#include "mem/cache/mshr.hh"
#include "mem/cache/queue.hh"
+#include "mem/packet.hh"
/**
* A Class for maintaining a list of pending and allocated memory requests.
#include "mem/cache/prefetch/base.hh"
-#include <list>
+#include <cassert>
#include "base/intmath.hh"
#include "mem/cache/base.hh"
+#include "params/BasePrefetcher.hh"
#include "sim/system.hh"
BasePrefetcher::BasePrefetcher(const BasePrefetcherParams *p)
#ifndef __MEM_CACHE_PREFETCH_BASE_HH__
#define __MEM_CACHE_PREFETCH_BASE_HH__
+#include <cstdint>
+
#include "base/statistics.hh"
+#include "base/types.hh"
#include "mem/packet.hh"
-#include "params/BasePrefetcher.hh"
+#include "mem/request.hh"
#include "sim/clocked_object.hh"
class BaseCache;
+struct BasePrefetcherParams;
+class System;
class BasePrefetcher : public ClockedObject
{
#include "mem/cache/prefetch/queued.hh"
+#include <cassert>
+
+#include "base/logging.hh"
+#include "base/trace.hh"
#include "debug/HWPrefetch.hh"
-#include "mem/cache/base.hh"
+#include "mem/request.hh"
+#include "params/QueuedPrefetcher.hh"
QueuedPrefetcher::QueuedPrefetcher(const QueuedPrefetcherParams *p)
: BasePrefetcher(p), queueSize(p->queue_size), latency(p->latency),
#ifndef __MEM_CACHE_PREFETCH_QUEUED_HH__
#define __MEM_CACHE_PREFETCH_QUEUED_HH__
+#include <cstdint>
#include <list>
+#include <utility>
+#include "base/statistics.hh"
+#include "base/types.hh"
#include "mem/cache/prefetch/base.hh"
-#include "params/QueuedPrefetcher.hh"
+#include "mem/packet.hh"
+
+struct QueuedPrefetcherParams;
class QueuedPrefetcher : public BasePrefetcher
{
#include "mem/cache/prefetch/stride.hh"
+#include <cassert>
+
+#include "base/intmath.hh"
+#include "base/logging.hh"
#include "base/random.hh"
#include "base/trace.hh"
#include "debug/HWPrefetch.hh"
+#include "params/StridePrefetcher.hh"
StridePrefetcher::StridePrefetcher(const StridePrefetcherParams *p)
: QueuedPrefetcher(p),
#ifndef __MEM_CACHE_PREFETCH_STRIDE_HH__
#define __MEM_CACHE_PREFETCH_STRIDE_HH__
+#include <string>
#include <unordered_map>
+#include "base/types.hh"
#include "mem/cache/prefetch/queued.hh"
-#include "params/StridePrefetcher.hh"
+#include "mem/packet.hh"
+
+struct StridePrefetcherParams;
class StridePrefetcher : public QueuedPrefetcher
{
#include "mem/cache/prefetch/tagged.hh"
+#include "params/TaggedPrefetcher.hh"
+
TaggedPrefetcher::TaggedPrefetcher(const TaggedPrefetcherParams *p)
: QueuedPrefetcher(p), degree(p->degree)
{
#define __MEM_CACHE_PREFETCH_TAGGED_HH__
#include "mem/cache/prefetch/queued.hh"
-#include "params/TaggedPrefetcher.hh"
+#include "mem/packet.hh"
+struct TaggedPrefetcherParams;
class TaggedPrefetcher : public QueuedPrefetcher
{
#define __MEM_CACHE_QUEUE_HH__
#include <cassert>
+#include <string>
#include "base/trace.hh"
+#include "base/types.hh"
#include "debug/Drain.hh"
#include "mem/cache/queue_entry.hh"
+#include "mem/packet.hh"
+#include "sim/core.hh"
#include "sim/drain.hh"
/**
#ifndef __MEM_CACHE_QUEUE_ENTRY_HH__
#define __MEM_CACHE_QUEUE_ENTRY_HH__
+#include "base/types.hh"
#include "mem/packet.hh"
class BaseCache;
#include <memory>
#include "base/random.hh"
+#include "params/BIPRP.hh"
BIPRP::BIPRP(const Params *p)
: LRURP(p), btp(p->btp)
#define __MEM_CACHE_REPLACEMENT_POLICIES_BIP_RP_HH__
#include "mem/cache/replacement_policies/lru_rp.hh"
-#include "params/BIPRP.hh"
+
+struct BIPRPParams;
class BIPRP : public LRURP
{
#include "mem/cache/replacement_policies/brrip_rp.hh"
+#include <cassert>
#include <memory>
#include "base/logging.hh" // For fatal_if
#include "base/random.hh"
+#include "params/BRRIPRP.hh"
BRRIPRP::BRRIPRP(const Params *p)
: BaseReplacementPolicy(p),
#define __MEM_CACHE_REPLACEMENT_POLICIES_BRRIP_RP_HH__
#include "mem/cache/replacement_policies/base.hh"
-#include "params/BRRIPRP.hh"
+
+struct BRRIPRPParams;
class BRRIPRP : public BaseReplacementPolicy
{
#include "mem/cache/replacement_policies/fifo_rp.hh"
+#include <cassert>
#include <memory>
+#include "params/FIFORP.hh"
+
FIFORP::FIFORP(const Params *p)
: BaseReplacementPolicy(p)
{
#ifndef __MEM_CACHE_REPLACEMENT_POLICIES_FIFO_RP_HH__
#define __MEM_CACHE_REPLACEMENT_POLICIES_FIFO_RP_HH__
+#include "base/types.hh"
#include "mem/cache/replacement_policies/base.hh"
-#include "params/FIFORP.hh"
+
+struct FIFORPParams;
class FIFORP : public BaseReplacementPolicy
{
#include "mem/cache/replacement_policies/lfu_rp.hh"
+#include <cassert>
#include <memory>
+#include "params/LFURP.hh"
+
LFURP::LFURP(const Params *p)
: BaseReplacementPolicy(p)
{
#define __MEM_CACHE_REPLACEMENT_POLICIES_LFU_RP_HH__
#include "mem/cache/replacement_policies/base.hh"
-#include "params/LFURP.hh"
+
+struct LFURPParams;
class LFURP : public BaseReplacementPolicy
{
#include "mem/cache/replacement_policies/lru_rp.hh"
+#include <cassert>
#include <memory>
+#include "params/LRURP.hh"
+
LRURP::LRURP(const Params *p)
: BaseReplacementPolicy(p)
{
#define __MEM_CACHE_REPLACEMENT_POLICIES_LRU_RP_HH__
#include "mem/cache/replacement_policies/base.hh"
-#include "params/LRURP.hh"
+
+struct LRURPParams;
class LRURP : public BaseReplacementPolicy
{
#include "mem/cache/replacement_policies/mru_rp.hh"
+#include <cassert>
#include <memory>
+#include "params/MRURP.hh"
+
MRURP::MRURP(const Params *p)
: BaseReplacementPolicy(p)
{
#ifndef __MEM_CACHE_REPLACEMENT_POLICIES_MRU_RP_HH__
#define __MEM_CACHE_REPLACEMENT_POLICIES_MRU_RP_HH__
+#include "base/types.hh"
#include "mem/cache/replacement_policies/base.hh"
-#include "params/MRURP.hh"
+
+struct MRURPParams;
class MRURP : public BaseReplacementPolicy
{
#include "mem/cache/replacement_policies/random_rp.hh"
+#include <cassert>
+#include <memory>
+
#include "base/random.hh"
-#include "mem/cache/blk.hh"
+#include "params/RandomRP.hh"
RandomRP::RandomRP(const Params *p)
: BaseReplacementPolicy(p)
#define __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
#include "mem/cache/replacement_policies/base.hh"
-#include "params/RandomRP.hh"
+
+struct RandomRPParams;
class RandomRP : public BaseReplacementPolicy
{
#include "mem/cache/replacement_policies/second_chance_rp.hh"
+#include <cassert>
+
+#include "params/SecondChanceRP.hh"
+
SecondChanceRP::SecondChanceRP(const Params *p)
: FIFORP(p)
{
#ifndef __MEM_CACHE_REPLACEMENT_POLICIES_SECOND_CHANCE_RP_HH__
#define __MEM_CACHE_REPLACEMENT_POLICIES_SECOND_CHANCE_RP_HH__
+#include "mem/cache/replacement_policies/base.hh"
#include "mem/cache/replacement_policies/fifo_rp.hh"
-#include "params/SecondChanceRP.hh"
+
+struct SecondChanceRPParams;
class SecondChanceRP : public FIFORP
{
#include "mem/cache/tags/base.hh"
+#include <cassert>
+
+#include "base/types.hh"
#include "mem/cache/base.hh"
+#include "mem/packet.hh"
+#include "mem/request.hh"
+#include "sim/core.hh"
#include "sim/sim_exit.hh"
+#include "sim/system.hh"
BaseTags::BaseTags(const Params *p)
: ClockedObject(p), blkSize(p->block_size), blkMask(blkSize - 1),
#ifndef __MEM_CACHE_TAGS_BASE_HH__
#define __MEM_CACHE_TAGS_BASE_HH__
+#include <cassert>
#include <string>
#include "base/callback.hh"
+#include "base/logging.hh"
#include "base/statistics.hh"
+#include "base/types.hh"
#include "mem/cache/blk.hh"
-#include "mem/cache/replacement_policies/base.hh"
+#include "mem/packet.hh"
#include "params/BaseTags.hh"
#include "sim/clocked_object.hh"
#include "mem/cache/tags/base_set_assoc.hh"
+#include <cassert>
#include <string>
#include "base/intmath.hh"
+#include "mem/request.hh"
BaseSetAssoc::BaseSetAssoc(const Params *p)
:BaseTags(p), assoc(p->assoc), allocAssoc(p->assoc),
#ifndef __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
#define __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
-#include <cassert>
-#include <cstring>
+#include <string>
#include <vector>
+#include "base/logging.hh"
+#include "base/types.hh"
#include "debug/CacheRepl.hh"
#include "mem/cache/base.hh"
#include "mem/cache/blk.hh"
#define __MEM_CACHE_TAGS_CACHESET_HH__
#include <cassert>
+#include <vector>
+
+#include "base/types.hh"
/**
* An associative set of cache blocks.
#include "base/intmath.hh"
#include "base/logging.hh"
+#include "mem/cache/base.hh"
FALRU::FALRU(const Params *p)
: BaseTags(p),
#ifndef __MEM_CACHE_TAGS_FA_LRU_HH__
#define __MEM_CACHE_TAGS_FA_LRU_HH__
-#include <list>
+#include <cstdint>
+#include <string>
#include <unordered_map>
+#include "base/bitfield.hh"
#include "base/intmath.hh"
-#include "mem/cache/base.hh"
+#include "base/logging.hh"
+#include "base/statistics.hh"
+#include "base/types.hh"
#include "mem/cache/blk.hh"
#include "mem/cache/tags/base.hh"
#include "mem/packet.hh"
#include "mem/cache/write_queue.hh"
+#include <cassert>
+
+#include "mem/cache/write_queue_entry.hh"
+
WriteQueue::WriteQueue(const std::string &_label,
int num_entries, int reserve)
: Queue<WriteQueueEntry>(_label, num_entries, reserve)
#ifndef __MEM_CACHE_WRITE_QUEUE_HH__
#define __MEM_CACHE_WRITE_QUEUE_HH__
-#include <vector>
+#include <string>
+#include "base/types.hh"
#include "mem/cache/queue.hh"
#include "mem/cache/write_queue_entry.hh"
+#include "mem/packet.hh"
/**
* A write queue for all eviction packets, i.e. writebacks and clean
#include "mem/cache/write_queue_entry.hh"
-#include <algorithm>
#include <cassert>
#include <string>
-#include <vector>
#include "base/logging.hh"
#include "base/types.hh"
-#include "debug/Cache.hh"
-#include "mem/cache/cache.hh"
-#include "sim/core.hh"
+#include "mem/cache/base.hh"
+#include "mem/request.hh"
inline void
WriteQueueEntry::TargetList::add(PacketPtr pkt, Tick readyTime,
#ifndef __MEM_CACHE_WRITE_QUEUE_ENTRY_HH__
#define __MEM_CACHE_WRITE_QUEUE_ENTRY_HH__
+#include <cassert>
+#include <iosfwd>
#include <list>
+#include <string>
#include "base/printable.hh"
+#include "base/types.hh"
#include "mem/cache/queue_entry.hh"
+#include "mem/packet.hh"
+#include "sim/core.hh"
class BaseCache;