projects
/
gem5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ARM: Use a stl queue for the table walker state
[gem5.git]
/
src
/
mem
/
port.hh
diff --git
a/src/mem/port.hh
b/src/mem/port.hh
index 877e0029396e62e27a071a6e275ec78ca3432195..bb74bf497a35f6667ccef0c77ee1ef8ba155aac8 100644
(file)
--- a/
src/mem/port.hh
+++ b/
src/mem/port.hh
@@
-41,12
+41,13
@@
#define __MEM_PORT_HH__
#include <list>
#define __MEM_PORT_HH__
#include <list>
-#include <inttypes.h>
#include "base/misc.hh"
#include "base/range.hh"
#include "base/misc.hh"
#include "base/range.hh"
+#include "base/types.hh"
#include "mem/packet.hh"
#include "mem/request.hh"
#include "mem/packet.hh"
#include "mem/request.hh"
+#include "sim/eventq.hh"
/** This typedef is used to clean up the parameter list of
* getDeviceAddressRanges() and getPeerAddressRanges(). It's declared
/** This typedef is used to clean up the parameter list of
* getDeviceAddressRanges() and getPeerAddressRanges(). It's declared
@@
-58,6
+59,7
@@
typedef std::list<Range<Addr> > AddrRangeList;
typedef std::list<Range<Addr> >::iterator AddrRangeIter;
typedef std::list<Range<Addr> > AddrRangeList;
typedef std::list<Range<Addr> >::iterator AddrRangeIter;
+class EventQueue;
class MemObject;
/**
class MemObject;
/**
@@
-71,10
+73,9
@@
class MemObject;
* Send accessor functions are being called from the device the port is
* associated with, and it will call the peer recv. accessor function.
*/
* Send accessor functions are being called from the device the port is
* associated with, and it will call the peer recv. accessor function.
*/
-class Port
+class Port
: public EventManager
{
{
- private:
-
+ protected:
/** Descriptive name (for DPRINTF output) */
mutable std::string portName;
/** Descriptive name (for DPRINTF output) */
mutable std::string portName;
@@
-87,11
+88,6
@@
class Port
MemObject *owner;
public:
MemObject *owner;
public:
-
- Port()
- : peer(NULL), owner(NULL)
- { }
-
/**
* Constructor.
*
/**
* Constructor.
*
@@
-100,14
+96,12
@@
class Port
* @param _owner Pointer to the MemObject that owns this port.
* Will not necessarily be set.
*/
* @param _owner Pointer to the MemObject that owns this port.
* Will not necessarily be set.
*/
- Port(const std::string &_name, MemObject *_owner = NULL)
- : portName(_name), peer(NULL), owner(_owner)
- { }
+ Port(const std::string &_name, MemObject *_owner);
/** Return port name (for DPRINTF). */
const std::string &name() const { return portName; }
/** Return port name (for DPRINTF). */
const std::string &name() const { return portName; }
- virtual ~Port()
{}
;
+ virtual ~Port();
// mey be better to use subclasses & RTTI?
/** Holds the ports status. Currently just that a range recomputation needs
// mey be better to use subclasses & RTTI?
/** Holds the ports status. Currently just that a range recomputation needs
@@
-126,7
+120,7
@@
class Port
Port *getPeer() { return peer; }
/** Function to set the owner of this port. */
Port *getPeer() { return peer; }
/** Function to set the owner of this port. */
- void setOwner(MemObject *_owner)
{ owner = _owner; }
+ void setOwner(MemObject *_owner)
;
/** Function to return the owner of this port. */
MemObject *getOwner() { return owner; }
/** Function to return the owner of this port. */
MemObject *getOwner() { return owner; }
@@
-135,6
+129,9
@@
class Port
* demise. */
void removeConn();
* demise. */
void removeConn();
+ virtual bool isDefaultPort() const { return false; }
+
+ bool isConnected() { return peer && !peer->isDefaultPort(); }
protected:
protected:
@@
-164,7
+161,7
@@
class Port
this function to be called, so it just returns 0. Anytthing that is
concerned with the size should just ignore that.
*/
this function to be called, so it just returns 0. Anytthing that is
concerned with the size should just ignore that.
*/
- virtual
int deviceBlockSize()
{ return 0; }
+ virtual
unsigned deviceBlockSize() const
{ return 0; }
/** The peer port is requesting us to reply with a list of the ranges we
are responsible for.
/** The peer port is requesting us to reply with a list of the ranges we
are responsible for.
@@
-172,7
+169,7
@@
class Port
@param snoop is a list of ranges snooped
*/
virtual void getDeviceAddressRanges(AddrRangeList &resp,
@param snoop is a list of ranges snooped
*/
virtual void getDeviceAddressRanges(AddrRangeList &resp,
-
AddrRangeList
&snoop)
+
bool
&snoop)
{ panic("??"); }
public:
{ panic("??"); }
public:
@@
-217,12
+214,12
@@
class Port
/** Called by the associated device if it wishes to find out the blocksize
of the device on attached to the peer port.
*/
/** Called by the associated device if it wishes to find out the blocksize
of the device on attached to the peer port.
*/
-
int peerBlockSize()
{ return peer->deviceBlockSize(); }
+
unsigned peerBlockSize() const
{ return peer->deviceBlockSize(); }
/** Called by the associated device if it wishes to find out the address
ranges connected to the peer ports devices.
*/
/** Called by the associated device if it wishes to find out the address
ranges connected to the peer ports devices.
*/
- void getPeerAddressRanges(AddrRangeList &resp,
AddrRangeList
&snoop)
+ void getPeerAddressRanges(AddrRangeList &resp,
bool
&snoop)
{ peer->getDeviceAddressRanges(resp, snoop); }
/** This function is a wrapper around sendFunctional()
{ peer->getDeviceAddressRanges(resp, snoop); }
/** This function is a wrapper around sendFunctional()
@@
-246,6
+243,11
@@
class Port
*/
virtual void memsetBlob(Addr addr, uint8_t val, int size);
*/
virtual void memsetBlob(Addr addr, uint8_t val, int size);
+ /** Inject a PrintReq for the given address to print the state of
+ * that address throughout the memory system. For debugging.
+ */
+ void printAddr(Addr a);
+
private:
/** Internal helper function for read/writeBlob().
private:
/** Internal helper function for read/writeBlob().