Ethernet.py revision 1634
1from Device import DmaDevice
2from Pci import PciDevice
3
4simobj EtherInt(SimObject):
5    type = 'EtherInt'
6    abstract = True
7    peer = Param.EtherInt(NULL, "peer interface")
8
9simobj EtherLink(SimObject):
10    type = 'EtherLink'
11    int1 = Param.EtherInt("interface 1")
12    int2 = Param.EtherInt("interface 2")
13    delay = Param.Latency('0us', "packet transmit delay")
14    speed = Param.NetworkBandwidth('100Mbps', "link speed")
15    dump = Param.EtherDump(NULL, "dump object")
16
17simobj EtherBus(SimObject):
18    type = 'EtherBus'
19    loopback = Param.Bool(True, "send packet back to the sending interface")
20    dump = Param.EtherDump(NULL, "dump object")
21    speed = Param.NetworkBandwidth('100Mbps', "bus speed in bits per second")
22
23simobj EtherTap(EtherInt):
24    type = 'EtherTap'
25    bufsz = Param.Int(10000, "tap buffer size")
26    dump = Param.EtherDump(NULL, "dump object")
27    port = Param.UInt16(3500, "tap port")
28
29simobj EtherDump(SimObject):
30    type = 'EtherDump'
31    file = Param.String("dump file")
32
33simobj EtherDev(DmaDevice):
34    type = 'EtherDev'
35    hardware_address = Param.EthernetAddr(NextEthernetAddr,
36        "Ethernet Hardware Address")
37
38    dma_data_free = Param.Bool(False, "DMA of Data is free")
39    dma_desc_free = Param.Bool(False, "DMA of Descriptors is free")
40    dma_read_delay = Param.Latency('0us', "fixed delay for dma reads")
41    dma_read_factor = Param.Latency('0us', "multiplier for dma reads")
42    dma_write_delay = Param.Latency('0us', "fixed delay for dma writes")
43    dma_write_factor = Param.Latency('0us', "multiplier for dma writes")
44
45    rx_filter = Param.Bool(True, "Enable Receive Filter")
46    rx_delay = Param.Latency('1us', "Receive Delay")
47    tx_delay = Param.Latency('1us', "Transmit Delay")
48
49    intr_delay = Param.Latency('0us', "Interrupt Delay")
50    payload_bus = Param.Bus(NULL, "The IO Bus to attach to for payload")
51    physmem = Param.PhysicalMemory(parent.any, "Physical Memory")
52    tlaser = Param.Turbolaser(parent.any, "Turbolaser")
53
54simobj NSGigE(PciDevice):
55    type = 'NSGigE'
56    hardware_address = Param.EthernetAddr(NextEthernetAddr,
57        "Ethernet Hardware Address")
58
59    cycle_time = Param.Frequency('100MHz', "State machine processor frequency")
60
61    dma_data_free = Param.Bool(False, "DMA of Data is free")
62    dma_desc_free = Param.Bool(False, "DMA of Descriptors is free")
63    dma_read_delay = Param.Latency('0us', "fixed delay for dma reads")
64    dma_read_factor = Param.Latency('0us', "multiplier for dma reads")
65    dma_write_delay = Param.Latency('0us', "fixed delay for dma writes")
66    dma_write_factor = Param.Latency('0us', "multiplier for dma writes")
67
68    rx_filter = Param.Bool(True, "Enable Receive Filter")
69    rx_delay = Param.Latency('1us', "Receive Delay")
70    tx_delay = Param.Latency('1us', "Transmit Delay")
71
72    rx_fifo_size = Param.MemorySize('128kB', "max size in bytes of rxFifo")
73    tx_fifo_size = Param.MemorySize('128kB', "max size in bytes of txFifo")
74
75    intr_delay = Param.Latency('0us', "Interrupt Delay in microseconds")
76    payload_bus = Param.Bus(NULL, "The IO Bus to attach to for payload")
77    physmem = Param.PhysicalMemory(parent.any, "Physical Memory")
78
79simobj EtherDevInt(EtherInt):
80    type = 'EtherDevInt'
81    device = Param.EtherDev("Ethernet device of this interface")
82
83simobj NSGigEInt(EtherInt):
84    type = 'NSGigEInt'
85    device = Param.NSGigE("Ethernet device of this interface")
86
87
88