#define __MEM_XBAR_HH__
#include <deque>
+#include <unordered_map>
#include "base/addr_range_map.hh"
-#include "base/hashmap.hh"
#include "base/types.hh"
#include "mem/mem_object.hh"
+#include "mem/qport.hh"
#include "params/BaseXBar.hh"
#include "sim/stats.hh"
*
* @return 1 if busy or waiting to retry, or 0 if idle
*/
- unsigned int drain(DrainManager *dm);
+ DrainState drain() override;
/**
* Get the crossbar layer's name
/** track the state of the layer */
State state;
- /** manager to signal when drained */
- DrainManager *drainManager;
-
/**
* A deque of ports that retry should be called on because
* the original send was delayed due to a busy layer.
void releaseLayer();
/** event used to schedule a release of the layer */
- EventWrapper<Layer, &Layer::releaseLayer> releaseEvent;
+ EventFunctionWrapper releaseEvent;
/**
* Stats for occupancy and utilization. These stats capture
* the underlying Request pointer inside the Packet stays
* constant.
*/
- m5::unordered_map<RequestPtr, PortID> routeTo;
+ std::unordered_map<RequestPtr, PortID> routeTo;
/** all contigous ranges seen by this crossbar */
AddrRangeList xbarRanges;
*
* @param master_port_id id of the port that received the change
*/
- void recvRangeChange(PortID master_port_id);
+ virtual void recvRangeChange(PortID master_port_id);
/** Find which port connected to this crossbar (if any) should be
* given a packet with this address.
bool gotAllAddrRanges;
/** The master and slave ports of the crossbar */
- std::vector<SlavePort*> slavePorts;
+ std::vector<QueuedSlavePort*> slavePorts;
std::vector<MasterPort*> masterPorts;
/** Port that handles requests that don't match any of the interfaces.*/
BaseXBar(const BaseXBarParams *p);
- virtual ~BaseXBar();
-
/**
* Stats for transaction distribution and data passing through the
* crossbar. The transaction distribution is globally counting
public:
+ virtual ~BaseXBar();
+
virtual void init();
/** A function used to return the port associated with this object. */
BaseSlavePort& getSlavePort(const std::string& if_name,
PortID idx = InvalidPortID);
- virtual unsigned int drain(DrainManager *dm) = 0;
-
virtual void regStats();
};