summaryrefslogtreecommitdiff
path: root/src/mem/bus.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-10-10 22:10:08 -0400
committerGabe Black <gblack@eecs.umich.edu>2006-10-10 22:10:08 -0400
commit59dd317cb5251c8cff714a94b5d772af201febbe (patch)
tree6401120fe89f5c3e3f2ae82b1bc42a094d9b6c62 /src/mem/bus.hh
parent404b2a951d82bde00e607296c5e7de2997df8058 (diff)
downloadgem5-59dd317cb5251c8cff714a94b5d772af201febbe.tar.xz
Put in an accounting mechanism and an assert to make sure something doesn't try to send another packet while it's still waiting for the bus.
--HG-- extra : convert_revision : 4a2b83111e49f71ca27e05c98b55bc3bac8d9f53
Diffstat (limited to 'src/mem/bus.hh')
-rw-r--r--src/mem/bus.hh18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mem/bus.hh b/src/mem/bus.hh
index 4affcd6ae..4f330230f 100644
--- a/src/mem/bus.hh
+++ b/src/mem/bus.hh
@@ -130,6 +130,8 @@ class Bus : public MemObject
of the interfaces connecting to the bus. */
class BusPort : public Port
{
+ bool _onRetryList;
+
/** A pointer to the bus to which this port belongs. */
Bus *bus;
@@ -140,9 +142,15 @@ class Bus : public MemObject
/** Constructor for the BusPort.*/
BusPort(const std::string &_name, Bus *_bus, int _id)
- : Port(_name), bus(_bus), id(_id)
+ : Port(_name), _onRetryList(false), bus(_bus), id(_id)
{ }
+ bool onRetryList()
+ { return _onRetryList; }
+
+ void onRetryList(bool newVal)
+ { _onRetryList = newVal; }
+
protected:
/** When reciving a timing request from the peer port (at id),
@@ -199,17 +207,19 @@ class Bus : public MemObject
/** An array of pointers to the peer port interfaces
connected to this bus.*/
- std::vector<Port*> interfaces;
+ std::vector<BusPort*> interfaces;
/** An array of pointers to ports that retry should be called on because the
* original send failed for whatever reason.*/
- std::list<Port*> retryList;
+ std::list<BusPort*> retryList;
- void addToRetryList(Port * port)
+ void addToRetryList(BusPort * port)
{
if (!inRetry) {
// The device wasn't retrying a packet, or wasn't at an appropriate
// time.
+ assert(!port->onRetryList());
+ port->onRetryList(true);
retryList.push_back(port);
} else {
// The device was retrying a packet. It didn't work, so we'll leave