45#ifndef __MEM_CACHE_QUEUE_HH__
46#define __MEM_CACHE_QUEUE_HH__
56#include "debug/Drain.hh"
72 static_assert(std::is_base_of_v<QueueEntry, Entry>,
73 "Entry must be derived from QueueEntry");
107 readyList.back()->readyTime <= entry->readyTime) {
112 if ((*i)->readyTime > entry->readyTime) {
116 panic(
"Failed to add to ready list.");
133 Queue(
const std::string &_label,
int num_entries,
int reserve,
134 const std::string &
name) :
169 bool ignore_uncacheable =
true)
const
178 if (!(ignore_uncacheable && entry->isUncacheable()) &&
179 entry->matchBlockAddr(blk_addr, is_secure)) {
190 if (entry->matchBlockAddr(pkt) &&
191 entry->trySatisfyFunctional(pkt)) {
209 for (
const auto& ready_entry :
readyList) {
210 if (ready_entry->conflictAddr(entry)) {
246 if (entry->inService) {
256 DPRINTF(Drain,
"Queue now empty, signalling drained\n");
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Interface for objects that might require draining before checkpointing.
Interface for things with names.
virtual std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void pushLabel(const std::string &lbl)
Push label for PrintReq (safe to call unconditionally).
void popLabel()
Pop label for PrintReq (safe to call unconditionally).
A queue entry base class, to be used by both the MSHRs and write-queue entries.
A high-level queue interface, to be used by both the MSHR queue and the write buffer.
Entry * findMatch(Addr blk_addr, bool is_secure, bool ignore_uncacheable=true) const
Find the first entry that matches the provided address.
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
Entry * findPending(const QueueEntry *entry) const
Find any pending requests that overlap the given request of a different queue.
Queue(const std::string &_label, int num_entries, int reserve, const std::string &name)
Create a queue with a given number of entries.
Entry::List readyList
Holds pointers to entries that haven't been sent downstream.
virtual void deallocate(Entry *entry)
Removes the given entry from the queue.
Entry::List freeList
Holds non allocated entries.
std::vector< Entry > entries
Actual storage.
bool trySatisfyFunctional(PacketPtr pkt)
const std::string label
Local label (for functional print requests)
const int numReserve
The number of entries to hold as a temporary overflow space.
Tick nextReadyTime() const
Entry::List allocatedList
Holds pointers to all allocated entries.
Entry::Iterator addToReadyList(Entry *entry)
int allocated
The number of currently allocated entries.
int _numInService
The number of entries that are in service.
Entry * getNext() const
Returns the WriteQueueEntry at the head of the readyList.
const int numEntries
The total number of entries in this queue.
void signalDrainDone() const
Signal that an object is drained.
DrainState drainState() const
Return the current drain state of an object.
DrainState
Object drain/handover states.
@ Draining
Draining buffers pending serialization/handover.
@ Drained
Buffers drained, ready for serialization/handover.
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
Declaration of the Packet class.