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; --- 78 unchanged lines hidden (view full) --- 87 { } 88 89 /** Return port name (for DPRINTF). */ 90 const std::string &name() const { return portName; } 91 92 virtual ~Port() {}; 93 94 // mey be better to use subclasses & RTTI? |
95 /** Holds the ports status. Currently just that a range recomputation needs 96 * to be done. */ |
97 enum Status { |
98 RangeChange 99 }; 100 101 private: 102 103 /** A pointer to the peer port. Ports always come in pairs, that way they 104 can use a standardized interface to communicate between different 105 memory objects. */ --- 27 unchanged lines hidden (view full) --- 133 134 /** Called to recieve a status change from the peer port. */ 135 virtual void recvStatusChange(Status status) = 0; 136 137 /** Called by a peer port if the send was unsuccesful, and had to 138 wait. This shouldn't be valid for response paths (IO Devices). 139 so it is set to panic if it isn't already defined. 140 */ |
141 virtual void recvRetry() { panic("??"); } |
142 143 /** Called by a peer port in order to determine the block size of the 144 device connected to this port. It sometimes doesn't make sense for 145 this function to be called, a DMA interface doesn't really have a 146 block size, so it is defaulted to a panic. 147 */ 148 virtual int deviceBlockSize() { panic("??"); } 149 --- 8 unchanged lines hidden (view full) --- 158 159 public: 160 161 /** Function called by associated memory device (cache, memory, iodevice) 162 in order to send a timing request to the port. Simply calls the peer 163 port receive function. 164 @return This function returns if the send was succesful in it's 165 recieve. If it was a failure, then the port will wait for a recvRetry |
166 at which point it can possibly issue a successful sendTiming. This is used in |
167 case a cache has a higher priority request come in while waiting for 168 the bus to arbitrate. 169 */ 170 bool sendTiming(Packet *pkt) { return peer->recvTiming(pkt); } 171 172 /** Function called by the associated device to send an atomic access, 173 an access in which the data is moved and the state is updated in one 174 cycle, without interleaving with other memory accesses. --- 12 unchanged lines hidden (view full) --- 187 /** Called by the associated device to send a status change to the device 188 connected to the peer interface. 189 */ 190 void sendStatusChange(Status status) {peer->recvStatusChange(status); } 191 192 /** When a timing access doesn't return a success, some time later the 193 Retry will be sent. 194 */ |
195 void sendRetry() { return peer->recvRetry(); } |
196 197 /** Called by the associated device if it wishes to find out the blocksize 198 of the device on attached to the peer port. 199 */ 200 int peerBlockSize() { return peer->deviceBlockSize(); } 201 202 /** Called by the associated device if it wishes to find out the address 203 ranges connected to the peer ports devices. --- 65 unchanged lines hidden --- |