diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2012-07-09 12:35:31 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2012-07-09 12:35:31 -0400 |
commit | 17f9270dada824ab7a1b52ed4470abef5aa56d6c (patch) | |
tree | f363339d3329d2c01a6e76f653a918a47a47bc2d /src/mem/port.cc | |
parent | ff5718f042ecccee694ae79c9386a589fd77e8ef (diff) | |
download | gem5-17f9270dada824ab7a1b52ed4470abef5aa56d6c.tar.xz |
Port: Move retry from port base class to Master/SlavePort
This patch is the last part of moving all protocol-related
functionality out of the Port base class. All the send/recv functions
are already moved, and the retry (which still governs all the timing
transport functions) is the only part that remained in the base class.
The only point where this currently causes a bit of inconvenience is
in the bus where the retry list is global and holds Port pointers (not
Master/SlavePort). This is about to change with the split into a
request/response bus and will soon be removed anyway.
The patch has no impact on any regressions.
Diffstat (limited to 'src/mem/port.cc')
-rw-r--r-- | src/mem/port.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mem/port.cc b/src/mem/port.cc index 554f5bb1e..6007d303c 100644 --- a/src/mem/port.cc +++ b/src/mem/port.cc @@ -51,7 +51,7 @@ #include "mem/port.hh" Port::Port(const std::string &_name, MemObject& _owner, PortID _id) - : portName(_name), id(_id), peer(NULL), owner(_owner) + : portName(_name), id(_id), owner(_owner) { } @@ -86,7 +86,6 @@ MasterPort::bind(SlavePort& slave_port) { // master port keeps track of the slave port _slavePort = &slave_port; - peer = &slave_port; // slave port also keeps track of master port _slavePort->bind(*this); @@ -133,6 +132,12 @@ MasterPort::sendTimingSnoopResp(PacketPtr pkt) } void +MasterPort::sendRetry() +{ + _slavePort->recvRetry(); +} + +void MasterPort::printAddr(Addr a) { Request req(a, 1, 0, Request::funcMasterId); @@ -159,7 +164,6 @@ void SlavePort::bind(MasterPort& master_port) { _masterPort = &master_port; - peer = &master_port; } MasterPort& @@ -211,3 +215,9 @@ SlavePort::sendTimingSnoopReq(PacketPtr pkt) assert(pkt->isRequest()); _masterPort->recvTimingSnoopReq(pkt); } + +void +SlavePort::sendRetry() +{ + _masterPort->recvRetry(); +} |