port.hh (8975:7f36d4436074) | port.hh (9031:32ecc0217c5e) |
---|---|
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 --- 64 unchanged lines hidden (view full) --- 73 * opposite role. 74 * 75 * Each port has a name and an owner, and enables three basic types of 76 * accesses to the peer port: functional, atomic and timing. 77 */ 78class Port 79{ 80 | 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 --- 64 unchanged lines hidden (view full) --- 73 * opposite role. 74 * 75 * Each port has a name and an owner, and enables three basic types of 76 * accesses to the peer port: functional, atomic and timing. 77 */ 78class Port 79{ 80 |
81 public: 82 83 /** A type name for the port identifier. */ 84 typedef int PortId; 85 86 /** A symbolic name for the absence of a port id. */ 87 static const PortId INVALID_PORT_ID = -1; 88 | |
89 private: 90 91 /** Descriptive name (for DPRINTF output) */ 92 std::string portName; 93 94 protected: 95 96 /** 97 * A numeric identifier to distinguish ports in a vector, and set | 81 private: 82 83 /** Descriptive name (for DPRINTF output) */ 84 std::string portName; 85 86 protected: 87 88 /** 89 * A numeric identifier to distinguish ports in a vector, and set |
98 * to INVALID_PORT_ID in case this port is not part of a vector. | 90 * to InvalidPortID in case this port is not part of a vector. |
99 */ | 91 */ |
100 const PortId id; | 92 const PortID id; |
101 102 /** A pointer to the peer port. */ 103 Port* peer; 104 105 /** A reference to the MemObject that owns this port. */ 106 MemObject& owner; 107 108 /** 109 * Abstract base class for ports 110 * 111 * @param _name Port name including the owners name 112 * @param _owner The MemObject that is the structural owner of this port 113 * @param _id A port identifier for vector ports 114 */ | 93 94 /** A pointer to the peer port. */ 95 Port* peer; 96 97 /** A reference to the MemObject that owns this port. */ 98 MemObject& owner; 99 100 /** 101 * Abstract base class for ports 102 * 103 * @param _name Port name including the owners name 104 * @param _owner The MemObject that is the structural owner of this port 105 * @param _id A port identifier for vector ports 106 */ |
115 Port(const std::string& _name, MemObject& _owner, PortId _id); | 107 Port(const std::string& _name, MemObject& _owner, PortID _id); |
116 117 /** 118 * Virtual destructor due to inheritance. 119 */ 120 virtual ~Port(); 121 122 public: 123 124 /** Return port name (for DPRINTF). */ 125 const std::string name() const { return portName; } 126 127 /** Get the port id. */ | 108 109 /** 110 * Virtual destructor due to inheritance. 111 */ 112 virtual ~Port(); 113 114 public: 115 116 /** Return port name (for DPRINTF). */ 117 const std::string name() const { return portName; } 118 119 /** Get the port id. */ |
128 PortId getId() const { return id; } | 120 PortID getId() const { return id; } |
129 130 protected: 131 132 /** 133 * Called by a peer port if sendTimingReq, sendTimingResp or 134 * sendTimingSnoopResp was unsuccesful, and had to wait. 135 */ 136 virtual void recvRetry() = 0; --- 25 unchanged lines hidden (view full) --- 162 163 private: 164 165 SlavePort* _slavePort; 166 167 public: 168 169 MasterPort(const std::string& name, MemObject* owner, | 121 122 protected: 123 124 /** 125 * Called by a peer port if sendTimingReq, sendTimingResp or 126 * sendTimingSnoopResp was unsuccesful, and had to wait. 127 */ 128 virtual void recvRetry() = 0; --- 25 unchanged lines hidden (view full) --- 154 155 private: 156 157 SlavePort* _slavePort; 158 159 public: 160 161 MasterPort(const std::string& name, MemObject* owner, |
170 PortId id = INVALID_PORT_ID); | 162 PortID id = InvalidPortID); |
171 virtual ~MasterPort(); 172 173 void bind(SlavePort& slave_port); 174 SlavePort& getSlavePort() const; 175 bool isConnected() const; 176 177 /** 178 * Send an atomic request packet, where the data is moved and the --- 121 unchanged lines hidden (view full) --- 300 301 private: 302 303 MasterPort* _masterPort; 304 305 public: 306 307 SlavePort(const std::string& name, MemObject* owner, | 163 virtual ~MasterPort(); 164 165 void bind(SlavePort& slave_port); 166 SlavePort& getSlavePort() const; 167 bool isConnected() const; 168 169 /** 170 * Send an atomic request packet, where the data is moved and the --- 121 unchanged lines hidden (view full) --- 292 293 private: 294 295 MasterPort* _masterPort; 296 297 public: 298 299 SlavePort(const std::string& name, MemObject* owner, |
308 PortId id = INVALID_PORT_ID); | 300 PortID id = InvalidPortID); |
309 virtual ~SlavePort(); 310 311 void bind(MasterPort& master_port); 312 MasterPort& getMasterPort() const; 313 bool isConnected() const; 314 315 /** 316 * Send an atomic snoop request packet, where the data is moved --- 93 unchanged lines hidden --- | 301 virtual ~SlavePort(); 302 303 void bind(MasterPort& master_port); 304 MasterPort& getMasterPort() const; 305 bool isConnected() const; 306 307 /** 308 * Send an atomic snoop request packet, where the data is moved --- 93 unchanged lines hidden --- |