Fixes for functional path.
authorRon Dreslinski <rdreslin@umich.edu>
Mon, 9 Oct 2006 00:30:42 +0000 (20:30 -0400)
committerRon Dreslinski <rdreslin@umich.edu>
Mon, 9 Oct 2006 00:30:42 +0000 (20:30 -0400)
If the cpu needs to update any state when it gets a functional write (LSQ??)
then that code needs to be written.

src/cpu/o3/fetch_impl.hh:
src/cpu/o3/lsq_impl.hh:
src/cpu/ozone/front_end_impl.hh:
src/cpu/ozone/lw_lsq_impl.hh:
src/cpu/simple/atomic.cc:
src/cpu/simple/timing.cc:
    CPU's can recieve functional accesses, they need to determine if they need to do anything with them.
src/mem/bus.cc:
src/mem/bus.hh:
    Make the fuctional path do the correct tye of snoop

--HG--
extra : convert_revision : 70d09f954b907a8aa9b8137579cd2b06e02ae2ff

src/cpu/o3/fetch_impl.hh
src/cpu/o3/lsq_impl.hh
src/cpu/ozone/front_end_impl.hh
src/cpu/ozone/lw_lsq_impl.hh
src/cpu/simple/atomic.cc
src/cpu/simple/timing.cc
src/mem/bus.cc
src/mem/bus.hh

index 49717957653d2f38c469f2ae5b48e3e5363adfd8..b3c3caaad0b5f40744389fb0c2e70f5e534cbf0a 100644 (file)
@@ -63,7 +63,7 @@ template<class Impl>
 void
 DefaultFetch<Impl>::IcachePort::recvFunctional(PacketPtr pkt)
 {
-    panic("DefaultFetch doesn't expect recvFunctional callback!");
+    warn("Default fetch doesn't update it's state from a functional call.");
 }
 
 template<class Impl>
index 2bbab71f050a685ffa65530cecc7810f8107fd94..7b7d1eb8e4e852ac0028de16043a4b3c25b6c21c 100644 (file)
@@ -46,7 +46,7 @@ template <class Impl>
 void
 LSQ<Impl>::DcachePort::recvFunctional(PacketPtr pkt)
 {
-    panic("O3CPU doesn't expect recvFunctional callback!");
+    warn("O3CPU doesn't update things on a recvFunctional.");
 }
 
 template <class Impl>
index 5956c5cbaae0f6e46443067bbe7266e98f0d13c9..c814ff9c76495e16df0403082dcd5a3a56adcd3f 100644 (file)
@@ -59,7 +59,7 @@ template<class Impl>
 void
 FrontEnd<Impl>::IcachePort::recvFunctional(PacketPtr pkt)
 {
-    panic("FrontEnd doesn't expect recvFunctional callback!");
+    warn("FrontEnd doesn't update state from functional calls");
 }
 
 template<class Impl>
index 9d17b027fc96cc0e7facf83d704ce5566e734d7e..e523712daf2b955c67f94c6279df3682b71d6053 100644 (file)
@@ -72,7 +72,7 @@ template <class Impl>
 void
 OzoneLWLSQ<Impl>::DcachePort::recvFunctional(PacketPtr pkt)
 {
-    panic("O3CPU doesn't expect recvFunctional callback!");
+    warn("O3CPU doesn't update things on a recvFunctional");
 }
 
 template <class Impl>
index 42b0e9783d00c5606faa347ec14ba507cdf75a95..e21065ebc539bfb0263afc2e1f394a5df4b16500 100644 (file)
@@ -94,7 +94,7 @@ AtomicSimpleCPU::init()
 bool
 AtomicSimpleCPU::CpuPort::recvTiming(Packet *pkt)
 {
-    panic("AtomicSimpleCPU doesn't expect recvAtomic callback!");
+    panic("AtomicSimpleCPU doesn't expect recvTiming callback!");
     return true;
 }
 
@@ -108,7 +108,8 @@ AtomicSimpleCPU::CpuPort::recvAtomic(Packet *pkt)
 void
 AtomicSimpleCPU::CpuPort::recvFunctional(Packet *pkt)
 {
-    panic("AtomicSimpleCPU doesn't expect recvFunctional callback!");
+    //No internal storage to update, just return
+    return;
 }
 
 void
index a394468b9c7ef3614c059955130a0a7401a278f3..48362c42a5fb963e8658cc246f626774d6cde24a 100644 (file)
@@ -74,7 +74,8 @@ TimingSimpleCPU::CpuPort::recvAtomic(Packet *pkt)
 void
 TimingSimpleCPU::CpuPort::recvFunctional(Packet *pkt)
 {
-    panic("TimingSimpleCPU doesn't expect recvFunctional callback!");
+    //No internal storage to update, jusst return
+    return;
 }
 
 void
index daca6f985aadeb8561f25c33a89276fe8ea34572..1646cbd57101cdd9fab96431d55ce712340d6d58 100644 (file)
@@ -200,6 +200,18 @@ Bus::atomicSnoop(Packet *pkt)
     }
 }
 
+void
+Bus::functionalSnoop(Packet *pkt)
+{
+    std::vector<int> ports = findSnoopPorts(pkt->getAddr(), pkt->getSrc());
+
+    while (!ports.empty())
+    {
+        interfaces[ports.back()]->sendFunctional(pkt);
+        ports.pop_back();
+    }
+}
+
 bool
 Bus::timingSnoop(Packet *pkt)
 {
@@ -236,7 +248,7 @@ Bus::recvFunctional(Packet *pkt)
     DPRINTF(Bus, "recvFunctional: 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);
+    functionalSnoop(pkt);
     findPort(pkt->getAddr(), pkt->getSrc())->sendFunctional(pkt);
 }
 
index 3d7f4ad652b824e8bdf0ee54c3ca1b19087e9509..ff4ec9c8cf3617d36592bc9c2e40670d17bdb3fd 100644 (file)
@@ -102,6 +102,9 @@ class Bus : public MemObject
     /** Snoop all relevant ports atomicly. */
     void atomicSnoop(Packet *pkt);
 
+    /** Snoop all relevant ports functionally. */
+    void functionalSnoop(Packet *pkt);
+
     /** Call snoop on caches, be sure to set SNOOP_COMMIT bit if you want
      * the snoop to happen
      * @return True if succeds.