diff options
Diffstat (limited to 'src/mem/cache/base_cache.hh')
-rw-r--r-- | src/mem/cache/base_cache.hh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/mem/cache/base_cache.hh b/src/mem/cache/base_cache.hh index 9a79bd36c..584c2d5df 100644 --- a/src/mem/cache/base_cache.hh +++ b/src/mem/cache/base_cache.hh @@ -571,9 +571,15 @@ class BaseCache : public MemObject bool done = false; while (i != end && !done) { - if (time < i->first) + if (time < i->first) { + if (i == cpuSidePort->transmitList.begin()) { + //Inserting at begining, reschedule + sendEvent->reschedule(time); + } cpuSidePort->transmitList.insert(i,std::pair<Tick,PacketPtr> (time,pkt)); + done = true; + } i++; } } @@ -624,9 +630,15 @@ class BaseCache : public MemObject bool done = false; while (i != end && !done) { - if (time < i->first) + if (time < i->first) { + if (i == cpuSidePort->transmitList.begin()) { + //Inserting at begining, reschedule + sendEvent->reschedule(time); + } cpuSidePort->transmitList.insert(i,std::pair<Tick,PacketPtr> (time,pkt)); + done = true; + } i++; } } @@ -672,8 +684,14 @@ class BaseCache : public MemObject bool done = false; while (i != end && !done) { - if (time < i->first) - memSidePort->transmitList.insert(i,std::pair<Tick,PacketPtr>(time,pkt)); + if (time < i->first) { + if (i == memSidePort->transmitList.begin()) { + //Inserting at begining, reschedule + memSendEvent->reschedule(time); + } + memSidePort->transmitList.insert(i,std::pair<Tick,PacketPtr>(time,pkt)); + done = true; + } i++; } } |