gem5  v20.1.0.0
Public Member Functions | Private Attributes | List of all members
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 Minor::Queue< ElemType, ReportTraits, BubbleTraits >:
Named 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 Named
 Named (const std::string &name_)
 
const std::string & name () const
 
- Public Member Functions inherited from 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...
 

Additional Inherited Members

- Protected Attributes inherited from Named
const std::string _name
 

Detailed Description

template<typename ElemType, typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
class 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 397 of file buffers.hh.

Constructor & Destructor Documentation

◆ Queue()

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

Definition at line 413 of file buffers.hh.

Member Function Documentation

◆ canReserve()

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

Can a slot be reserved?

Implements Minor::Reservable.

Definition at line 463 of file buffers.hh.

◆ clearReservedSpace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void Minor::Queue< ElemType, ReportTraits, BubbleTraits >::clearReservedSpace ( )
inline

Clear all allocated space.

Be careful how this is used

Definition at line 441 of file buffers.hh.

◆ empty()

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

◆ freeReservation()

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

◆ front() [1/2]

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

◆ front() [2/2]

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

Definition at line 496 of file buffers.hh.

◆ minorTrace()

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

Definition at line 505 of file buffers.hh.

Referenced by Minor::Fetch1::minorTrace(), and Minor::LSQ::minorTrace().

◆ occupiedSpace()

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

◆ pop()

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

◆ push()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void 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 426 of file buffers.hh.

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

◆ remainingSpace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int 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 477 of file buffers.hh.

◆ reserve()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void 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 Minor::Reservable.

Definition at line 454 of file buffers.hh.

Referenced by Minor::Fetch1::fetchLine().

◆ reservedSpace()

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

◆ totalSpace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int Minor::Queue< ElemType, ReportTraits, BubbleTraits >::totalSpace ( ) const
inline

◆ unreservedRemainingSpace()

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int 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 Minor::Queue< ElemType, ReportTraits, BubbleTraits >::capacity
private

◆ dataName

template<typename ElemType , typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
std::string Minor::Queue< ElemType, ReportTraits, BubbleTraits >::dataName
private

◆ numReservedSlots

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

◆ queue

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

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

Generated on Wed Sep 30 2020 14:03:06 for gem5 by doxygen 1.8.17