dist_etherlink.cc (11290:1640dd68b0a4) | dist_etherlink.cc (11701:5e7599457b97) |
---|---|
1/* 2 * Copyright (c) 2015 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 --- 183 unchanged lines hidden (view full) --- 192DistEtherLink::TxLink::transmit(EthPacketPtr pkt) 193{ 194 if (busy()) { 195 DPRINTF(DistEthernet, "packet not sent, link busy\n"); 196 return false; 197 } 198 199 packet = pkt; | 1/* 2 * Copyright (c) 2015 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 --- 183 unchanged lines hidden (view full) --- 192DistEtherLink::TxLink::transmit(EthPacketPtr pkt) 193{ 194 if (busy()) { 195 DPRINTF(DistEthernet, "packet not sent, link busy\n"); 196 return false; 197 } 198 199 packet = pkt; |
200 Tick delay = (Tick)ceil(((double)pkt->length * ticksPerByte) + 1.0); | 200 Tick delay = (Tick)ceil(((double)pkt->simLength * ticksPerByte) + 1.0); |
201 if (delayVar != 0) 202 delay += random_mt.random<Tick>(0, delayVar); 203 204 // send the packet to the peers 205 assert(distIface); 206 distIface->packetOut(pkt, delay); 207 208 // schedule the send done event --- 19 unchanged lines hidden (view full) --- 228} 229 230void 231DistEtherLink::Link::unserialize(CheckpointIn &cp) 232{ 233 bool packet_exists; 234 UNSERIALIZE_SCALAR(packet_exists); 235 if (packet_exists) { | 201 if (delayVar != 0) 202 delay += random_mt.random<Tick>(0, delayVar); 203 204 // send the packet to the peers 205 assert(distIface); 206 distIface->packetOut(pkt, delay); 207 208 // schedule the send done event --- 19 unchanged lines hidden (view full) --- 228} 229 230void 231DistEtherLink::Link::unserialize(CheckpointIn &cp) 232{ 233 bool packet_exists; 234 UNSERIALIZE_SCALAR(packet_exists); 235 if (packet_exists) { |
236 packet = make_shared<EthPacketData>(16384); | 236 packet = make_shared |
237 packet->unserialize("packet", cp); 238 } 239 240 bool event_scheduled; 241 UNSERIALIZE_SCALAR(event_scheduled); 242 if (event_scheduled) { 243 Tick event_time; 244 UNSERIALIZE_SCALAR(event_time); --- 23 unchanged lines hidden --- | 237 packet->unserialize("packet", cp); 238 } 239 240 bool event_scheduled; 241 UNSERIALIZE_SCALAR(event_scheduled); 242 if (event_scheduled) { 243 Tick event_time; 244 UNSERIALIZE_SCALAR(event_time); --- 23 unchanged lines hidden --- |