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

Wrapper for a queue type to act as a pipeline stage input queue. More...

#include <buffers.hh>

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

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.
 

Detailed Description

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

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.

Constructor & Destructor Documentation

◆ Queue()

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

Definition at line 419 of file buffers.hh.

Member Function Documentation

◆ canReserve()

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

◆ clearReservedSpace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::clearReservedSpace ( )
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.

◆ empty()

◆ freeReservation()

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

◆ front() [1/2]

◆ front() [2/2]

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

◆ minorTrace()

◆ occupiedSpace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::occupiedSpace ( ) const
inline

◆ pop()

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

◆ push()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::push ( ElemType & data)
inline

◆ remainingSpace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::remainingSpace ( ) const
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.

◆ reserve()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::reserve ( )
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().

◆ reservedSpace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::reservedSpace ( ) const
inline

◆ totalSpace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::totalSpace ( ) const
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().

◆ unreservedRemainingSpace()

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

Member Data Documentation

◆ capacity

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::capacity
private

◆ dataName

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
std::string gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::dataName
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().

◆ numReservedSlots

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::numReservedSlots
private

◆ 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