etherswitch.cc (11562:a16337161285) etherswitch.cc (11701:5e7599457b97)
1/*
2 * Copyright (c) 2014 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;

--- 186 unchanged lines hidden (view full) ---

195 parent->schedule(txEvent, curTick() + switchingDelay());
196 }
197 }
198}
199
200Tick
201EtherSwitch::Interface::switchingDelay()
202{
1/*
2 * Copyright (c) 2014 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;

--- 186 unchanged lines hidden (view full) ---

195 parent->schedule(txEvent, curTick() + switchingDelay());
196 }
197 }
198}
199
200Tick
201EtherSwitch::Interface::switchingDelay()
202{
203 Tick delay = (Tick)ceil(((double)outputFifo.front()->length
203 Tick delay = (Tick)ceil(((double)outputFifo.front()->simLength
204 * ticksPerByte) + 1.0);
205 if (delayVar != 0)
206 delay += random_mt.random<Tick>(0, delayVar);
207 delay += switchDelay;
208 return delay;
209}
210
211EtherSwitch::Interface*

--- 143 unchanged lines hidden ---
204 * ticksPerByte) + 1.0);
205 if (delayVar != 0)
206 delay += random_mt.random<Tick>(0, delayVar);
207 delay += switchDelay;
208 return delay;
209}
210
211EtherSwitch::Interface*

--- 143 unchanged lines hidden ---