diff options
author | Ron Dreslinski <rdreslin@umich.edu> | 2006-10-11 18:28:33 -0400 |
---|---|---|
committer | Ron Dreslinski <rdreslin@umich.edu> | 2006-10-11 18:28:33 -0400 |
commit | 567afbf6ce5b2d6fe573878c39679e56a1bf5d15 (patch) | |
tree | ae5caee54ed390314e88a6eaa1dcb988cad96556 /src/mem/bus.cc | |
parent | 03c42ea5904ea5f9f5e8d634f6bc61992abef746 (diff) | |
download | gem5-567afbf6ce5b2d6fe573878c39679e56a1bf5d15.tar.xz |
More cache fixes. Atomic coherence now works as well.
src/cpu/memtest/memtest.cc:
src/cpu/memtest/memtest.hh:
Make Memtester able to test atomic as well
src/mem/bus.cc:
src/mem/bus.hh:
Handle atomic snoops properly for cache->cache transfers
src/mem/cache/cache_impl.hh:
Debug output.
Clean up memleak in atomic mode.
Set hitLatency.
Still need to send back reasonable number for atomic return value.
src/mem/packet.cc:
Add command strings for new commands
src/python/m5/objects/MemTest.py:
Add param to test atomic memory.
--HG--
extra : convert_revision : 43f880e29215776167c16ea90793ebf8122c785b
Diffstat (limited to 'src/mem/bus.cc')
-rw-r--r-- | src/mem/bus.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc index 3998666c7..b34944ed7 100644 --- a/src/mem/bus.cc +++ b/src/mem/bus.cc @@ -293,16 +293,22 @@ Bus::findSnoopPorts(Addr addr, int id) return ports; } -void +Tick Bus::atomicSnoop(Packet *pkt) { std::vector<int> ports = findSnoopPorts(pkt->getAddr(), pkt->getSrc()); + Tick response_time = 0; while (!ports.empty()) { - interfaces[ports.back()]->sendAtomic(pkt); + Tick response = interfaces[ports.back()]->sendAtomic(pkt); + if (response) { + assert(!response_time); //Multiple responders + response_time = response; + } ports.pop_back(); } + return response_time; } void @@ -341,8 +347,11 @@ Bus::recvAtomic(Packet *pkt) DPRINTF(Bus, "recvAtomic: packet src %d dest %d addr 0x%x cmd %s\n", pkt->getSrc(), pkt->getDest(), pkt->getAddr(), pkt->cmdString()); assert(pkt->getDest() == Packet::Broadcast); - atomicSnoop(pkt); - return findPort(pkt->getAddr(), pkt->getSrc())->sendAtomic(pkt); + Tick snoopTime = atomicSnoop(pkt); + if (snoopTime) + return snoopTime; //Snoop satisfies it + else + return findPort(pkt->getAddr(), pkt->getSrc())->sendAtomic(pkt); } /** Function called by the port when the bus is receiving a Functional |