tport.hh (4929:6db35d0c81c6) | tport.hh (5606:6da7a58b0bc8) |
---|---|
1/* 2 * Copyright (c) 2006 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; --- 94 unchanged lines hidden (view full) --- 103 104 /** Check whether we have a packet ready to go on the transmit list. */ 105 bool deferredPacketReady() 106 { return !transmitList.empty() && transmitList.front().tick <= curTick; } 107 108 Tick deferredPacketReadyTime() 109 { return transmitList.empty() ? MaxTick : transmitList.front().tick; } 110 | 1/* 2 * Copyright (c) 2006 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; --- 94 unchanged lines hidden (view full) --- 103 104 /** Check whether we have a packet ready to go on the transmit list. */ 105 bool deferredPacketReady() 106 { return !transmitList.empty() && transmitList.front().tick <= curTick; } 107 108 Tick deferredPacketReadyTime() 109 { return transmitList.empty() ? MaxTick : transmitList.front().tick; } 110 |
111 void schedSendEvent(Tick when) | 111 void 112 schedSendEvent(Tick when) |
112 { 113 if (waitingOnRetry) { 114 assert(!sendEvent->scheduled()); 115 return; 116 } 117 118 if (!sendEvent->scheduled()) { | 113 { 114 if (waitingOnRetry) { 115 assert(!sendEvent->scheduled()); 116 return; 117 } 118 119 if (!sendEvent->scheduled()) { |
119 sendEvent->schedule(when); | 120 schedule(sendEvent, when); |
120 } else if (sendEvent->when() > when) { | 121 } else if (sendEvent->when() > when) { |
121 sendEvent->reschedule(when); | 122 reschedule(sendEvent, when); |
122 } 123 } 124 125 126 /** Schedule a sendTiming() event to be called in the future. 127 * @param pkt packet to send 128 * @param absolute time (in ticks) to send packet 129 */ --- 20 unchanged lines hidden (view full) --- 150 * Simple ports generally don't care about any status 151 * changes... can always override this in cases where that's not 152 * true. */ 153 virtual void recvStatusChange(Status status) { } 154 155 156 public: 157 | 123 } 124 } 125 126 127 /** Schedule a sendTiming() event to be called in the future. 128 * @param pkt packet to send 129 * @param absolute time (in ticks) to send packet 130 */ --- 20 unchanged lines hidden (view full) --- 151 * Simple ports generally don't care about any status 152 * changes... can always override this in cases where that's not 153 * true. */ 154 virtual void recvStatusChange(Status status) { } 155 156 157 public: 158 |
158 SimpleTimingPort(std::string pname, MemObject *_owner = NULL) | 159 SimpleTimingPort(std::string pname, MemObject *_owner) |
159 : Port(pname, _owner), 160 sendEvent(new SendEvent(this)), 161 drainEvent(NULL), 162 waitingOnRetry(false) 163 {} 164 165 ~SimpleTimingPort() { delete sendEvent; } 166 --- 20 unchanged lines hidden --- | 160 : Port(pname, _owner), 161 sendEvent(new SendEvent(this)), 162 drainEvent(NULL), 163 waitingOnRetry(false) 164 {} 165 166 ~SimpleTimingPort() { delete sendEvent; } 167 --- 20 unchanged lines hidden --- |