gem5  v21.1.0.2
Public Member Functions | Private Attributes | List of all members
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. More...
 
void clearReservedSpace ()
 Clear all allocated space. More...
 
void freeReservation ()
 Clear a single reserved slot. More...
 
void reserve ()
 Reserve space in the queue for future pushes. More...
 
bool canReserve () const
 Can a slot be reserved? More...
 
unsigned int totalSpace () const
 Number of slots available in an empty buffer. More...
 
unsigned int occupiedSpace () const
 Number of slots already occupied in this buffer. More...
 
unsigned int reservedSpace () const
 Number of slots which are reserved. More...
 
unsigned int remainingSpace () const
 Number of slots yet to fill in this buffer. More...
 
unsigned int unreservedRemainingSpace () const
 Like remainingSpace but does not count reserved spaces. More...
 
ElemType & front ()
 Head value. More...
 
const ElemType & front () const
 
void pop ()
 Pop the head item. More...
 
bool empty () const
 Is the queue empty? More...
 
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. More...
 
unsigned int capacity
 Need this here as queues usually don't have a limited capacity. More...
 
std::string dataName
 Name to use for the data in MinorTrace. More...
 

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 404 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 420 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

Can a slot be reserved?

Implements gem5::minor::Reservable.

Definition at line 470 of file buffers.hh.

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

◆ empty()

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

◆ freeReservation()

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

◆ front() [1/2]

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

◆ 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

Definition at line 503 of file buffers.hh.

◆ minorTrace()

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

Definition at line 512 of file buffers.hh.

Referenced by gem5::minor::Fetch1::minorTrace(), and gem5::minor::LSQ::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

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

Referenced by gem5::minor::Fetch1::fetchLine(), gem5::minor::Fetch1::moveFromRequestsToTransfers(), gem5::minor::LSQ::moveFromRequestsToTransfers(), gem5::minor::LSQ::pushFailedRequest(), and gem5::minor::LSQ::pushRequest().

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

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

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

◆ 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

◆ numReservedSlots

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

◆ queue

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
std::deque<ElemType> gem5::minor::Queue< ElemType, ReportTraits, BubbleTraits >::queue
private

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

Generated on Tue Sep 21 2021 12:31:34 for gem5 by doxygen 1.8.17