From d7c7fd350ce56346409b1883dea564615bc8e6cd Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 30 Jan 2015 19:34:13 +0100 Subject: [PATCH] clean up --- liteeth/__init__.py | 2 -- liteeth/mac/__init__.py | 2 +- liteeth/mac/common.py | 0 liteeth/mac/core/__init__.py | 1 - liteeth/mac/core/crc.py | 1 - liteeth/mac/core/last_be.py | 1 - liteeth/mac/core/preamble.py | 1 - liteeth/mac/frontend/sram.py | 1 - liteeth/mac/frontend/wishbone.py | 1 - liteeth/test/arp_tb.py | 6 +++--- liteeth/test/mac_core_tb.py | 2 +- liteeth/test/mac_wishbone_tb.py | 2 +- liteeth/test/model/arp.py | 3 +-- liteeth/test/model/ip.py | 5 ++--- liteeth/test/model/mac.py | 1 - liteeth/test/model/phy.py | 1 - 16 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 liteeth/mac/common.py diff --git a/liteeth/__init__.py b/liteeth/__init__.py index 849f23417..3a2180598 100644 --- a/liteeth/__init__.py +++ b/liteeth/__init__.py @@ -1,6 +1,4 @@ from liteeth.common import * -from liteeth.generic.arbiter import Arbiter -from liteeth.generic.dispatcher import Dispatcher from liteeth.mac import LiteEthMAC from liteeth.arp import LiteEthARP from liteeth.ip import LiteEthIP diff --git a/liteeth/mac/__init__.py b/liteeth/mac/__init__.py index 30c6746b2..6176190ce 100644 --- a/liteeth/mac/__init__.py +++ b/liteeth/mac/__init__.py @@ -37,7 +37,7 @@ class LiteEthMAC(Module, AutoCSR): Record.connect(self.depacketizer.source, self.crossbar.master.sink) ] elif interface == "wishbone": - self.submodules.interface = wishbone.LiteEthMACWishboneInterface(dw, 2, 2) + self.submodules.interface = LiteEthMACWishboneInterface(dw, 2, 2) self.comb += [ Record.connect(self.interface.source, self.core.sink), Record.connect(self.core.source, self.interface.sink) diff --git a/liteeth/mac/common.py b/liteeth/mac/common.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/liteeth/mac/core/__init__.py b/liteeth/mac/core/__init__.py index e8fa5a277..7a420de11 100644 --- a/liteeth/mac/core/__init__.py +++ b/liteeth/mac/core/__init__.py @@ -1,5 +1,4 @@ from liteeth.common import * -from liteeth.mac.common import * from liteeth.mac.core import preamble, crc, last_be class LiteEthMACCore(Module, AutoCSR): diff --git a/liteeth/mac/core/crc.py b/liteeth/mac/core/crc.py index e04e303bf..b14d0a125 100644 --- a/liteeth/mac/core/crc.py +++ b/liteeth/mac/core/crc.py @@ -1,5 +1,4 @@ from liteeth.common import * -from liteeth.mac.common import * class LiteEthMACCRCEngine(Module): """Cyclic Redundancy Check Engine diff --git a/liteeth/mac/core/last_be.py b/liteeth/mac/core/last_be.py index ce39be2ca..7d82b934b 100644 --- a/liteeth/mac/core/last_be.py +++ b/liteeth/mac/core/last_be.py @@ -1,5 +1,4 @@ from liteeth.common import * -from liteeth.mac.common import * class LiteEthMACTXLastBE(Module): def __init__(self, dw): diff --git a/liteeth/mac/core/preamble.py b/liteeth/mac/core/preamble.py index 4f7705469..1b9f033c6 100644 --- a/liteeth/mac/core/preamble.py +++ b/liteeth/mac/core/preamble.py @@ -1,5 +1,4 @@ from liteeth.common import * -from liteeth.mac.common import * class LiteEthMACPreambleInserter(Module): def __init__(self, dw): diff --git a/liteeth/mac/frontend/sram.py b/liteeth/mac/frontend/sram.py index fcb698ade..eefb9a623 100644 --- a/liteeth/mac/frontend/sram.py +++ b/liteeth/mac/frontend/sram.py @@ -1,5 +1,4 @@ from liteeth.common import * -from liteeth.mac.common import * from migen.bank.description import * from migen.bank.eventmanager import * diff --git a/liteeth/mac/frontend/wishbone.py b/liteeth/mac/frontend/wishbone.py index c6cf67186..71b467dfa 100644 --- a/liteeth/mac/frontend/wishbone.py +++ b/liteeth/mac/frontend/wishbone.py @@ -1,5 +1,4 @@ from liteeth.common import * -from liteeth.mac.common import * from liteeth.mac.frontend import sram from migen.bus import wishbone diff --git a/liteeth/test/arp_tb.py b/liteeth/test/arp_tb.py index 89f6fe9cf..534cf0769 100644 --- a/liteeth/test/arp_tb.py +++ b/liteeth/test/arp_tb.py @@ -15,9 +15,9 @@ mac_address = 0x12345678abcd class TB(Module): def __init__(self): - self.submodules.phy_model = phy.PHY(8, debug=True) - self.submodules.mac_model = mac.MAC(self.phy_model, debug=True, loopback=False) - self.submodules.arp_model = arp.ARP(self.mac_model, mac_address, ip_address, debug=True) + self.submodules.phy_model = phy.PHY(8, debug=False) + self.submodules.mac_model = mac.MAC(self.phy_model, debug=False, loopback=False) + self.submodules.arp_model = arp.ARP(self.mac_model, mac_address, ip_address, debug=False) self.submodules.mac = LiteEthMAC(self.phy_model, dw=8, with_hw_preamble_crc=True) self.submodules.arp = LiteEthARP(self.mac, mac_address, ip_address) diff --git a/liteeth/test/mac_core_tb.py b/liteeth/test/mac_core_tb.py index 3b9e5a8da..6fbaa6f7e 100644 --- a/liteeth/test/mac_core_tb.py +++ b/liteeth/test/mac_core_tb.py @@ -12,7 +12,7 @@ from liteeth.test.model import phy, mac class TB(Module): def __init__(self): self.submodules.phy_model = phy.PHY(8, debug=False) - self.submodules.mac_model = mac.MAC(self.phy_model, debug=True, loopback=True) + self.submodules.mac_model = mac.MAC(self.phy_model, debug=False, loopback=True) self.submodules.core = LiteEthMACCore(phy=self.phy_model, dw=8, with_hw_preamble_crc=True) self.submodules.streamer = PacketStreamer(eth_phy_description(8), last_be=1) diff --git a/liteeth/test/mac_wishbone_tb.py b/liteeth/test/mac_wishbone_tb.py index 6e7462418..ca6740ebd 100644 --- a/liteeth/test/mac_wishbone_tb.py +++ b/liteeth/test/mac_wishbone_tb.py @@ -115,7 +115,7 @@ class TB(Module): while True: for slot in range(2): - print("slot {}:".format(slot)) + print("slot {}: ".format(slot), end="") # fill tx memory for i in range(length//4+1): dat = int.from_bytes(tx_payload[4*i:4*(i+1)], "big") diff --git a/liteeth/test/model/arp.py b/liteeth/test/model/arp.py index 79ac98d0a..1dc846265 100644 --- a/liteeth/test/model/arp.py +++ b/liteeth/test/model/arp.py @@ -1,7 +1,6 @@ -import math, binascii +import math from liteeth.common import * -from liteeth.mac.common import * from liteeth.test.common import * from liteeth.test.model import mac diff --git a/liteeth/test/model/ip.py b/liteeth/test/model/ip.py index 4a8c18750..3b5aa6d5c 100644 --- a/liteeth/test/model/ip.py +++ b/liteeth/test/model/ip.py @@ -1,7 +1,6 @@ -import math, binascii +import math from liteeth.common import * -from liteeth.mac.common import * from liteeth.test.common import * from liteeth.test.model import mac @@ -91,7 +90,7 @@ if __name__ == "__main__": packet = IPPacket(packet) # check decoding packet.decode() - print(packet) + #print(packet) errors += verify_packet(packet, {}) # check encoding packet.encode() diff --git a/liteeth/test/model/mac.py b/liteeth/test/model/mac.py index 74273cb95..f35288359 100644 --- a/liteeth/test/model/mac.py +++ b/liteeth/test/model/mac.py @@ -1,7 +1,6 @@ import math, binascii from liteeth.common import * -from liteeth.mac.common import * from liteeth.test.common import * def print_mac(s): diff --git a/liteeth/test/model/phy.py b/liteeth/test/model/phy.py index 296cbb84c..9f388f5bd 100644 --- a/liteeth/test/model/phy.py +++ b/liteeth/test/model/phy.py @@ -1,5 +1,4 @@ from liteeth.common import * -from liteeth.mac.common import * from liteeth.test.common import * def print_phy(s):