using m5::stl_helpers::operator<<;
MessageBuffer::MessageBuffer(const string &name)
- : m_last_arrival_time(0)
+ : m_time_last_time_size_checked(0), m_time_last_time_enqueue(0),
+ m_time_last_time_pop(0), m_last_arrival_time(0)
{
m_msg_counter = 0;
m_consumer_ptr = NULL;
m_max_size = -1;
m_randomization = true;
m_size_last_time_size_checked = 0;
- m_time_last_time_size_checked = 0;
- m_time_last_time_enqueue = 0;
- m_time_last_time_pop = 0;
m_size_at_cycle_start = 0;
m_msgs_this_cycle = 0;
m_not_avail_count = 0;
}
}
-Time
+Cycles
MessageBuffer::dequeue_getDelayCycles(MsgPtr& message)
{
dequeue(message);
DPRINTF(RubyQueue, "Enqueue message is %s\n", (*(message.get())));
}
-Time
+Cycles
MessageBuffer::dequeue_getDelayCycles()
{
// get MsgPtr of the message about to be dequeued
MsgPtr message = m_prio_heap.front().m_msgptr;
// get the delay cycles
- Time delayCycles = setAndReturnDelayCycles(message);
+ Cycles delayCycles = setAndReturnDelayCycles(message);
dequeue();
return delayCycles;
m_msg_counter = 0;
m_size = 0;
- m_time_last_time_enqueue = 0;
- m_time_last_time_pop = 0;
+ m_time_last_time_enqueue = Cycles(0);
+ m_time_last_time_pop = Cycles(0);
m_size_at_cycle_start = 0;
m_msgs_this_cycle = 0;
}
{
DPRINTF(RubyQueue, "ReanalyzeMessages\n");
assert(m_stall_msg_map.count(addr) > 0);
- Cycles nextCycle(m_clockobj_ptr->curCycle() + Cycles(1));
+ Cycles nextCycle = m_clockobj_ptr->curCycle() + Cycles(1);
//
// Put all stalled messages associated with this address back on the
MessageBuffer::reanalyzeAllMessages()
{
DPRINTF(RubyQueue, "ReanalyzeAllMessages %s\n");
- Cycles nextCycle(m_clockobj_ptr->curCycle() + Cycles(1));
+ Cycles nextCycle = m_clockobj_ptr->curCycle() + Cycles(1);
//
// Put all stalled messages associated with this address back on the
(m_stall_msg_map[addr]).push_back(message);
}
-Time
+Cycles
MessageBuffer::setAndReturnDelayCycles(MsgPtr msg_ptr)
{
// get the delay cycles of the message at the top of the queue
void enqueue(MsgPtr message, Cycles delta);
//! returns delay ticks of the message.
- Time dequeue_getDelayCycles(MsgPtr& message);
+ Cycles dequeue_getDelayCycles(MsgPtr& message);
void dequeue(MsgPtr& message);
//! returns delay cycles of the message
- Time dequeue_getDelayCycles();
+ Cycles dequeue_getDelayCycles();
void dequeue() { pop(); }
void pop();
void recycle();
Cycles m_recycle_latency;
// Private Methods
- Time setAndReturnDelayCycles(MsgPtr message);
+ Cycles setAndReturnDelayCycles(MsgPtr message);
// Private copy constructor and assignment operator
MessageBuffer(const MessageBuffer& obj);
int m_max_size;
int m_size;
- Time m_time_last_time_size_checked;
+ Cycles m_time_last_time_size_checked;
int m_size_last_time_size_checked;
// variables used so enqueues appear to happen imediately, while
// pop happen the next cycle
- Time m_time_last_time_enqueue;
- Time m_time_last_time_pop;
+ Cycles m_time_last_time_enqueue;
+ Cycles m_time_last_time_pop;
int m_size_at_cycle_start;
int m_msgs_this_cycle;