gem5
v21.2.1.0
|
Like a Queue but with a restricted interface and a setTail function which, when the queue is empty, just takes a reference to the pushed item as the single element. More...
#include <buffers.hh>
Public Member Functions | |
InputBuffer (const std::string &name, const std::string &data_name, unsigned int capacity_) | |
void | setTail (ElemType &new_element) |
Set the tail of the queue, this is like push but needs to be followed by pushTail for the new tail to make its way into the queue proper. More... | |
bool | empty () const |
No single element or queue entries. More... | |
const ElemType & | front () const |
Return the element, or the front of the queue. More... | |
ElemType & | front () |
void | pop () |
Pop either the head, or if none, the head of the queue. More... | |
void | pushTail () const |
Push the single element (if any) into the queue proper. More... | |
void | minorTrace () const |
Report elements. More... | |
bool | canReserve () const |
Reservable interface, passed on to queue. More... | |
void | reserve () |
Reserve a slot in whatever structure this is attached to. More... | |
void | freeReservation () |
Free a reserved slot. More... | |
unsigned int | unreservedRemainingSpace () |
Like remainingSpace but does not count reserved spaces. More... | |
![]() | |
virtual | ~Reservable () |
Protected Attributes | |
Queue< ElemType, ReportTraits, BubbleTraits > | queue |
Underlying queue. More... | |
ElemType * | elementPtr |
Pointer to the single element (if not NULL) More... | |
Like a Queue but with a restricted interface and a setTail function which, when the queue is empty, just takes a reference to the pushed item as the single element.
Calling pushTail will push that element onto the queue.
The purpose of this class is to allow the faster operation of queues of items which usually don't get deeper than one item and for which the copy associated with a push is expensive enough to want to avoid
The intended use case is the input buffer for pipeline stages, hence the class name
Definition at line 572 of file buffers.hh.
|
inline |
Definition at line 582 of file buffers.hh.
|
inlinevirtual |
Reservable interface, passed on to queue.
Implements gem5::minor::Reservable.
Definition at line 648 of file buffers.hh.
|
inline |
No single element or queue entries.
Definition at line 605 of file buffers.hh.
|
inlinevirtual |
Free a reserved slot.
Implements gem5::minor::Reservable.
Definition at line 650 of file buffers.hh.
|
inline |
Definition at line 611 of file buffers.hh.
|
inline |
Return the element, or the front of the queue.
Definition at line 608 of file buffers.hh.
|
inline |
Report elements.
Definition at line 641 of file buffers.hh.
|
inline |
Pop either the head, or if none, the head of the queue.
Definition at line 616 of file buffers.hh.
|
inline |
Push the single element (if any) into the queue proper.
If the element's reference points to a transient object, remember to always do this before the end of that object's life
Definition at line 632 of file buffers.hh.
Referenced by gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::minorTrace(), and gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::unreservedRemainingSpace().
|
inlinevirtual |
Reserve a slot in whatever structure this is attached to.
Implements gem5::minor::Reservable.
Definition at line 649 of file buffers.hh.
|
inline |
Set the tail of the queue, this is like push but needs to be followed by pushTail for the new tail to make its way into the queue proper.
Definition at line 593 of file buffers.hh.
|
inline |
Like remainingSpace but does not count reserved spaces.
Definition at line 654 of file buffers.hh.
|
mutableprotected |
Pointer to the single element (if not NULL)
Definition at line 579 of file buffers.hh.
Referenced by gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::empty(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::front(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::pop(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::pushTail(), and gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::setTail().
|
mutableprotected |
Underlying queue.
Definition at line 576 of file buffers.hh.
Referenced by gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::canReserve(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::empty(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::freeReservation(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::front(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::minorTrace(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::pop(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::pushTail(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::reserve(), gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::setTail(), and gem5::minor::InputBuffer< gem5::minor::ForwardLineData >::unreservedRemainingSpace().