From 3d2764acf3a05a65c32e93bd18c8fe9a6e0d9ecc Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Thu, 12 Oct 2006 15:30:30 -0400 Subject: [PATCH] replace functional code in tport with fixPacket(). fixPacket() should be used anywhere a functional packet and timing packet are found to have the same address. --HG-- extra : convert_revision : 783ec438271b24ddb0ae742b4efd1ed7d6be93f3 --- src/mem/tport.cc | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/src/mem/tport.cc b/src/mem/tport.cc index 50aab31c4..21907c0ca 100644 --- a/src/mem/tport.cc +++ b/src/mem/tport.cc @@ -36,41 +36,19 @@ SimpleTimingPort::recvFunctional(Packet *pkt) //First check queued events std::list::iterator i = transmitList.begin(); std::list::iterator end = transmitList.end(); - for (; i != end; ++i) { + bool cont = true; + + while (i != end && cont) { Packet * target = *i; // If the target contains data, and it overlaps the // probed request, need to update data - if (target->intersect(pkt)) { - uint8_t* pkt_data; - uint8_t* write_data; - int data_size; - if (target->getAddr() < pkt->getAddr()) { - int offset = pkt->getAddr() - target->getAddr(); - pkt_data = pkt->getPtr(); - write_data = target->getPtr() + offset; - data_size = target->getSize() - offset; - assert(data_size > 0); - if (data_size > pkt->getSize()) - data_size = pkt->getSize(); - } else { - int offset = target->getAddr() - pkt->getAddr(); - pkt_data = pkt->getPtr() + offset; - write_data = target->getPtr(); - data_size = pkt->getSize() - offset; - assert(data_size > pkt->getSize()); - if (data_size > target->getSize()) - data_size = target->getSize(); - } + if (target->intersect(pkt)) + fixPacket(pkt, target); - if (pkt->isWrite()) { - memcpy(pkt_data, write_data, data_size); - } else { - memcpy(write_data, pkt_data, data_size); - } - } } //Then just do an atomic access and throw away the returned latency - recvAtomic(pkt); + if (cont) + recvAtomic(pkt); } bool -- 2.30.2