gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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_)
 
virtual ~Queue ()
 
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
 

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

Constructor & Destructor Documentation

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

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

Definition at line 417 of file buffers.hh.

Member Function Documentation

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

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

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

Definition at line 494 of file buffers.hh.

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

Definition at line 503 of file buffers.hh.

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

template<typename ElemType, typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int Minor::Queue< ElemType, ReportTraits, BubbleTraits >::occupiedSpace ( ) const
inline
template<typename ElemType, typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
void Minor::Queue< ElemType, ReportTraits, BubbleTraits >::pop ( )
inline
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 424 of file buffers.hh.

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

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

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

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

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

Member Data Documentation

template<typename ElemType, typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int Minor::Queue< ElemType, ReportTraits, BubbleTraits >::capacity
private
template<typename ElemType, typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
std::string Minor::Queue< ElemType, ReportTraits, BubbleTraits >::dataName
private
template<typename ElemType, typename ReportTraits = ReportTraitsAdaptor<ElemType>, typename BubbleTraits = BubbleTraitsAdaptor<ElemType>>
unsigned int Minor::Queue< ElemType, ReportTraits, BubbleTraits >::numReservedSlots
private
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 Fri Jun 9 2017 13:04:33 for gem5 by doxygen 1.8.6