diff -r 73704b98a61d -r fa72e0042d89 src/dev/EtherDevice.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dev/EtherDevice.py Mon Aug 19 10:34:12 2013 +0100 @@ -0,0 +1,97 @@ +# Copyright (c) 2005-2007 The Regents of The University of Michigan +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Nathan Binkert + +from m5.SimObject import SimObject +from m5.params import * +from m5.proxy import * +from Pci import PciDevice + +class EtherObject(SimObject): + type = 'EtherObject' + abstract = True + cxx_header = "dev/etherobject.hh" + +class EtherLink(EtherObject): + type = 'EtherLink' + cxx_header = "dev/etherlink.hh" + int0 = SlavePort("interface 0") + int1 = SlavePort("interface 1") + delay = Param.Latency('0us', "packet transmit delay") + delay_var = Param.Latency('0ns', "packet transmit delay variability") + speed = Param.NetworkBandwidth('1Gbps', "link speed") + dump = Param.EtherDump(NULL, "dump object") + +class EtherBus(EtherObject): + type = 'EtherBus' + cxx_header = "dev/etherbus.hh" + loopback = Param.Bool(True, "send packet back to the sending interface") + dump = Param.EtherDump(NULL, "dump object") + speed = Param.NetworkBandwidth('100Mbps', "bus speed in bits per second") + +class EtherTap(EtherObject): + type = 'EtherTap' + cxx_header = "dev/ethertap.hh" + bufsz = Param.Int(10000, "tap buffer size") + dump = Param.EtherDump(NULL, "dump object") + port = Param.UInt16(3500, "tap port") + +class EtherDump(SimObject): + type = 'EtherDump' + cxx_header = "dev/etherdump.hh" + file = Param.String("dump file") + maxlen = Param.Int(96, "max portion of packet data to dump") + +class EtherDevice(PciDevice): + type = 'EtherDevice' + abstract = True + cxx_header = "dev/etherdevice.hh" + interface = MasterPort("Ethernet Interface") + +class EtherDevBase(EtherDevice): + type = 'EtherDevBase' + abstract = True + cxx_header = "dev/etherdevice.hh" + + hardware_address = Param.EthernetAddr(NextEthernetAddr, + "Ethernet Hardware Address") + + dma_read_delay = Param.Latency('0us', "fixed delay for dma reads") + dma_read_factor = Param.Latency('0us', "multiplier for dma reads") + dma_write_delay = Param.Latency('0us', "fixed delay for dma writes") + dma_write_factor = Param.Latency('0us', "multiplier for dma writes") + + rx_delay = Param.Latency('1us', "Receive Delay") + tx_delay = Param.Latency('1us', "Transmit Delay") + rx_fifo_size = Param.MemorySize('512kB', "max size of rx fifo") + tx_fifo_size = Param.MemorySize('512kB', "max size of tx fifo") + + rx_filter = Param.Bool(True, "Enable Receive Filter") + intr_delay = Param.Latency('10us', "Interrupt propagation delay") + rx_thread = Param.Bool(False, "dedicated kernel thread for transmit") + tx_thread = Param.Bool(False, "dedicated kernel threads for receive") + rss = Param.Bool(False, "Receive Side Scaling") diff -r 73704b98a61d -r fa72e0042d89 src/dev/SConscript --- a/src/dev/SConscript Mon Aug 19 10:34:04 2013 +0100 +++ b/src/dev/SConscript Mon Aug 19 10:34:12 2013 +0100 @@ -38,6 +38,7 @@ SimObject('CopyEngine.py') SimObject('Device.py') SimObject('DiskImage.py') +SimObject('EtherDevice.py') SimObject('Ethernet.py') SimObject('Ide.py') SimObject('Pci.py')