From: Ron Dreslinski Date: Fri, 20 Oct 2006 17:04:59 +0000 (-0400) Subject: Merge zizzer:/bk/newmem X-Git-Tag: m5_2.0_beta2~83^2~4 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54ed57cc4c0aab92cd5b3727c9def7667a49669d;p=gem5.git Merge zizzer:/bk/newmem into zazzer.eecs.umich.edu:/z/rdreslin/m5bk/newmemcleanest src/mem/tport.cc: Merge PacketPtr changes --HG-- extra : convert_revision : 0329c5803a3df67af3dda89bd9d4753fd1a286d1 --- 54ed57cc4c0aab92cd5b3727c9def7667a49669d diff --cc src/mem/cache/cache_impl.hh index dcb0e7b78,a88aeb573..66a9ee554 --- a/src/mem/cache/cache_impl.hh +++ b/src/mem/cache/cache_impl.hh @@@ -565,74 -564,18 +564,18 @@@ Cache::pr MSHR::TargetList::iterator i = targets->begin(); MSHR::TargetList::iterator end = targets->end(); for (; i != end; ++i) { - Packet * target = *i; + PacketPtr target = *i; // If the target contains data, and it overlaps the // probed request, need to update data - if (target->isWrite() && 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 (pkt->isWrite()) { - memcpy(pkt_data, write_data, data_size); - } else { - pkt->flags |= SATISFIED; - pkt->result = Packet::Success; - memcpy(write_data, pkt_data, data_size); - } + if (target->intersect(pkt)) { + fixPacket(pkt, target); } } } for (int i = 0; i < writes.size(); ++i) { - Packet * write = writes[i]->pkt; + PacketPtr write = writes[i]->pkt; if (write->intersect(pkt)) { - warn("Found outstanding write on an non-update probe"); - uint8_t* pkt_data; - uint8_t* write_data; - int data_size; - if (write->getAddr() < pkt->getAddr()) { - int offset = pkt->getAddr() - write->getAddr(); - pkt_data = pkt->getPtr(); - write_data = write->getPtr() + offset; - data_size = write->getSize() - offset; - assert(data_size > 0); - if (data_size > pkt->getSize()) - data_size = pkt->getSize(); - } else { - int offset = write->getAddr() - pkt->getAddr(); - pkt_data = pkt->getPtr() + offset; - write_data = write->getPtr(); - data_size = pkt->getSize() - offset; - assert(data_size >= pkt->getSize()); - if (data_size > write->getSize()) - data_size = write->getSize(); - } - - if (pkt->isWrite()) { - memcpy(pkt_data, write_data, data_size); - } else { - pkt->flags |= SATISFIED; - pkt->result = Packet::Success; - memcpy(write_data, pkt_data, data_size); - } - + fixPacket(pkt, write); } } if (pkt->isRead() diff --cc src/mem/tport.cc index 350b4c8e3,479dca1ad..5c5aaa3da --- a/src/mem/tport.cc +++ b/src/mem/tport.cc @@@ -31,15 -31,16 +31,14 @@@ #include "mem/tport.hh" void -SimpleTimingPort::recvFunctional(Packet *pkt) +SimpleTimingPort::recvFunctional(PacketPtr pkt) { - //First check queued events - std::list::iterator i; - std::list::iterator end; + std::list::iterator i = transmitList.begin(); + std::list::iterator end = transmitList.end(); + bool cont = true; - while (i != end && cont) { - //First check queued events - i = transmitList.begin(); - end = transmitList.end(); + while (i != end) { - Packet * target = *i; + PacketPtr target = *i; // If the target contains data, and it overlaps the // probed request, need to update data if (target->intersect(pkt))