43c43
< : SimObject(p), m_recycle_latency(p->recycle_latency),
---
> : SimObject(p),
51,53d50
< m_sender = NULL;
< m_receiver = NULL;
<
66c63
< MessageBuffer::getSize()
---
> MessageBuffer::getSize(Tick curTime)
68,69c65,66
< if (m_time_last_time_size_checked != m_receiver->curCycle()) {
< m_time_last_time_size_checked = m_receiver->curCycle();
---
> if (m_time_last_time_size_checked != curTime) {
> m_time_last_time_size_checked = curTime;
77c74
< MessageBuffer::areNSlotsAvailable(unsigned int n)
---
> MessageBuffer::areNSlotsAvailable(unsigned int n, Tick current_time)
91c88
< if (m_time_last_time_pop < m_sender->clockEdge()) {
---
> if (m_time_last_time_pop < current_time) {
95c92
< if (m_time_last_time_enqueue < m_sender->curCycle()) {
---
> if (m_time_last_time_enqueue < current_time) {
121,122d117
< assert(isReady());
<
131c126
< Cycles
---
> Tick
134,135c129,130
< Cycles time(1);
< time += Cycles(random_mt.random(0, 3)); // [0...3]
---
> Tick time = 1;
> time += random_mt.random(0, 3); // [0...3]
137c132
< time += Cycles(100 + random_mt.random(1, 15)); // 100 + [1...15]
---
> time += 100 + random_mt.random(1, 15); // 100 + [1...15]
143c138
< MessageBuffer::enqueue(MsgPtr message, Cycles delta)
---
> MessageBuffer::enqueue(MsgPtr message, Tick current_time, Tick delta)
146c141
< if (m_time_last_time_enqueue < m_sender->curCycle()) {
---
> if (m_time_last_time_enqueue < current_time) {
148c143
< m_time_last_time_enqueue = m_sender->curCycle();
---
> m_time_last_time_enqueue = current_time;
157d151
< Tick current_time = m_sender->clockEdge();
162c156
< arrival_time = current_time + delta * m_sender->clockPeriod();
---
> arrival_time = current_time + delta;
169,170c163
< arrival_time = m_last_arrival_time +
< random_time() * m_sender->clockPeriod();
---
> arrival_time = m_last_arrival_time + random_time();
172,173c165
< arrival_time = current_time +
< random_time() * m_sender->clockPeriod();
---
> arrival_time = current_time + random_time();
183,185c175,176
< *this, name(), current_time,
< delta * m_sender->clockPeriod(),
< arrival_time, m_last_arrival_time);
---
> *this, name(), current_time, delta, arrival_time,
> m_last_arrival_time);
198c189
< assert(m_sender->clockEdge() >= msg_ptr->getLastEnqueueTime() &&
---
> assert(current_time >= msg_ptr->getLastEnqueueTime() &&
201c192
< msg_ptr->updateDelayedTicks(m_sender->clockEdge());
---
> msg_ptr->updateDelayedTicks(current_time);
218,219c209,210
< Cycles
< MessageBuffer::dequeue()
---
> Tick
> MessageBuffer::dequeue(Tick current_time)
222c213
< assert(isReady());
---
> assert(isReady(current_time));
228,230c219,220
< message->updateDelayedTicks(m_receiver->clockEdge());
< Cycles delayCycles =
< m_receiver->ticksToCycles(message->getDelayedTicks());
---
> message->updateDelayedTicks(current_time);
> Tick delay = message->getDelayedTicks();
234c224
< if (m_time_last_time_pop < m_receiver->clockEdge()) {
---
> if (m_time_last_time_pop < current_time) {
236c226
< m_time_last_time_pop = m_receiver->clockEdge();
---
> m_time_last_time_pop = current_time;
239,240c229
< pop_heap(m_prio_heap.begin(), m_prio_heap.end(),
< greater<MsgPtr>());
---
> pop_heap(m_prio_heap.begin(), m_prio_heap.end(), greater<MsgPtr>());
243c232
< return delayCycles;
---
> return delay;
252c241
< m_time_last_time_enqueue = Cycles(0);
---
> m_time_last_time_enqueue = 0;
259c248
< MessageBuffer::recycle()
---
> MessageBuffer::recycle(Tick current_time, Tick recycle_latency)
262c251
< assert(isReady());
---
> assert(isReady(current_time));
266c255,257
< node->setLastEnqueueTime(m_receiver->clockEdge(m_recycle_latency));
---
> Tick future_time = current_time + recycle_latency;
> node->setLastEnqueueTime(future_time);
>
269,270c260
< m_consumer->
< scheduleEventAbsolute(m_receiver->clockEdge(m_recycle_latency));
---
> m_consumer->scheduleEventAbsolute(future_time);
292c282
< MessageBuffer::reanalyzeMessages(Addr addr)
---
> MessageBuffer::reanalyzeMessages(Addr addr, Tick current_time)
296d285
< Tick curTick = m_receiver->clockEdge();
304c293
< reanalyzeList(m_stall_msg_map[addr], curTick);
---
> reanalyzeList(m_stall_msg_map[addr], current_time);
309c298
< MessageBuffer::reanalyzeAllMessages()
---
> MessageBuffer::reanalyzeAllMessages(Tick current_time)
312d300
< Tick curTick = m_receiver->clockEdge();
322c310
< reanalyzeList(map_iter->second, curTick);
---
> reanalyzeList(map_iter->second, current_time);
328c316
< MessageBuffer::stallMessage(Addr addr)
---
> MessageBuffer::stallMessage(Addr addr, Tick current_time)
331c319
< assert(isReady());
---
> assert(isReady(current_time));
335c323
< dequeue();
---
> dequeue(current_time);
359c347
< MessageBuffer::isReady() const
---
> MessageBuffer::isReady(Tick current_time) const
362c350
< (m_prio_heap.front()->getLastEnqueueTime() <= m_receiver->clockEdge()));
---
> (m_prio_heap.front()->getLastEnqueueTime() <= current_time));