port.hh (5314:e902f12a3af1) | port.hh (5476:758c2413765a) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 59 unchanged lines hidden (view full) --- 68 * have to be created. 69 * 70 * Recv accesor functions are being called from the peer interface. 71 * Send accessor functions are being called from the device the port is 72 * associated with, and it will call the peer recv. accessor function. 73 */ 74class Port 75{ | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 59 unchanged lines hidden (view full) --- 68 * have to be created. 69 * 70 * Recv accesor functions are being called from the peer interface. 71 * Send accessor functions are being called from the device the port is 72 * associated with, and it will call the peer recv. accessor function. 73 */ 74class Port 75{ |
76 private: 77 | 76 protected: |
78 /** Descriptive name (for DPRINTF output) */ 79 mutable std::string portName; 80 81 /** A pointer to the peer port. Ports always come in pairs, that way they 82 can use a standardized interface to communicate between different 83 memory objects. */ 84 Port *peer; 85 --- 12 unchanged lines hidden (view full) --- 98 * @param _owner Pointer to the MemObject that owns this port. 99 * Will not necessarily be set. 100 */ 101 Port(const std::string &_name, MemObject *_owner = NULL); 102 103 /** Return port name (for DPRINTF). */ 104 const std::string &name() const { return portName; } 105 | 77 /** Descriptive name (for DPRINTF output) */ 78 mutable std::string portName; 79 80 /** A pointer to the peer port. Ports always come in pairs, that way they 81 can use a standardized interface to communicate between different 82 memory objects. */ 83 Port *peer; 84 --- 12 unchanged lines hidden (view full) --- 97 * @param _owner Pointer to the MemObject that owns this port. 98 * Will not necessarily be set. 99 */ 100 Port(const std::string &_name, MemObject *_owner = NULL); 101 102 /** Return port name (for DPRINTF). */ 103 const std::string &name() const { return portName; } 104 |
106 virtual ~Port() {}; | 105 virtual ~Port(); |
107 108 // mey be better to use subclasses & RTTI? 109 /** Holds the ports status. Currently just that a range recomputation needs 110 * to be done. */ 111 enum Status { 112 RangeChange 113 }; 114 --- 11 unchanged lines hidden (view full) --- 126 127 /** Function to return the owner of this port. */ 128 MemObject *getOwner() { return owner; } 129 130 /** Inform the peer port to delete itself and notify it's owner about it's 131 * demise. */ 132 void removeConn(); 133 | 106 107 // mey be better to use subclasses & RTTI? 108 /** Holds the ports status. Currently just that a range recomputation needs 109 * to be done. */ 110 enum Status { 111 RangeChange 112 }; 113 --- 11 unchanged lines hidden (view full) --- 125 126 /** Function to return the owner of this port. */ 127 MemObject *getOwner() { return owner; } 128 129 /** Inform the peer port to delete itself and notify it's owner about it's 130 * demise. */ 131 void removeConn(); 132 |
134 virtual bool isDefaultPort() { return false; } | 133 virtual bool isDefaultPort() const { return false; } |
135 | 134 |
135 bool isConnected() { return peer && !peer->isDefaultPort(); } 136 |
|
136 protected: 137 138 /** These functions are protected because they should only be 139 * called by a peer port, never directly by any outside object. */ 140 141 /** Called to recive a timing call from the peer port. */ 142 virtual bool recvTiming(PacketPtr pkt) = 0; 143 --- 159 unchanged lines hidden --- | 137 protected: 138 139 /** These functions are protected because they should only be 140 * called by a peer port, never directly by any outside object. */ 141 142 /** Called to recive a timing call from the peer port. */ 143 virtual bool recvTiming(PacketPtr pkt) = 0; 144 --- 159 unchanged lines hidden --- |