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 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 |
90 * to InvalidPortID in case this port is not part of a vector. |
91 */ |
92 const PortID id; |
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 */ |
107 Port(const std::string& _name, MemObject& _owner, PortID _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. */ |
120 PortID getId() const { return id; } |
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, |
162 PortID id = InvalidPortID); |
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, |
300 PortID id = InvalidPortID); |
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 --- |