From c68f7feaa8bcecaf28f4110fc98b5d57bc755061 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 31 Oct 2006 13:23:17 -0500 Subject: add the ability to insert into the middle of the timing port send list --HG-- extra : convert_revision : 5422025f74ba7013f98d1d1dcbd1070f580aae61 --- src/mem/tport.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/mem/tport.cc b/src/mem/tport.cc index b9d5cbe4a..086d91279 100644 --- a/src/mem/tport.cc +++ b/src/mem/tport.cc @@ -44,6 +44,7 @@ SimpleTimingPort::recvFunctional(PacketPtr pkt) if (target->intersect(pkt)) done = fixPacket(pkt, target); + i++; } //Then just do an atomic access and throw away the returned latency @@ -98,11 +99,29 @@ SimpleTimingPort::recvRetry() void SimpleTimingPort::sendTiming(PacketPtr pkt, Tick time) { + // Nothing is on the list: add it and schedule an event if (transmitList.empty()) { assert(!sendEvent.scheduled()); sendEvent.schedule(curTick+time); + transmitList.push_back(std::pair(time+curTick,pkt)); + return; + } + + // something is on the list and this belongs at the end + if (time+curTick >= transmitList.back().first) { + transmitList.push_back(std::pair(time+curTick,pkt)); + return; + } + // Something is on the list and this belongs somewhere else + std::list >::iterator i = transmitList.begin(); + std::list >::iterator end = transmitList.end(); + bool done = false; + + while (i != end && !done) { + if (time+curTick < i->first) + transmitList.insert(i,std::pair(time+curTick,pkt)); + i++; } - transmitList.push_back(std::pair(time+curTick,pkt)); } void -- cgit v1.2.3 From 17141a1be9c656d2bba77e8853dd3d4cbce01beb Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 31 Oct 2006 13:23:49 -0500 Subject: remove connectAll() and connect() code since it isn't used anymore. (The python does it all) --HG-- extra : convert_revision : e16a1ff59d4522703b155c2e68379a3072e8f47f --- src/sim/sim_object.cc | 20 -------------------- src/sim/sim_object.hh | 2 -- 2 files changed, 22 deletions(-) diff --git a/src/sim/sim_object.cc b/src/sim/sim_object.cc index d12b06b7a..8fc8fe58f 100644 --- a/src/sim/sim_object.cc +++ b/src/sim/sim_object.cc @@ -91,11 +91,6 @@ SimObject::SimObject(const string &_name) state = Running; } -void -SimObject::connect() -{ -} - void SimObject::init() { @@ -159,21 +154,6 @@ SimObject::regAllStats() Stats::registerResetCallback(&StatResetCB); } -// -// static function: call connect() on all SimObjects. -// -void -SimObject::connectAll() -{ - SimObjectList::iterator i = simObjectList.begin(); - SimObjectList::iterator end = simObjectList.end(); - - for (; i != end; ++i) { - SimObject *obj = *i; - obj->connect(); - } -} - // // static function: call init() on all SimObjects. // diff --git a/src/sim/sim_object.hh b/src/sim/sim_object.hh index 32807b69d..93802e247 100644 --- a/src/sim/sim_object.hh +++ b/src/sim/sim_object.hh @@ -101,9 +101,7 @@ class SimObject : public Serializable, protected StartupCallback // initialization pass of all objects. // Gets invoked after construction, before unserialize. virtual void init(); - virtual void connect(); static void initAll(); - static void connectAll(); // register statistics for this object virtual void regStats(); -- cgit v1.2.3