gem5
|
Wrapper for a queue type to act as a pipeline stage input queue. More...
#include <buffers.hh>
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 |
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.
|
inline |
Definition at line 409 of file buffers.hh.
|
inlinevirtual |
Definition at line 417 of file buffers.hh.
|
inlinevirtual |
|
inline |
|
inline |
Is the queue empty?
Definition at line 500 of file buffers.hh.
Referenced by Minor::Fetch1::evaluate(), Minor::LSQ::findResponse(), Minor::LSQ::isDrained(), Minor::Fetch1::moveFromRequestsToTransfers(), Minor::LSQ::moveFromRequestsToTransfers(), Minor::LSQ::needsToTick(), Minor::Fetch1::popAndDiscard(), Minor::LSQ::popResponse(), Minor::Fetch1::recvReqRetry(), Minor::LSQ::step(), Minor::Fetch1::stepQueues(), Minor::Fetch1::tryToSendToTransfers(), and Minor::LSQ::tryToSendToTransfers().
|
inlinevirtual |
Clear a single reserved slot.
Implements Minor::Reservable.
Definition at line 442 of file buffers.hh.
|
inline |
Head value.
Like std::queue::front
Definition at line 492 of file buffers.hh.
Referenced by Minor::Fetch1::evaluate(), Minor::LSQ::findResponse(), Minor::Fetch1::moveFromRequestsToTransfers(), Minor::LSQ::moveFromRequestsToTransfers(), Minor::LSQ::needsToTick(), Minor::Fetch1::popAndDiscard(), Minor::LSQ::popResponse(), Minor::Fetch1::recvReqRetry(), Minor::LSQ::step(), Minor::Fetch1::stepQueues(), Minor::Fetch1::tryToSendToTransfers(), and Minor::LSQ::tryToSendToTransfers().
|
inline |
Definition at line 494 of file buffers.hh.
|
inline |
Definition at line 503 of file buffers.hh.
Referenced by Minor::Fetch1::minorTrace(), and Minor::LSQ::minorTrace().
|
inline |
Number of slots already occupied in this buffer.
Definition at line 467 of file buffers.hh.
Referenced by Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::minorTrace(), and Minor::Fetch1::numInFlightFetches().
|
inline |
Pop the head item.
Like std::queue::pop
Definition at line 497 of file buffers.hh.
Referenced by Minor::Fetch1::moveFromRequestsToTransfers(), Minor::LSQ::moveFromRequestsToTransfers(), Minor::Fetch1::popAndDiscard(), and Minor::LSQ::popResponse().
|
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().
|
inline |
Number of slots yet to fill in this buffer.
This doesn't include reservation.
Definition at line 475 of file buffers.hh.
|
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().
|
inline |
Number of slots which are reserved.
Definition at line 470 of file buffers.hh.
|
inline |
Number of slots available in an empty buffer.
Definition at line 464 of file buffers.hh.
|
inline |
Like remainingSpace but does not count reserved spaces.
Definition at line 484 of file buffers.hh.
Referenced by Minor::LSQ::canRequest(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::canReserve(), Minor::LSQ::moveFromRequestsToTransfers(), Minor::LSQ::needsToTick(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::reserve(), and Minor::LSQ::tryToSendToTransfers().
|
private |
Need this here as queues usually don't have a limited capacity.
Definition at line 403 of file buffers.hh.
Referenced by Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::push(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::remainingSpace(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::totalSpace(), and Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::unreservedRemainingSpace().
|
private |
Name to use for the data in MinorTrace.
Definition at line 406 of file buffers.hh.
|
private |
Number of slots currently reserved for future (reservation respecting) pushes.
Definition at line 400 of file buffers.hh.
Referenced by Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::clearReservedSpace(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::freeReservation(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::reserve(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::reservedSpace(), and Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::unreservedRemainingSpace().
|
private |
Definition at line 396 of file buffers.hh.
Referenced by Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::empty(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::front(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::minorTrace(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::occupiedSpace(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::pop(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::push(), Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::remainingSpace(), and Minor::Queue< Minor::ForwardInstData, ReportTraitsAdaptor< Minor::ForwardInstData >, BubbleTraitsAdaptor< Minor::ForwardInstData > >::unreservedRemainingSpace().