changeset aab813d6a162 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=aab813d6a162
description:
        MEM: Remove Port removeConn and MemObject deletePortRefs

        Cleaning up and simplifying the ports and going towards a more strict
        elaboration-time creation and binding of the ports.

diffstat:

 src/mem/bus.cc              |  15 ---------------
 src/mem/bus.hh              |   1 -
 src/mem/cache/cache.hh      |   1 -
 src/mem/cache/cache_impl.hh |  11 -----------
 src/mem/mem_object.cc       |   6 ------
 src/mem/mem_object.hh       |   4 ----
 src/mem/port.cc             |   8 --------
 src/mem/port.hh             |   4 ----
 8 files changed, 0 insertions(+), 50 deletions(-)

diffs (127 lines):

diff -r d7358736ac70 -r aab813d6a162 src/mem/bus.cc
--- a/src/mem/bus.cc    Tue Jan 17 12:55:09 2012 -0600
+++ b/src/mem/bus.cc    Tue Jan 17 12:55:09 2012 -0600
@@ -94,21 +94,6 @@
     return bp;
 }
 
-void
-Bus::deletePortRefs(Port *p)
-{
-
-    BusPort *bp =  dynamic_cast<BusPort*>(p);
-    if (bp == NULL)
-        panic("Couldn't convert Port* to BusPort*\n");
-    // If this is our one functional port
-    if (funcPort == bp)
-        return;
-    interfaces.erase(bp->getId());
-    clearBusCache();
-    delete bp;
-}
-
 /** Get the ranges of anyone other buses that we are connected to. */
 void
 Bus::init()
diff -r d7358736ac70 -r aab813d6a162 src/mem/bus.hh
--- a/src/mem/bus.hh    Tue Jan 17 12:55:09 2012 -0600
+++ b/src/mem/bus.hh    Tue Jan 17 12:55:09 2012 -0600
@@ -367,7 +367,6 @@
 
     /** A function used to return the port associated with this bus object. */
     virtual Port *getPort(const std::string &if_name, int idx = -1);
-    virtual void deletePortRefs(Port *p);
 
     virtual void init();
     virtual void startup();
diff -r d7358736ac70 -r aab813d6a162 src/mem/cache/cache.hh
--- a/src/mem/cache/cache.hh    Tue Jan 17 12:55:09 2012 -0600
+++ b/src/mem/cache/cache.hh    Tue Jan 17 12:55:09 2012 -0600
@@ -216,7 +216,6 @@
     Cache(const Params *p, TagStore *tags, BasePrefetcher *prefetcher);
 
     virtual Port *getPort(const std::string &if_name, int idx = -1);
-    virtual void deletePortRefs(Port *p);
 
     void regStats();
 
diff -r d7358736ac70 -r aab813d6a162 src/mem/cache/cache_impl.hh
--- a/src/mem/cache/cache_impl.hh       Tue Jan 17 12:55:09 2012 -0600
+++ b/src/mem/cache/cache_impl.hh       Tue Jan 17 12:55:09 2012 -0600
@@ -116,17 +116,6 @@
 
 template<class TagStore>
 void
-Cache<TagStore>::deletePortRefs(Port *p)
-{
-    if (cpuSidePort == p || memSidePort == p)
-        panic("Can only delete functional ports\n");
-
-    delete p;
-}
-
-
-template<class TagStore>
-void
 Cache<TagStore>::cmpAndSwap(BlkType *blk, PacketPtr pkt)
 {
     uint64_t overwrite_val;
diff -r d7358736ac70 -r aab813d6a162 src/mem/mem_object.cc
--- a/src/mem/mem_object.cc     Tue Jan 17 12:55:09 2012 -0600
+++ b/src/mem/mem_object.cc     Tue Jan 17 12:55:09 2012 -0600
@@ -34,9 +34,3 @@
     : SimObject(params)
 {
 }
-
-void
-MemObject::deletePortRefs(Port *p)
-{
-    panic("This object does not support port deletion\n");
-}
diff -r d7358736ac70 -r aab813d6a162 src/mem/mem_object.hh
--- a/src/mem/mem_object.hh     Tue Jan 17 12:55:09 2012 -0600
+++ b/src/mem/mem_object.hh     Tue Jan 17 12:55:09 2012 -0600
@@ -56,10 +56,6 @@
   public:
     /** Additional function to return the Port of a memory object. */
     virtual Port *getPort(const std::string &if_name, int idx = -1) = 0;
-
-    /** Tell object that this port is about to disappear, so it should remove 
it
-     * from any structures that it's keeping it in. */
-    virtual void deletePortRefs(Port *p) ;
 };
 
 #endif //__MEM_MEM_OBJECT_HH__
diff -r d7358736ac70 -r aab813d6a162 src/mem/port.cc
--- a/src/mem/port.cc   Tue Jan 17 12:55:09 2012 -0600
+++ b/src/mem/port.cc   Tue Jan 17 12:55:09 2012 -0600
@@ -64,14 +64,6 @@
 }
 
 void
-Port::removeConn()
-{
-    if (peer != NULL)
-        peer->getOwner()->deletePortRefs(peer);
-    peer = NULL;
-}
-
-void
 Port::blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd)
 {
     Request req;
diff -r d7358736ac70 -r aab813d6a162 src/mem/port.hh
--- a/src/mem/port.hh   Tue Jan 17 12:55:09 2012 -0600
+++ b/src/mem/port.hh   Tue Jan 17 12:55:09 2012 -0600
@@ -123,10 +123,6 @@
     /** Function to return the owner of this port. */
     MemObject *getOwner() { return owner; }
 
-    /** Inform the peer port to delete itself and notify it's owner about it's
-     * demise. */
-    void removeConn();
-
     bool isConnected() { return peer != NULL; }
 
   protected:
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to