tport.cc (7510:fb7fc9aca918) | tport.cc (7823:dac01f14f20f) |
---|---|
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; --- 81 unchanged lines hidden (view full) --- 90 91 bool needsResponse = pkt->needsResponse(); 92 Tick latency = recvAtomic(pkt); 93 // turn packet around to go back to requester if response expected 94 if (needsResponse) { 95 // recvAtomic() should already have turned packet into 96 // atomic response 97 assert(pkt->isResponse()); | 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; --- 81 unchanged lines hidden (view full) --- 90 91 bool needsResponse = pkt->needsResponse(); 92 Tick latency = recvAtomic(pkt); 93 // turn packet around to go back to requester if response expected 94 if (needsResponse) { 95 // recvAtomic() should already have turned packet into 96 // atomic response 97 assert(pkt->isResponse()); |
98 schedSendTiming(pkt, curTick + latency); | 98 schedSendTiming(pkt, curTick() + latency); |
99 } else { 100 delete pkt; 101 } 102 103 return true; 104} 105 106 107void 108SimpleTimingPort::schedSendTiming(PacketPtr pkt, Tick when) 109{ | 99 } else { 100 delete pkt; 101 } 102 103 return true; 104} 105 106 107void 108SimpleTimingPort::schedSendTiming(PacketPtr pkt, Tick when) 109{ |
110 assert(when > curTick); 111 assert(when < curTick + SimClock::Int::ms); | 110 assert(when > curTick()); 111 assert(when < curTick() + SimClock::Int::ms); |
112 113 // Nothing is on the list: add it and schedule an event 114 if (transmitList.empty() || when < transmitList.front().tick) { 115 transmitList.push_front(DeferredPacket(when, pkt)); 116 schedSendEvent(when); 117 return; 118 } 119 --- 27 unchanged lines hidden (view full) --- 147 // we get confused by having a non-active packet on transmitList 148 DeferredPacket dp = transmitList.front(); 149 transmitList.pop_front(); 150 bool success = sendTiming(dp.pkt); 151 152 if (success) { 153 if (!transmitList.empty() && !sendEvent->scheduled()) { 154 Tick time = transmitList.front().tick; | 112 113 // Nothing is on the list: add it and schedule an event 114 if (transmitList.empty() || when < transmitList.front().tick) { 115 transmitList.push_front(DeferredPacket(when, pkt)); 116 schedSendEvent(when); 117 return; 118 } 119 --- 27 unchanged lines hidden (view full) --- 147 // we get confused by having a non-active packet on transmitList 148 DeferredPacket dp = transmitList.front(); 149 transmitList.pop_front(); 150 bool success = sendTiming(dp.pkt); 151 152 if (success) { 153 if (!transmitList.empty() && !sendEvent->scheduled()) { 154 Tick time = transmitList.front().tick; |
155 schedule(sendEvent, time <= curTick ? curTick+1 : time); | 155 schedule(sendEvent, time <= curTick() ? curTick()+1 : time); |
156 } 157 158 if (transmitList.empty() && drainEvent && !sendEvent->scheduled()) { 159 drainEvent->process(); 160 drainEvent = NULL; 161 } 162 } else { 163 // Unsuccessful, need to put back on transmitList. Callee --- 39 unchanged lines hidden --- | 156 } 157 158 if (transmitList.empty() && drainEvent && !sendEvent->scheduled()) { 159 drainEvent->process(); 160 drainEvent = NULL; 161 } 162 } else { 163 // Unsuccessful, need to put back on transmitList. Callee --- 39 unchanged lines hidden --- |