From 549412b33361629b03d9d85dac3bb3efa2f07baf Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 10 Oct 2006 17:24:03 -0400 Subject: Changed the bus to use a bool to keep track of retries rather than a pointer src/mem/tport.cc: minor formatting tweak --HG-- extra : convert_revision : 7391d142815c5876fcc0f991bd053e6a1781c101 --- src/mem/bus.hh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/mem/bus.hh') diff --git a/src/mem/bus.hh b/src/mem/bus.hh index ce3f4bed7..4affcd6ae 100644 --- a/src/mem/bus.hh +++ b/src/mem/bus.hh @@ -195,7 +195,7 @@ class Bus : public MemObject BusFreeEvent busIdle; - Port * retryingPort; + bool inRetry; /** An array of pointers to the peer port interfaces connected to this bus.*/ @@ -207,18 +207,18 @@ class Bus : public MemObject void addToRetryList(Port * port) { - if (!retryingPort) { + if (!inRetry) { // The device wasn't retrying a packet, or wasn't at an appropriate // time. retryList.push_back(port); } else { // The device was retrying a packet. It didn't work, so we'll leave // it at the head of the retry list. - retryingPort = NULL; + inRetry = false; - // We shouldn't be receiving a packet from one port when a different +/* // We shouldn't be receiving a packet from one port when a different // one is retrying. - assert(port == retryingPort); + assert(port == retryingPort);*/ } } @@ -234,11 +234,13 @@ class Bus : public MemObject Bus(const std::string &n, int bus_id, int _clock, int _width) : MemObject(n), busId(bus_id), clock(_clock), width(_width), - tickNextIdle(0), busIdle(this), retryingPort(NULL), defaultPort(NULL) + tickNextIdle(0), busIdle(this), inRetry(false), defaultPort(NULL) { //Both the width and clock period must be positive - assert(width); - assert(clock); + if (width <= 0) + fatal("Bus width must be positive\n"); + if (clock <= 0) + fatal("Bus clock period must be positive\n"); } }; -- cgit v1.2.3