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 --- 56 unchanged lines hidden (view full) --- 65typedef std::list<Range<Addr> > AddrRangeList; 66typedef std::list<Range<Addr> >::iterator AddrRangeIter; 67 68class MemObject; 69 70/** 71 * Ports are used to interface memory objects to each other. A port is 72 * either a master or a slave and the connected peer is always of the |
73 * opposite role. Each port has a name, an owner, and an identifier. |
74 */ 75class Port 76{ 77 78 private: 79 80 /** Descriptive name (for DPRINTF output) */ 81 std::string portName; 82 83 protected: 84 85 /** 86 * A numeric identifier to distinguish ports in a vector, and set 87 * to InvalidPortID in case this port is not part of a vector. 88 */ 89 const PortID id; 90 |
91 /** A reference to the MemObject that owns this port. */ 92 MemObject& owner; 93 94 /** 95 * Abstract base class for ports 96 * 97 * @param _name Port name including the owners name 98 * @param _owner The MemObject that is the structural owner of this port --- 9 unchanged lines hidden (view full) --- 108 public: 109 110 /** Return port name (for DPRINTF). */ 111 const std::string name() const { return portName; } 112 113 /** Get the port id. */ 114 PortID getId() const { return id; } 115 |
116}; 117 118/** Forward declaration */ 119class SlavePort; 120 121/** 122 * A MasterPort is a specialisation of a port. In addition to the 123 * basic functionality of sending packets to its slave peer, it also --- 59 unchanged lines hidden (view full) --- 183 * sender must wait for a recvRetry at which point it can re-issue 184 * a sendTimingSnoopResp. 185 * 186 * @param pkt Packet to send. 187 */ 188 bool sendTimingSnoopResp(PacketPtr pkt); 189 190 /** |
191 * Send a retry to the slave port that previously attempted a 192 * sendTimingResp to this master port and failed. 193 */ 194 void sendRetry(); 195 196 /** |
197 * Determine if this master port is snooping or not. The default 198 * implementation returns false and thus tells the neighbour we 199 * are not snooping. Any master port that wants to receive snoop 200 * requests (e.g. a cache connected to a bus) has to override this 201 * function. 202 * 203 * @return true if the port should be considered a snooper 204 */ --- 43 unchanged lines hidden (view full) --- 248 * Receive a timing snoop request from the slave port. 249 */ 250 virtual void recvTimingSnoopReq(PacketPtr pkt) 251 { 252 panic("%s was not expecting a timing snoop request\n", name()); 253 } 254 255 /** |
256 * Called by the slave port if sendTimingReq or 257 * sendTimingSnoopResp was called on this master port (causing 258 * recvTimingReq and recvTimingSnoopResp to be called on the 259 * slave port) and was unsuccesful. 260 */ 261 virtual void recvRetry() = 0; 262 263 /** |
264 * Called to receive an address range change from the peer slave 265 * port. the default implementation ignored the change and does 266 * nothing. Override this function in a derived class if the owner 267 * needs to be aware of he laesddress ranges, e.g. in an 268 * interconnect component like a bus. 269 */ 270 virtual void recvRangeChange() { } 271}; --- 61 unchanged lines hidden (view full) --- 333 * by calling its corresponding receive function. Snoop requests 334 * always succeed and hence no return value is needed. 335 * 336 * @param pkt Packet to send. 337 */ 338 void sendTimingSnoopReq(PacketPtr pkt); 339 340 /** |
341 * Send a retry to the master port that previously attempted a 342 * sendTimingReq or sendTimingSnoopResp to this slave port and 343 * failed. 344 */ 345 void sendRetry(); 346 347 /** |
348 * Called by a peer port in order to determine the block size of 349 * the owner of this port. 350 */ 351 virtual unsigned deviceBlockSize() const { return 0; } 352 353 /** Called by the associated device if it wishes to find out the blocksize 354 of the device on attached to the peer port. 355 */ --- 33 unchanged lines hidden (view full) --- 389 /** 390 * Receive a timing snoop response from the master port. 391 */ 392 virtual bool recvTimingSnoopResp(PacketPtr pkt) 393 { 394 panic("%s was not expecting a timing snoop response\n", name()); 395 } 396 |
397 /** 398 * Called by the master port if sendTimingResp was called on this 399 * slave port (causing recvTimingResp to be called on the master 400 * port) and was unsuccesful. 401 */ 402 virtual void recvRetry() = 0; 403 |
404}; 405 406#endif //__MEM_PORT_HH__ |