summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-10-31 13:24:00 -0500
committerAli Saidi <saidi@eecs.umich.edu>2006-10-31 13:24:00 -0500
commit7f39644609e19ada9e94c9bbb09c3e625fa6e8ed (patch)
treeb849a7e39abf07fb9325a22e4f71053040adcfc9
parent79d4bede429bb5c3413fcd0cfe6f2d1790c8312d (diff)
parent17141a1be9c656d2bba77e8853dd3d4cbce01beb (diff)
downloadgem5-7f39644609e19ada9e94c9bbb09c3e625fa6e8ed.tar.xz
Merge zizzer:/bk/newmem
into zeep.pool:/z/saidi/work/m5.newmem.head --HG-- extra : convert_revision : 42712a50ca46ebc891b78186f4b6d1412a35d374
-rw-r--r--src/mem/tport.cc21
-rw-r--r--src/sim/sim_object.cc20
-rw-r--r--src/sim/sim_object.hh2
3 files changed, 20 insertions, 23 deletions
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<Tick,PacketPtr>(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<Tick,PacketPtr>(time+curTick,pkt));
+ return;
+ }
+ // Something is on the list and this belongs somewhere else
+ std::list<std::pair<Tick,PacketPtr> >::iterator i = transmitList.begin();
+ std::list<std::pair<Tick,PacketPtr> >::iterator end = transmitList.end();
+ bool done = false;
+
+ while (i != end && !done) {
+ if (time+curTick < i->first)
+ transmitList.insert(i,std::pair<Tick,PacketPtr>(time+curTick,pkt));
+ i++;
}
- transmitList.push_back(std::pair<Tick,PacketPtr>(time+curTick,pkt));
}
void
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
@@ -92,11 +92,6 @@ SimObject::SimObject(const string &_name)
}
void
-SimObject::connect()
-{
-}
-
-void
SimObject::init()
{
}
@@ -160,21 +155,6 @@ SimObject::regAllStats()
}
//
-// 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.
//
void
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();