gem5 v24.0.0.0
|
Wrapper for a queue type to act as a pipeline stage input queue. More...
#include <buffers.hh>
Public Member Functions | |
Queue (const std::string &name, const std::string &data_name, unsigned int capacity_) | |
void | push (ElemType &data) |
Push an element into the buffer if it isn't a bubble. | |
void | clearReservedSpace () |
Clear all allocated space. | |
void | freeReservation () |
Clear a single reserved slot. | |
void | reserve () |
Reserve space in the queue for future pushes. | |
bool | canReserve () const |
Can a slot be reserved? | |
unsigned int | totalSpace () const |
Number of slots available in an empty buffer. | |
unsigned int | occupiedSpace () const |
Number of slots already occupied in this buffer. | |
unsigned int | reservedSpace () const |
Number of slots which are reserved. | |
unsigned int | remainingSpace () const |
Number of slots yet to fill in this buffer. | |
unsigned int | unreservedRemainingSpace () const |
Like remainingSpace but does not count reserved spaces. | |
ElemType & | front () |
Head value. | |
const ElemType & | front () const |
void | pop () |
Pop the head item. | |
bool | empty () const |
Is the queue empty? | |
void | minorTrace () const |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Public Member Functions inherited from gem5::minor::Reservable | |
virtual | ~Reservable () |
Private Attributes | |
std::deque< ElemType > | queue |
unsigned int | numReservedSlots |
Number of slots currently reserved for future (reservation respecting) pushes. | |
unsigned int | capacity |
Need this here as queues usually don't have a limited capacity. | |
std::string | dataName |
Name to use for the data in MinorTrace. | |
Wrapper for a queue type to act as a pipeline stage input queue.
Handles capacity management, bubble value suppression and provides reporting.
In an ideal world, ElemType would be derived from ReportIF and BubbleIF, but here we use traits and allow the Adaptors ReportTraitsAdaptor and BubbleTraitsAdaptor to work on data which does directly implement those interfaces.
Definition at line 403 of file buffers.hh.
|
inline |
Definition at line 419 of file buffers.hh.
|
inlinevirtual |
Can a slot be reserved?
Implements gem5::minor::Reservable.
Definition at line 469 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::unreservedRemainingSpace().
|
inline |
Clear all allocated space.
Be careful how this is used
Definition at line 447 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::numReservedSlots.
|
inline |
Is the queue empty?
Definition at line 508 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::queue.
Referenced by gem5::minor::Fetch1::evaluate(), gem5::minor::LSQ::findResponse(), gem5::minor::LSQ::isDrained(), gem5::minor::Fetch1::moveFromRequestsToTransfers(), gem5::minor::LSQ::moveFromRequestsToTransfers(), gem5::minor::LSQ::needsToTick(), gem5::minor::Fetch1::popAndDiscard(), gem5::minor::LSQ::popResponse(), gem5::minor::Fetch1::recvReqRetry(), gem5::minor::LSQ::step(), gem5::minor::Fetch1::stepQueues(), gem5::minor::Fetch1::tryToSendToTransfers(), and gem5::minor::LSQ::tryToSendToTransfers().
|
inlinevirtual |
Clear a single reserved slot.
Implements gem5::minor::Reservable.
Definition at line 450 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::numReservedSlots.
Referenced by gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::push().
|
inline |
Head value.
Like std::queue::front
Definition at line 500 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::queue.
Referenced by gem5::minor::Fetch1::evaluate(), gem5::minor::LSQ::findResponse(), gem5::minor::Fetch1::moveFromRequestsToTransfers(), gem5::minor::LSQ::moveFromRequestsToTransfers(), gem5::minor::LSQ::needsToTick(), gem5::minor::Fetch1::popAndDiscard(), gem5::minor::LSQ::popResponse(), gem5::minor::Fetch1::recvReqRetry(), gem5::minor::LSQ::step(), gem5::minor::Fetch1::stepQueues(), gem5::minor::Fetch1::tryToSendToTransfers(), and gem5::minor::LSQ::tryToSendToTransfers().
|
inline |
Definition at line 502 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::queue.
|
inline |
Definition at line 511 of file buffers.hh.
References data, gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::dataName, gem5::minor::minorTrace(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::occupiedSpace(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::queue, gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::reservedSpace(), and gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::totalSpace().
Referenced by gem5::minor::Fetch1::minorTrace(), and gem5::minor::LSQ::minorTrace().
|
inline |
Number of slots already occupied in this buffer.
Definition at line 475 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::queue.
Referenced by gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::minorTrace(), and gem5::minor::Fetch1::numInFlightFetches().
|
inline |
Pop the head item.
Like std::queue::pop
Definition at line 505 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::queue.
Referenced by gem5::minor::Fetch1::moveFromRequestsToTransfers(), gem5::minor::LSQ::moveFromRequestsToTransfers(), gem5::minor::Fetch1::popAndDiscard(), and gem5::minor::LSQ::popResponse().
|
inline |
Push an element into the buffer if it isn't a bubble.
Bubbles are just discarded. It is assummed that any push into a queue with reserved space intends to take that space
Definition at line 432 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::capacity, data, gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::freeReservation(), gem5::Named::name(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::queue, and warn.
Referenced by gem5::minor::Fetch1::fetchLine(), gem5::minor::Fetch1::moveFromRequestsToTransfers(), gem5::minor::LSQ::moveFromRequestsToTransfers(), gem5::minor::LSQ::pushFailedRequest(), and gem5::minor::LSQ::pushRequest().
|
inline |
Number of slots yet to fill in this buffer.
This doesn't include reservation.
Definition at line 483 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::capacity, and gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::queue.
|
inlinevirtual |
Reserve space in the queue for future pushes.
Enquiries about space in the queue using unreservedRemainingSpace will only tell about space which is not full and not reserved.
Implements gem5::minor::Reservable.
Definition at line 460 of file buffers.hh.
References gem5::Named::name(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::numReservedSlots, gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::unreservedRemainingSpace(), and warn.
Referenced by gem5::minor::Fetch1::fetchLine().
|
inline |
Number of slots which are reserved.
Definition at line 478 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::numReservedSlots.
Referenced by gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::minorTrace().
|
inline |
Number of slots available in an empty buffer.
Definition at line 472 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::capacity.
Referenced by gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::minorTrace().
|
inline |
Like remainingSpace but does not count reserved spaces.
Definition at line 492 of file buffers.hh.
References gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::capacity, gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::numReservedSlots, and gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::queue.
Referenced by gem5::minor::LSQ::canRequest(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::canReserve(), gem5::minor::LSQ::moveFromRequestsToTransfers(), gem5::minor::LSQ::needsToTick(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::reserve(), and gem5::minor::LSQ::tryToSendToTransfers().
|
private |
Need this here as queues usually don't have a limited capacity.
Definition at line 413 of file buffers.hh.
Referenced by gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::push(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::remainingSpace(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::totalSpace(), and gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::unreservedRemainingSpace().
|
private |
Name to use for the data in MinorTrace.
Definition at line 416 of file buffers.hh.
Referenced by gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::minorTrace().
|
private |
Number of slots currently reserved for future (reservation respecting) pushes.
Definition at line 410 of file buffers.hh.
Referenced by gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::clearReservedSpace(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::freeReservation(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::reserve(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::reservedSpace(), and gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::unreservedRemainingSpace().
|
private |
Definition at line 406 of file buffers.hh.
Referenced by gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::empty(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::front(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::front(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::minorTrace(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::occupiedSpace(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::pop(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::push(), gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::remainingSpace(), and gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::unreservedRemainingSpace().