diff options
author | Ron Dreslinski <rdreslin@umich.edu> | 2006-11-12 07:16:34 -0500 |
---|---|---|
committer | Ron Dreslinski <rdreslin@umich.edu> | 2006-11-12 07:16:34 -0500 |
commit | 29cefcbf1353b90f6b12334f8554efa87bd659c8 (patch) | |
tree | cc37649531596f7298d1a5ef5be595a59a76281b /src | |
parent | 11accacf7c9de8147e68845051a489c251c4e7b1 (diff) | |
download | gem5-29cefcbf1353b90f6b12334f8554efa87bd659c8.tar.xz |
Don't insert reponses into the list more than once
If you get inserted in the front, reschedule the event
--HG--
extra : convert_revision : eccbacf5ec85600e5b68eb554fee2c0e2b65e965
Diffstat (limited to 'src')
-rw-r--r-- | src/mem/cache/base_cache.hh | 26 | ||||
-rw-r--r-- | src/mem/tport.cc | 8 |
2 files changed, 29 insertions, 5 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++; } } diff --git a/src/mem/tport.cc b/src/mem/tport.cc index a85ae2b14..c43c9aac0 100644 --- a/src/mem/tport.cc +++ b/src/mem/tport.cc @@ -118,8 +118,14 @@ SimpleTimingPort::sendTiming(PacketPtr pkt, Tick time) bool done = false; while (i != end && !done) { - if (time+curTick < i->first) + if (time+curTick < i->first) { + if (i == transmitList.begin()) { + //Inserting at begining, reschedule + sendEvent.reschedule(time+curTick); + } transmitList.insert(i,std::pair<Tick,PacketPtr>(time+curTick,pkt)); + done = true; + } i++; } } |