// Schedule the wakeup
if (m_consumer_ptr != NULL) {
- m_consumer_ptr->scheduleEventAbsolute(arrival_time);
+ m_consumer_ptr->scheduleEventAbsolute(
+ arrival_time * m_receiver_ptr->clockPeriod());
m_consumer_ptr->storeEventInfo(m_vnet_id);
} else {
panic("No consumer: %s name: %s\n", *this, m_name);
m_prio_heap.back() = node;
push_heap(m_prio_heap.begin(), m_prio_heap.end(),
greater<MessageBufferNode>());
- m_consumer_ptr->scheduleEventAbsolute(m_receiver_ptr->curCycle() +
- m_recycle_latency);
+ m_consumer_ptr->
+ scheduleEventAbsolute(m_receiver_ptr->clockEdge(m_recycle_latency));
}
void
push_heap(m_prio_heap.begin(), m_prio_heap.end(),
greater<MessageBufferNode>());
- m_consumer_ptr->scheduleEventAbsolute(msgNode.m_time);
+ m_consumer_ptr->
+ scheduleEventAbsolute(m_receiver_ptr->clockPeriod() * nextCycle);
m_stall_msg_map[addr].pop_front();
}
m_stall_msg_map.erase(addr);
push_heap(m_prio_heap.begin(), m_prio_heap.end(),
greater<MessageBufferNode>());
- m_consumer_ptr->scheduleEventAbsolute(msgNode.m_time);
+ m_consumer_ptr->
+ scheduleEventAbsolute(m_receiver_ptr->clockPeriod() * nextCycle);
(map_iter->second).pop_front();
}
}
void
Consumer::scheduleEvent(Cycles timeDelta)
{
- timeDelta += em->curCycle();
- scheduleEventAbsolute(timeDelta);
+ scheduleEventAbsolute(em->clockEdge(timeDelta));
}
void
-Consumer::scheduleEventAbsolute(Cycles timeAbs)
+Consumer::scheduleEventAbsolute(Tick evt_time)
{
- Tick evt_time = em->clockPeriod() * timeAbs;
if (!alreadyScheduled(evt_time)) {
// This wakeup is not redundant
ConsumerEvent *evt = new ConsumerEvent(this);
- assert(timeAbs > em->curCycle());
-
em->schedule(evt, evt_time);
insertScheduledWakeupTime(evt_time);
}
m_scheduled_wakeups.erase(time);
}
+ void scheduleEventAbsolute(Tick timeAbs);
+
+ protected:
void scheduleEvent(Cycles timeDelta);
- void scheduleEventAbsolute(Cycles timeAbs);
private:
Tick m_last_scheduled_wakeup;
{
flit_d *t_flit = new flit_d(in_vc, free_signal, curTime);
creditQueue->insert(t_flit);
- m_credit_link->scheduleEvent(Cycles(1));
+ m_credit_link->scheduleEventAbsolute(m_router->clockEdge(Cycles(1)));
}
inline int
flit_d *credit_flit = new flit_d(t_flit->get_vc(), free_signal,
m_net_ptr->curCycle());
creditQueue->insert(credit_flit);
- m_ni_credit_link->scheduleEvent(Cycles(1));
+ m_ni_credit_link->
+ scheduleEventAbsolute(m_net_ptr->clockEdge(Cycles(1)));
int vnet = t_flit->get_vnet();
m_net_ptr->increment_received_flits(vnet);
t_flit->set_time(m_net_ptr->curCycle() + Cycles(1));
outSrcQueue->insert(t_flit);
// schedule the out link
- outNetLink->scheduleEvent(Cycles(1));
+ outNetLink->
+ scheduleEventAbsolute(m_net_ptr->clockEdge(Cycles(1)));
if (t_flit->get_type() == TAIL_ ||
t_flit->get_type() == HEAD_TAIL_) {
flit_d *t_flit = link_srcQueue->getTopFlit();
t_flit->set_time(curCycle() + m_latency);
linkBuffer->insert(t_flit);
- link_consumer->scheduleEvent(m_latency);
+ link_consumer->scheduleEventAbsolute(clockEdge(m_latency));
m_link_utilized++;
m_vc_load[t_flit->get_vc()]++;
}
insert_flit(flit_d *t_flit)
{
m_out_buffer->insert(t_flit);
- m_out_link->scheduleEvent(Cycles(1));
+ m_out_link->scheduleEventAbsolute(m_router->clockEdge(Cycles(1)));
}
uint32_t functionalWrite(Packet *pkt);
void
Router_d::vcarb_req()
{
- m_vc_alloc->scheduleEvent(Cycles(1));
+ m_vc_alloc->scheduleEventAbsolute(clockEdge(Cycles(1)));
}
void
Router_d::swarb_req()
{
- m_sw_alloc->scheduleEvent(Cycles(1));
+ m_sw_alloc->scheduleEventAbsolute(clockEdge(Cycles(1)));
}
void
Router_d::update_sw_winner(int inport, flit_d *t_flit)
{
m_switch->update_sw_winner(inport, t_flit);
- m_switch->scheduleEvent(Cycles(1));
+ m_switch->scheduleEventAbsolute(clockEdge(Cycles(1)));
}
void
outSrcQueue->insert(t_flit);
// schedule the out link
- outNetLink->scheduleEvent(Cycles(1));
+ outNetLink->
+ scheduleEventAbsolute(m_net_ptr->clockEdge(Cycles(1)));
return;
}
}
flit *t_flit = link_srcQueue->getTopFlit();
t_flit->set_time(curCycle() + m_latency);
linkBuffer->insert(t_flit);
- link_consumer->scheduleEvent(m_latency);
+ link_consumer->scheduleEventAbsolute(clockEdge(m_latency));
+
m_link_utilized++;
m_vc_load[t_flit->get_vc()]++;
}
m_in_vc_state[in_port][in_vc]->setState(VC_AB_, request_time);
assert(request_time >= curCycle());
if (request_time > curCycle())
- m_vc_arbiter->scheduleEventAbsolute(request_time);
+ m_vc_arbiter->scheduleEventAbsolute(clockPeriod() * request_time);
else
vc_arbitrate();
}
m_router_buffers[port][vc_tolookat]->getTopFlit();
t_flit->set_time(curCycle() + Cycles(1));
m_out_src_queue[port]->insert(t_flit);
- m_out_link[port]->scheduleEvent(Cycles(1));
+
+ m_out_link[port]->
+ scheduleEventAbsolute(clockEdge(Cycles(1)));
break; // done for this port
}
}
for (int vc = 0; vc < m_num_vcs; vc++) {
if (m_in_vc_state[port][vc]->isInState(VC_AB_, curCycle() +
Cycles(1))) {
- m_vc_arbiter->scheduleEvent(Cycles(1));
+ m_vc_arbiter->scheduleEventAbsolute(clockEdge(Cycles(1)));
return;
}
}
req.m_addr, req.m_is_mem_read ? 'R':'W', arrival_time);
// schedule the wake up
- m_consumer_ptr->scheduleEventAbsolute(ruby_arrival_time);
+ m_consumer_ptr->scheduleEventAbsolute(arrival_time);
}
// getBank returns an integer that is unique for each
Cycles ready_time = m_clockobj_ptr->curCycle() + relative_latency;
m_map[address] = ready_time;
assert(m_consumer_ptr != NULL);
- m_consumer_ptr->scheduleEventAbsolute(ready_time);
+ m_consumer_ptr->
+ scheduleEventAbsolute(m_clockobj_ptr->clockPeriod() * ready_time);
m_next_valid = false;
// Don't always recalculate the next ready address
MessageBufferNode thisNode(arrival_time, m_msg_counter, message);
m_message_queue.push_back(thisNode);
if (m_consumer_ptr != NULL) {
- m_consumer_ptr->scheduleEventAbsolute(arrival_time);
+ m_consumer_ptr->
+ scheduleEventAbsolute(g_system_ptr->clockPeriod() * arrival_time);
} else {
panic("No Consumer for WireBuffer! %s\n", *this);
}
m_message_queue.back() = node;
push_heap(m_message_queue.begin(), m_message_queue.end(),
greater<MessageBufferNode>());
- m_consumer_ptr->scheduleEventAbsolute(node.m_time);
+ m_consumer_ptr->
+ scheduleEventAbsolute(g_system_ptr->clockPeriod() * node.m_time);
}
bool