Ethernet.py revision 1702
11689SN/Afrom m5 import * 210596Sgabeblack@google.comfrom Device import DmaDevice 312216Snikos.nikoleris@arm.comfrom Pci import PciDevice 47783SGiacomo.Gabrielli@arm.com 57783SGiacomo.Gabrielli@arm.comclass EtherInt(SimObject): 67783SGiacomo.Gabrielli@arm.com type = 'EtherInt' 77783SGiacomo.Gabrielli@arm.com abstract = True 87783SGiacomo.Gabrielli@arm.com peer = Param.EtherInt(NULL, "peer interface") 97783SGiacomo.Gabrielli@arm.com 107783SGiacomo.Gabrielli@arm.comclass EtherLink(SimObject): 117783SGiacomo.Gabrielli@arm.com type = 'EtherLink' 127783SGiacomo.Gabrielli@arm.com int1 = Param.EtherInt("interface 1") 137783SGiacomo.Gabrielli@arm.com int2 = Param.EtherInt("interface 2") 147783SGiacomo.Gabrielli@arm.com delay = Param.Latency('0us', "packet transmit delay") 152316SN/A speed = Param.NetworkBandwidth('1Gbps', "link speed") 161689SN/A dump = Param.EtherDump(NULL, "dump object") 171689SN/A 181689SN/Aclass EtherBus(SimObject): 191689SN/A type = 'EtherBus' 201689SN/A loopback = Param.Bool(True, "send packet back to the sending interface") 211689SN/A dump = Param.EtherDump(NULL, "dump object") 221689SN/A speed = Param.NetworkBandwidth('100Mbps', "bus speed in bits per second") 231689SN/A 241689SN/Aclass EtherTap(EtherInt): 251689SN/A type = 'EtherTap' 261689SN/A bufsz = Param.Int(10000, "tap buffer size") 271689SN/A dump = Param.EtherDump(NULL, "dump object") 281689SN/A port = Param.UInt16(3500, "tap port") 291689SN/A 301689SN/Aclass EtherDump(SimObject): 311689SN/A type = 'EtherDump' 321689SN/A file = Param.String("dump file") 331689SN/A 341689SN/Aclass EtherDev(DmaDevice): 351689SN/A type = 'EtherDev' 361689SN/A hardware_address = Param.EthernetAddr(NextEthernetAddr, 371689SN/A "Ethernet Hardware Address") 381689SN/A 391689SN/A dma_data_free = Param.Bool(False, "DMA of Data is free") 402665Ssaidi@eecs.umich.edu dma_desc_free = Param.Bool(False, "DMA of Descriptors is free") 412665Ssaidi@eecs.umich.edu dma_read_delay = Param.Latency('0us', "fixed delay for dma reads") 422965Sksewell@umich.edu dma_read_factor = Param.Latency('0us', "multiplier for dma reads") 431689SN/A dma_write_delay = Param.Latency('0us', "fixed delay for dma writes") 449944Smatt.horsnell@ARM.com dma_write_factor = Param.Latency('0us', "multiplier for dma writes") 459944Smatt.horsnell@ARM.com dma_no_allocate = Param.Bool(True, "Should we allocate cache on read") 461689SN/A 472292SN/A rx_filter = Param.Bool(True, "Enable Receive Filter") 489516SAli.Saidi@ARM.com rx_delay = Param.Latency('1us', "Receive Delay") 492329SN/A tx_delay = Param.Latency('1us', "Transmit Delay") 502292SN/A 513577Sgblack@eecs.umich.edu intr_delay = Param.Latency('0us', "Interrupt Delay") 5213449Sgabeblack@google.com payload_bus = Param.Bus(NULL, "The IO Bus to attach to for payload") 538229Snate@binkert.org physmem = Param.PhysicalMemory(Parent.any, "Physical Memory") 5413449Sgabeblack@google.com tlaser = Param.Turbolaser(Parent.any, "Turbolaser") 556658Snate@binkert.org 568887Sgeoffrey.blake@arm.comclass NSGigE(PciDevice): 571717SN/A type = 'NSGigE' 582292SN/A hardware_address = Param.EthernetAddr(NextEthernetAddr, 598662SAli.Saidi@ARM.com "Ethernet Hardware Address") 608229Snate@binkert.org 618229Snate@binkert.org clock = Param.Clock('100MHz', "State machine processor frequency") 628232Snate@binkert.org 638232Snate@binkert.org dma_data_free = Param.Bool(False, "DMA of Data is free") 648232Snate@binkert.org dma_desc_free = Param.Bool(False, "DMA of Descriptors is free") 659444SAndreas.Sandberg@ARM.com dma_read_delay = Param.Latency('0us', "fixed delay for dma reads") 668232Snate@binkert.org dma_read_factor = Param.Latency('0us', "multiplier for dma reads") 679527SMatt.Horsnell@arm.com dma_write_delay = Param.Latency('0us', "fixed delay for dma writes") 686221Snate@binkert.org dma_write_factor = Param.Latency('0us', "multiplier for dma writes") 698230Snate@binkert.org dma_no_allocate = Param.Bool(True, "Should we allocate cache on read") 708793Sgblack@eecs.umich.edu 712292SN/A 726221Snate@binkert.org rx_filter = Param.Bool(True, "Enable Receive Filter") 735529Snate@binkert.org rx_delay = Param.Latency('1us', "Receive Delay") 741061SN/A tx_delay = Param.Latency('1us', "Transmit Delay") 751060SN/A 7612127Sspwilson2@wisc.edu rx_fifo_size = Param.MemorySize('128kB', "max size in bytes of rxFifo") 771062SN/A tx_fifo_size = Param.MemorySize('128kB', "max size in bytes of txFifo") 782316SN/A 792316SN/A m5reg = Param.UInt32(0, "Register for m5 usage") 8012127Sspwilson2@wisc.edu 812292SN/A intr_delay = Param.Latency('0us', "Interrupt Delay in microseconds") 822292SN/A payload_bus = Param.Bus(NULL, "The IO Bus to attach to for payload") 832292SN/A physmem = Param.PhysicalMemory(Parent.any, "Physical Memory") 845529Snate@binkert.org 8513563Snikos.nikoleris@arm.comclass EtherDevInt(EtherInt): 8613563Snikos.nikoleris@arm.com type = 'EtherDevInt' 872292SN/A device = Param.EtherDev("Ethernet device of this interface") 882292SN/A 892292SN/Aclass NSGigEInt(EtherInt): 902292SN/A type = 'NSGigEInt' 912292SN/A device = Param.NSGigE("Ethernet device of this interface") 922292SN/A 935529Snate@binkert.orgclass Sinic(PciDevice): 942843Sktlim@umich.edu type = 'Sinic' 9510340Smitch.hayenga@arm.com hardware_address = Param.EthernetAddr(NextEthernetAddr, 968823Snilay@cs.wisc.edu "Ethernet Hardware Address") 979513SAli.Saidi@ARM.com 989513SAli.Saidi@ARM.com clock = Param.Clock('100MHz', "State machine processor frequency") 992292SN/A 10010172Sdam.sunwoo@arm.com dma_read_delay = Param.Latency('0us', "fixed delay for dma reads") 10110172Sdam.sunwoo@arm.com dma_read_factor = Param.Latency('0us', "multiplier for dma reads") 10210172Sdam.sunwoo@arm.com dma_write_delay = Param.Latency('0us', "fixed delay for dma writes") 10310172Sdam.sunwoo@arm.com dma_write_factor = Param.Latency('0us', "multiplier for dma writes") 10410172Sdam.sunwoo@arm.com 1052292SN/A rx_filter = Param.Bool(True, "Enable Receive Filter") 1062292SN/A rx_delay = Param.Latency('1us', "Receive Delay") 1072292SN/A tx_delay = Param.Latency('1us', "Transmit Delay") 10813563Snikos.nikoleris@arm.com 1092292SN/A rx_max_copy = Param.MemorySize('16kB', "rx max copy") 1106221Snate@binkert.org tx_max_copy = Param.MemorySize('16kB', "tx max copy") 1112292SN/A rx_fifo_size = Param.MemorySize('64kB', "max size of rx fifo") 1122292SN/A tx_fifo_size = Param.MemorySize('64kB', "max size of tx fifo") 1132292SN/A rx_fifo_threshold = Param.MemorySize('48kB', "rx fifo high threshold") 1142292SN/A tx_fifo_threshold = Param.MemorySize('16kB', "tx fifo low threshold") 11513453Srekai.gonzalezalberquilla@arm.com 1166221Snate@binkert.org intr_delay = Param.Latency('0us', "Interrupt Delay in microseconds") 1176221Snate@binkert.org payload_bus = Param.Bus(NULL, "The IO Bus to attach to for payload") 11813453Srekai.gonzalezalberquilla@arm.com physmem = Param.PhysicalMemory(Parent.any, "Physical Memory") 11913453Srekai.gonzalezalberquilla@arm.com 12013453Srekai.gonzalezalberquilla@arm.comclass SinicInt(EtherInt): 12113453Srekai.gonzalezalberquilla@arm.com type = 'SinicInt' 12213453Srekai.gonzalezalberquilla@arm.com device = Param.Sinic("Ethernet device of this interface") 12313453Srekai.gonzalezalberquilla@arm.com