Ethernet.py revision 1692
1from m5 import * 2from Device import DmaDevice 3from Pci import PciDevice 4 5class EtherInt(SimObject): 6 type = 'EtherInt' 7 abstract = True 8 peer = Param.EtherInt(NULL, "peer interface") 9 10class EtherLink(SimObject): 11 type = 'EtherLink' 12 int1 = Param.EtherInt("interface 1") 13 int2 = Param.EtherInt("interface 2") 14 delay = Param.Latency('0us', "packet transmit delay") 15 speed = Param.NetworkBandwidth('100Mbps', "link speed") 16 dump = Param.EtherDump(NULL, "dump object") 17 18class EtherBus(SimObject): 19 type = 'EtherBus' 20 loopback = Param.Bool(True, "send packet back to the sending interface") 21 dump = Param.EtherDump(NULL, "dump object") 22 speed = Param.NetworkBandwidth('100Mbps', "bus speed in bits per second") 23 24class EtherTap(EtherInt): 25 type = 'EtherTap' 26 bufsz = Param.Int(10000, "tap buffer size") 27 dump = Param.EtherDump(NULL, "dump object") 28 port = Param.UInt16(3500, "tap port") 29 30class EtherDump(SimObject): 31 type = 'EtherDump' 32 file = Param.String("dump file") 33 34class EtherDev(DmaDevice): 35 type = 'EtherDev' 36 hardware_address = Param.EthernetAddr(NextEthernetAddr, 37 "Ethernet Hardware Address") 38 39 dma_data_free = Param.Bool(False, "DMA of Data is free") 40 dma_desc_free = Param.Bool(False, "DMA of Descriptors is free") 41 dma_read_delay = Param.Latency('0us', "fixed delay for dma reads") 42 dma_read_factor = Param.Latency('0us', "multiplier for dma reads") 43 dma_write_delay = Param.Latency('0us', "fixed delay for dma writes") 44 dma_write_factor = Param.Latency('0us', "multiplier for dma writes") 45 dma_no_allocate = Param.Bool(True, "Should we allocate cache on read") 46 47 rx_filter = Param.Bool(True, "Enable Receive Filter") 48 rx_delay = Param.Latency('1us', "Receive Delay") 49 tx_delay = Param.Latency('1us', "Transmit Delay") 50 51 intr_delay = Param.Latency('0us', "Interrupt Delay") 52 payload_bus = Param.Bus(NULL, "The IO Bus to attach to for payload") 53 physmem = Param.PhysicalMemory(Parent.any, "Physical Memory") 54 tlaser = Param.Turbolaser(Parent.any, "Turbolaser") 55 56class NSGigE(PciDevice): 57 type = 'NSGigE' 58 hardware_address = Param.EthernetAddr(NextEthernetAddr, 59 "Ethernet Hardware Address") 60 61 cycle_time = Param.Frequency('100MHz', "State machine processor frequency") 62 63 dma_data_free = Param.Bool(False, "DMA of Data is free") 64 dma_desc_free = Param.Bool(False, "DMA of Descriptors is free") 65 dma_read_delay = Param.Latency('0us', "fixed delay for dma reads") 66 dma_read_factor = Param.Latency('0us', "multiplier for dma reads") 67 dma_write_delay = Param.Latency('0us', "fixed delay for dma writes") 68 dma_write_factor = Param.Latency('0us', "multiplier for dma writes") 69 dma_no_allocate = Param.Bool(True, "Should we allocate cache on read") 70 71 72 rx_filter = Param.Bool(True, "Enable Receive Filter") 73 rx_delay = Param.Latency('1us', "Receive Delay") 74 tx_delay = Param.Latency('1us', "Transmit Delay") 75 76 rx_fifo_size = Param.MemorySize('128kB', "max size in bytes of rxFifo") 77 tx_fifo_size = Param.MemorySize('128kB', "max size in bytes of txFifo") 78 79 m5reg = Param.UInt32(0, "Register for m5 usage") 80 81 intr_delay = Param.Latency('0us', "Interrupt Delay in microseconds") 82 payload_bus = Param.Bus(NULL, "The IO Bus to attach to for payload") 83 physmem = Param.PhysicalMemory(Parent.any, "Physical Memory") 84 85class EtherDevInt(EtherInt): 86 type = 'EtherDevInt' 87 device = Param.EtherDev("Ethernet device of this interface") 88 89class NSGigEInt(EtherInt): 90 type = 'NSGigEInt' 91 device = Param.NSGigE("Ethernet device of this interface") 92 93class Sinic(PciDevice): 94 type = 'Sinic' 95 hardware_address = Param.EthernetAddr(NextEthernetAddr, 96 "Ethernet Hardware Address") 97 98 cycle_time = Param.Frequency('100MHz', "State machine processor frequency") 99 100 dma_read_delay = Param.Latency('0us', "fixed delay for dma reads") 101 dma_read_factor = Param.Latency('0us', "multiplier for dma reads") 102 dma_write_delay = Param.Latency('0us', "fixed delay for dma writes") 103 dma_write_factor = Param.Latency('0us', "multiplier for dma writes") 104 105 rx_filter = Param.Bool(True, "Enable Receive Filter") 106 rx_delay = Param.Latency('1us', "Receive Delay") 107 tx_delay = Param.Latency('1us', "Transmit Delay") 108 109 rx_max_copy = Param.MemorySize('16kB', "rx max copy") 110 tx_max_copy = Param.MemorySize('16kB', "tx max copy") 111 rx_fifo_size = Param.MemorySize('64kB', "max size of rx fifo") 112 tx_fifo_size = Param.MemorySize('64kB', "max size of tx fifo") 113 rx_fifo_threshold = Param.MemorySize('48kB', "rx fifo high threshold") 114 tx_fifo_threshold = Param.MemorySize('16kB', "tx fifo low threshold") 115 116 intr_delay = Param.Latency('0us', "Interrupt Delay in microseconds") 117 payload_bus = Param.Bus(NULL, "The IO Bus to attach to for payload") 118 physmem = Param.PhysicalMemory(Parent.any, "Physical Memory") 119 120class SinicInt(EtherInt): 121 type = 'SinicInt' 122 device = Param.Sinic("Ethernet device of this interface") 123