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.
This commit is contained in:
mlebeane
2016-10-26 22:48:33 -04:00
parent de72e36619
commit 96905971f2
14 changed files with 53 additions and 28 deletions

View File

@@ -200,7 +200,7 @@ EtherSwitch::Interface::transmit()
Tick
EtherSwitch::Interface::switchingDelay()
{
Tick delay = (Tick)ceil(((double)outputFifo.front()->length
Tick delay = (Tick)ceil(((double)outputFifo.front()->simLength
* ticksPerByte) + 1.0);
if (delayVar != 0)
delay += random_mt.random<Tick>(0, delayVar);