port.hh (8948:e95ee70f876c) | port.hh (8965:1ebd7c856abc) |
---|---|
1/* 2 * Copyright (c) 2011-2012 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 65 unchanged lines hidden (view full) --- 74 * 75 * Each port has a name and an owner, and enables three basic types of 76 * accesses to the peer port: sendFunctional, sendAtomic and 77 * sendTiming. 78 */ 79class Port 80{ 81 | 1/* 2 * Copyright (c) 2011-2012 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 65 unchanged lines hidden (view full) --- 74 * 75 * Each port has a name and an owner, and enables three basic types of 76 * accesses to the peer port: sendFunctional, sendAtomic and 77 * sendTiming. 78 */ 79class Port 80{ 81 |
82 public: 83 84 /** A type name for the port identifier. */ 85 typedef int PortId; 86 87 /** A symbolic name for the absence of a port id. */ 88 static const PortId INVALID_PORT_ID = -1; 89 |
|
82 private: 83 84 /** Descriptive name (for DPRINTF output) */ 85 std::string portName; 86 87 protected: 88 | 90 private: 91 92 /** Descriptive name (for DPRINTF output) */ 93 std::string portName; 94 95 protected: 96 |
97 /** 98 * A numeric identifier to distinguish ports in a vector, and set 99 * to INVALID_PORT_ID in case this port is not part of a vector. 100 */ 101 const PortId id; 102 |
|
89 /** A pointer to the peer port. */ 90 Port* peer; 91 92 /** A reference to the MemObject that owns this port. */ 93 MemObject& owner; 94 95 /** 96 * Abstract base class for ports 97 * 98 * @param _name Port name including the owners name 99 * @param _owner The MemObject that is the structural owner of this port | 103 /** A pointer to the peer port. */ 104 Port* peer; 105 106 /** A reference to the MemObject that owns this port. */ 107 MemObject& owner; 108 109 /** 110 * Abstract base class for ports 111 * 112 * @param _name Port name including the owners name 113 * @param _owner The MemObject that is the structural owner of this port |
114 * @param _id A port identifier for vector ports |
|
100 */ | 115 */ |
101 Port(const std::string& _name, MemObject& _owner); | 116 Port(const std::string& _name, MemObject& _owner, PortId _id); |
102 103 /** 104 * Virtual destructor due to inheritance. 105 */ 106 virtual ~Port(); 107 108 public: 109 110 /** Return port name (for DPRINTF). */ 111 const std::string name() const { return portName; } 112 | 117 118 /** 119 * Virtual destructor due to inheritance. 120 */ 121 virtual ~Port(); 122 123 public: 124 125 /** Return port name (for DPRINTF). */ 126 const std::string name() const { return portName; } 127 |
128 /** Get the port id. */ 129 PortId getId() const { return id; } 130 |
|
113 protected: 114 115 /** These functions are protected because they should only be 116 * called by a peer port, never directly by any outside object. */ 117 118 /** 119 * Receive a timing request or response packet from the peer port. 120 */ --- 64 unchanged lines hidden (view full) --- 185{ 186 187 private: 188 189 SlavePort* _slavePort; 190 191 public: 192 | 131 protected: 132 133 /** These functions are protected because they should only be 134 * called by a peer port, never directly by any outside object. */ 135 136 /** 137 * Receive a timing request or response packet from the peer port. 138 */ --- 64 unchanged lines hidden (view full) --- 203{ 204 205 private: 206 207 SlavePort* _slavePort; 208 209 public: 210 |
193 MasterPort(const std::string& name, MemObject* owner); | 211 MasterPort(const std::string& name, MemObject* owner, 212 PortId id = INVALID_PORT_ID); |
194 virtual ~MasterPort(); 195 196 void bind(SlavePort& slave_port); 197 SlavePort& getSlavePort() const; 198 bool isConnected() const; 199 200 /** 201 * Send an atomic request packet, where the data is moved and the --- 79 unchanged lines hidden (view full) --- 281{ 282 283 private: 284 285 MasterPort* _masterPort; 286 287 public: 288 | 213 virtual ~MasterPort(); 214 215 void bind(SlavePort& slave_port); 216 SlavePort& getSlavePort() const; 217 bool isConnected() const; 218 219 /** 220 * Send an atomic request packet, where the data is moved and the --- 79 unchanged lines hidden (view full) --- 300{ 301 302 private: 303 304 MasterPort* _masterPort; 305 306 public: 307 |
289 SlavePort(const std::string& name, MemObject* owner); | 308 SlavePort(const std::string& name, MemObject* owner, 309 PortId id = INVALID_PORT_ID); |
290 virtual ~SlavePort(); 291 292 void bind(MasterPort& master_port); 293 MasterPort& getMasterPort() const; 294 bool isConnected() const; 295 296 /** 297 * Send an atomic snoop request packet, where the data is moved --- 55 unchanged lines hidden --- | 310 virtual ~SlavePort(); 311 312 void bind(MasterPort& master_port); 313 MasterPort& getMasterPort() const; 314 bool isConnected() const; 315 316 /** 317 * Send an atomic snoop request packet, where the data is moved --- 55 unchanged lines hidden --- |