gem5  v22.1.0.0
Public Member Functions | List of all members
gem5::WriteQueue Class Reference

A write queue for all eviction packets, i.e. More...

#include <write_queue.hh>

Inheritance diagram for gem5::WriteQueue:
gem5::Queue< WriteQueueEntry > gem5::Drainable gem5::Named

Public Member Functions

 WriteQueue (const std::string &_label, int num_entries, int reserve, const std::string &name)
 Create a write queue with a given number of entries. More...
 
WriteQueueEntryallocate (Addr blk_addr, unsigned blk_size, PacketPtr pkt, Tick when_ready, Counter order)
 Allocates a new WriteQueueEntry for the request and size. More...
 
void markInService (WriteQueueEntry *entry)
 Mark the given entry as in service. More...
 
- Public Member Functions inherited from gem5::Queue< WriteQueueEntry >
 Queue (const std::string &_label, int num_entries, int reserve, const std::string &name)
 Create a queue with a given number of entries. More...
 
bool isEmpty () const
 
bool isFull () const
 
int numInService () const
 
WriteQueueEntryfindMatch (Addr blk_addr, bool is_secure, bool ignore_uncacheable=true) const
 Find the first entry that matches the provided address. More...
 
bool trySatisfyFunctional (PacketPtr pkt)
 
WriteQueueEntryfindPending (const QueueEntry *entry) const
 Find any pending requests that overlap the given request of a different queue. More...
 
WriteQueueEntrygetNext () const
 Returns the WriteQueueEntry at the head of the readyList. More...
 
Tick nextReadyTime () const
 
virtual void deallocate (WriteQueueEntry *entry)
 Removes the given entry from the queue. More...
 
DrainState drain () override
 Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are partially executed or are partially in flight. More...
 
- Public Member Functions inherited from gem5::Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 
- Public Member Functions inherited from gem5::Named
 Named (const std::string &name_)
 
virtual ~Named ()=default
 
virtual std::string name () const
 

Additional Inherited Members

- Protected Member Functions inherited from gem5::Queue< WriteQueueEntry >
Entry::Iterator addToReadyList (WriteQueueEntry *entry)
 
- Protected Member Functions inherited from gem5::Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain. More...
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Attributes inherited from gem5::Queue< WriteQueueEntry >
const std::string label
 Local label (for functional print requests) More...
 
const int numEntries
 The total number of entries in this queue. More...
 
const int numReserve
 The number of entries to hold as a temporary overflow space. More...
 
std::vector< WriteQueueEntryentries
 Actual storage. More...
 
Entry::List allocatedList
 Holds pointers to all allocated entries. More...
 
Entry::List readyList
 Holds pointers to entries that haven't been sent downstream. More...
 
Entry::List freeList
 Holds non allocated entries. More...
 
int _numInService
 The number of entries that are in service. More...
 
int allocated
 The number of currently allocated entries. More...
 

Detailed Description

A write queue for all eviction packets, i.e.

writebacks and clean evictions, as well as uncacheable writes.

Definition at line 60 of file write_queue.hh.

Constructor & Destructor Documentation

◆ WriteQueue()

gem5::WriteQueue::WriteQueue ( const std::string &  _label,
int  num_entries,
int  reserve,
const std::string &  name 
)

Create a write queue with a given number of entries.

Parameters
num_entriesThe number of entries in this queue.
reserveThe maximum number of entries needed to satisfy any access.

Definition at line 54 of file write_queue.cc.

Member Function Documentation

◆ allocate()

WriteQueueEntry * gem5::WriteQueue::allocate ( Addr  blk_addr,
unsigned  blk_size,
PacketPtr  pkt,
Tick  when_ready,
Counter  order 
)

Allocates a new WriteQueueEntry for the request and size.

This places the request as the first target in the WriteQueueEntry.

Parameters
blk_addrThe address of the block.
blk_sizeThe number of bytes to request.
pktThe original write.
when_readyWhen is the WriteQueueEntry be ready to act upon.
orderThe logical order of this WriteQueueEntry
Returns
The a pointer to the WriteQueueEntry allocated.
Precondition
There are free entries.

Definition at line 61 of file write_queue.cc.

References gem5::Queue< WriteQueueEntry >::addToReadyList(), gem5::WriteQueueEntry::allocate(), gem5::Queue< WriteQueueEntry >::allocated, gem5::Queue< WriteQueueEntry >::allocatedList, gem5::WriteQueueEntry::allocIter, gem5::Queue< WriteQueueEntry >::freeList, gem5::WriteQueueEntry::getNumTargets(), and gem5::WriteQueueEntry::readyIter.

Referenced by gem5::BaseCache::allocateWriteBuffer().

◆ markInService()

void gem5::WriteQueue::markInService ( WriteQueueEntry entry)

Mark the given entry as in service.

This removes the entry from the readyList or deallocates the entry if it does not expect a response (writeback/eviction rather than an uncacheable write).

Parameters
entryThe entry to mark in service.

Definition at line 78 of file write_queue.cc.

References gem5::Queue< WriteQueueEntry >::deallocate(), and gem5::WriteQueueEntry::popTarget().

Referenced by gem5::BaseCache::markInService().


The documentation for this class was generated from the following files:

Generated on Wed Dec 21 2022 10:23:27 for gem5 by doxygen 1.9.1