diff options
author | mlebeane <michael.lebeane@amd.com> | 2016-10-26 22:48:33 -0400 |
---|---|---|
committer | mlebeane <michael.lebeane@amd.com> | 2016-10-26 22:48:33 -0400 |
commit | 96905971f26e5218baebf8f953f05a9b341f9cc6 (patch) | |
tree | 4f2d06b18a4fc4bc92a4303e02e5c7668e2ec043 /src/dev/net/etherlink.cc | |
parent | de72e36619350f9b3e3a3dc8de63b490c4cecf2d (diff) | |
download | gem5-96905971f26e5218baebf8f953f05a9b341f9cc6.tar.xz |
dev: Add 'simLength' parameter in EthPacketData
Currently, all the network devices create a 16K buffer for the 'data' field
in EthPacketData, and use 'length' to keep track of the size of the packet
in the buffer. This patch introduces the 'simLength' parameter to
EthPacketData, which is used to hold the effective length of the packet used
for all timing calulations in the simulator. Serialization is performed using
only the useful data in the packet ('length') and not necessarily the entire
original buffer.
Diffstat (limited to 'src/dev/net/etherlink.cc')
-rw-r--r-- | src/dev/net/etherlink.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dev/net/etherlink.cc b/src/dev/net/etherlink.cc index c327a0168..0975ba446 100644 --- a/src/dev/net/etherlink.cc +++ b/src/dev/net/etherlink.cc @@ -192,7 +192,7 @@ EtherLink::Link::transmit(EthPacketPtr pkt) DDUMP(EthernetData, pkt->data, pkt->length); packet = pkt; - Tick delay = (Tick)ceil(((double)pkt->length * ticksPerByte) + 1.0); + Tick delay = (Tick)ceil(((double)pkt->simLength * ticksPerByte) + 1.0); if (delayVar != 0) delay += random_mt.random<Tick>(0, delayVar); @@ -235,7 +235,7 @@ EtherLink::Link::unserialize(const string &base, CheckpointIn &cp) bool packet_exists; paramIn(cp, base + ".packet_exists", packet_exists); if (packet_exists) { - packet = make_shared<EthPacketData>(16384); + packet = make_shared<EthPacketData>(); packet->unserialize(base + ".packet", cp); } @@ -251,7 +251,7 @@ EtherLink::Link::unserialize(const string &base, CheckpointIn &cp) if (optParamIn(cp, base + ".tx_queue_size", tx_queue_size)) { for (size_t idx = 0; idx < tx_queue_size; ++idx) { Tick tick; - EthPacketPtr delayed_packet = make_shared<EthPacketData>(16384); + EthPacketPtr delayed_packet = make_shared<EthPacketData>(); paramIn(cp, csprintf("%s.txQueue[%i].tick", base, idx), tick); delayed_packet->unserialize( |