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.
This commit is contained in:
parent
6315e5bbb5
commit
142380a373
8 changed files with 0 additions and 50 deletions
|
@ -94,21 +94,6 @@ Bus::getPort(const std::string &if_name, int idx)
|
||||||
return bp;
|
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. */
|
/** Get the ranges of anyone other buses that we are connected to. */
|
||||||
void
|
void
|
||||||
Bus::init()
|
Bus::init()
|
||||||
|
|
|
@ -367,7 +367,6 @@ class Bus : public MemObject
|
||||||
|
|
||||||
/** A function used to return the port associated with this bus object. */
|
/** A function used to return the port associated with this bus object. */
|
||||||
virtual Port *getPort(const std::string &if_name, int idx = -1);
|
virtual Port *getPort(const std::string &if_name, int idx = -1);
|
||||||
virtual void deletePortRefs(Port *p);
|
|
||||||
|
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void startup();
|
virtual void startup();
|
||||||
|
|
1
src/mem/cache/cache.hh
vendored
1
src/mem/cache/cache.hh
vendored
|
@ -216,7 +216,6 @@ class Cache : public BaseCache
|
||||||
Cache(const Params *p, TagStore *tags, BasePrefetcher *prefetcher);
|
Cache(const Params *p, TagStore *tags, BasePrefetcher *prefetcher);
|
||||||
|
|
||||||
virtual Port *getPort(const std::string &if_name, int idx = -1);
|
virtual Port *getPort(const std::string &if_name, int idx = -1);
|
||||||
virtual void deletePortRefs(Port *p);
|
|
||||||
|
|
||||||
void regStats();
|
void regStats();
|
||||||
|
|
||||||
|
|
11
src/mem/cache/cache_impl.hh
vendored
11
src/mem/cache/cache_impl.hh
vendored
|
@ -114,17 +114,6 @@ Cache<TagStore>::getPort(const std::string &if_name, int idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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>
|
template<class TagStore>
|
||||||
void
|
void
|
||||||
Cache<TagStore>::cmpAndSwap(BlkType *blk, PacketPtr pkt)
|
Cache<TagStore>::cmpAndSwap(BlkType *blk, PacketPtr pkt)
|
||||||
|
|
|
@ -34,9 +34,3 @@ MemObject::MemObject(const Params *params)
|
||||||
: SimObject(params)
|
: SimObject(params)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
MemObject::deletePortRefs(Port *p)
|
|
||||||
{
|
|
||||||
panic("This object does not support port deletion\n");
|
|
||||||
}
|
|
||||||
|
|
|
@ -56,10 +56,6 @@ class MemObject : public SimObject
|
||||||
public:
|
public:
|
||||||
/** Additional function to return the Port of a memory object. */
|
/** Additional function to return the Port of a memory object. */
|
||||||
virtual Port *getPort(const std::string &if_name, int idx = -1) = 0;
|
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__
|
#endif //__MEM_MEM_OBJECT_HH__
|
||||||
|
|
|
@ -63,14 +63,6 @@ Port::setOwner(MemObject *_owner)
|
||||||
owner = _owner;
|
owner = _owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Port::removeConn()
|
|
||||||
{
|
|
||||||
if (peer != NULL)
|
|
||||||
peer->getOwner()->deletePortRefs(peer);
|
|
||||||
peer = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Port::blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd)
|
Port::blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd)
|
||||||
{
|
{
|
||||||
|
|
|
@ -123,10 +123,6 @@ class Port
|
||||||
/** Function to return the owner of this port. */
|
/** Function to return the owner of this port. */
|
||||||
MemObject *getOwner() { return owner; }
|
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; }
|
bool isConnected() { return peer != NULL; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in a new issue