Hi everyone,
I see in mem/packet_queue.cc, function PacketQueue::scheduleSend(Tick
time), we have:
// the next ready time is either determined by the next deferred
packet,
// or in the cache through the MSHR ready time
Tick nextReady = std::min(deferredPacketReadyTime(), time);
if (nextReady != MaxTick) {
// if the sendTiming caused someone else to call our
// recvTiming we could already have an event scheduled, check
if (!sendEvent.scheduled()) {
em.schedule(&sendEvent, std::max(nextReady, curTick() + 1));
}
}
Why do we do curTick() + 1? If a clock cycle is a multiple of ticks,
e.g. 500 ticks, and curTick() is 500 or cycle #1, then curTick() + 1
effectively schedules the event to be sent NOT at cycle 1 (Tick 500) or
cycle 2 (Tick 1000)?
I noticed this while debugging a problem related to back to back stores
sent to the cache. Basically, I have 2 stores: store #1 is sent to the
cache in cycle 1, and ideally should get the cache ACK in cycle 2 (Cache
hit latency is 1 cycle). In cycle 2, the CPU checks if there is any
store in flight before it can send out store #2, but it cannot because
store #1's ACK is back at Tick 501!
Right now, I have changed the code to em.schedule(&sendEvent,
std::max(nextReady, curTick())); but it would be best if someone could
give me some insight about this code.
I believe Andreas Hansson has written this code. So if you see this
thread, I would really appreciate if you can give some comments.
Thanks!
Binh
--
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users