summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/resources/cache_unit.cc
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:40 -0400
committerKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:40 -0400
commitc4deabfb97928f81acb0d66338426cb5f2687c37 (patch)
tree6129a36328db546cabcf6cdd78f87b889eb193bb /src/cpu/inorder/resources/cache_unit.cc
parentf1c3691356355d2ca865e48e91814c56293f6326 (diff)
downloadgem5-c4deabfb97928f81acb0d66338426cb5f2687c37.tar.xz
inorder: register ports for FS mode
handle "snoop" port registration as well as functional port setup for FS mode
Diffstat (limited to 'src/cpu/inorder/resources/cache_unit.cc')
-rw-r--r--src/cpu/inorder/resources/cache_unit.cc40
1 files changed, 36 insertions, 4 deletions
diff --git a/src/cpu/inorder/resources/cache_unit.cc b/src/cpu/inorder/resources/cache_unit.cc
index d21597aba..41429510d 100644
--- a/src/cpu/inorder/resources/cache_unit.cc
+++ b/src/cpu/inorder/resources/cache_unit.cc
@@ -70,21 +70,27 @@ printMemData(uint8_t *data, unsigned size)
Tick
CacheUnit::CachePort::recvAtomic(PacketPtr pkt)
{
- panic("CacheUnit::CachePort doesn't expect recvAtomic callback!");
+ panic("%s doesn't expect recvAtomic callback!", cachePortUnit->name());
return curTick();
}
void
CacheUnit::CachePort::recvFunctional(PacketPtr pkt)
{
- panic("CacheUnit::CachePort doesn't expect recvFunctional callback!");
+ DPRINTF(InOrderCachePort, "Doesn't update state on a recvFunctional."
+ "Ignoring packet for %x.\n", pkt->getAddr());
}
void
CacheUnit::CachePort::recvStatusChange(Status status)
{
- if (status == RangeChange)
+ if (status == RangeChange) {
+ if (!snoopRangeSent) {
+ snoopRangeSent = true;
+ sendStatusChange(Port::RangeChange);
+ }
return;
+ }
panic("CacheUnit::CachePort doesn't expect recvStatusChange callback!");
}
@@ -92,7 +98,16 @@ CacheUnit::CachePort::recvStatusChange(Status status)
bool
CacheUnit::CachePort::recvTiming(Packet *pkt)
{
- cachePortUnit->processCacheCompletion(pkt);
+ DPRINTF(Cache, "RecvTiming: Pkt %x,\n", pkt->getAddr());
+
+ if (pkt->isError())
+ DPRINTF(InOrderCachePort, "Got error packet back for address: %x\n",
+ pkt->getAddr());
+ else if (pkt->isResponse())
+ cachePortUnit->processCacheCompletion(pkt);
+ else
+ DPRINTF(Cache, "Received snoop pkt %x,Ignoring\n", pkt->getAddr());
+
return true;
}
@@ -130,6 +145,21 @@ CacheUnit::tlb()
}
+void
+CacheUnit::CachePort::setPeer(Port *port)
+{
+ Port::setPeer(port);
+
+#if FULL_SYSTEM
+ // Update the ThreadContext's memory ports (Functional/Virtual
+ // Ports)
+ if (cachePortUnit->resName == "dcache_port") {
+ cachePortUnit->cpu->updateMemPorts();
+ }
+
+#endif
+}
+
Port *
CacheUnit::getPort(const string &if_name, int idx)
{
@@ -1022,6 +1052,8 @@ CacheUnit::processSquash(CacheReqPacket *cache_pkt)
void
CacheUnit::processCacheCompletion(PacketPtr pkt)
{
+ //@todo: use packet sender state instead of deriving from packet class to
+ // get special state
CacheReqPacket* cache_pkt = dynamic_cast<CacheReqPacket*>(pkt);
assert(cache_pkt);