gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits > Class Template Reference

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>

Inheritance diagram for gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >:
gem5::minor::Reservable

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.
 
bool empty () const
 No single element or queue entries.
 
const ElemType & front () const
 Return the element, or the front of the queue.
 
ElemType & front ()
 
void pop ()
 Pop either the head, or if none, the head of the queue.
 
void pushTail () const
 Push the single element (if any) into the queue proper.
 
void minorTrace () const
 Report elements.
 
bool canReserve () const
 Reservable interface, passed on to queue.
 
void reserve ()
 Reserve a slot in whatever structure this is attached to.
 
void freeReservation ()
 Free a reserved slot.
 
unsigned int unreservedRemainingSpace ()
 Like remainingSpace but does not count reserved spaces.
 
- Public Member Functions inherited from gem5::minor::Reservable
virtual ~Reservable ()
 

Protected Attributes

Queue< ElemType, ReportTraits, BubbleTraits > queue
 Underlying queue.
 
ElemType * elementPtr
 Pointer to the single element (if not NULL)
 

Detailed Description

template<typename ElemType, typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
class gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >

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 571 of file buffers.hh.

Constructor & Destructor Documentation

◆ InputBuffer()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::InputBuffer ( const std::string & name,
const std::string & data_name,
unsigned int capacity_ )
inline

Definition at line 581 of file buffers.hh.

Member Function Documentation

◆ canReserve()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
bool gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::canReserve ( ) const
inlinevirtual

Reservable interface, passed on to queue.

Implements gem5::minor::Reservable.

Definition at line 647 of file buffers.hh.

References gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::queue.

◆ empty()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
bool gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::empty ( ) const
inline

◆ freeReservation()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::freeReservation ( )
inlinevirtual

Free a reserved slot.

Implements gem5::minor::Reservable.

Definition at line 649 of file buffers.hh.

References gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::queue.

◆ front() [1/2]

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
ElemType & gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::front ( )
inline

◆ front() [2/2]

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
const ElemType & gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::front ( ) const
inline

◆ minorTrace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::minorTrace ( ) const
inline

◆ pop()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::pop ( )
inline

◆ pushTail()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::pushTail ( ) const
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 631 of file buffers.hh.

References gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::elementPtr, and gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::queue.

Referenced by gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::minorTrace(), and gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::unreservedRemainingSpace().

◆ reserve()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::reserve ( )
inlinevirtual

Reserve a slot in whatever structure this is attached to.

Implements gem5::minor::Reservable.

Definition at line 648 of file buffers.hh.

References gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::queue.

◆ setTail()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::setTail ( ElemType & new_element)
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 592 of file buffers.hh.

References gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::elementPtr, and gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::queue.

◆ unreservedRemainingSpace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::unreservedRemainingSpace ( )
inline

Member Data Documentation

◆ elementPtr

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
ElemType* gem5::minor::InputBuffer< ElemType, ReportTraits, BubbleTraits >::elementPtr
mutableprotected

◆ queue


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

Generated on Tue Jun 18 2024 16:24:20 for gem5 by doxygen 1.11.0