mac: change default interface (core)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 28 Jan 2015 19:55:18 +0000 (20:55 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 28 Jan 2015 19:55:18 +0000 (20:55 +0100)
liteeth/mac/__init__.py

index 0024a5839fc83d789b8405c91b50d850b56cc9bd..7fd7af69a38dd4c2fdd12aef21d622e31273deb7 100644 (file)
@@ -3,20 +3,20 @@ from liteeth.mac.core import LiteEthMACCore
 from liteeth.mac.frontend import wishbone
 
 class LiteEthMAC(Module, AutoCSR):
-       def __init__(self, phy, dw, interface="wishbone", endianness="be",
+       def __init__(self, phy, dw, interface="core", endianness="be",
                        with_hw_preamble_crc=True):
                self.submodules.core = LiteEthMACCore(phy, dw, endianness, with_hw_preamble_crc)
                self.csrs = None
-               if interface == "wishbone":
+               if interface == "core":
+                       self.sink, self.source = self.core.sink, self.core.source
+               elif interface == "wishbone":
                        self.interface = wishbone.LiteEthMACWishboneInterface(dw, 2, 2)
                        self.ev, self.bus = self.interface.sram.ev, self.interface.bus
                        self.csrs = self.interface.get_csrs()
                elif interface == "dma":
                        raise NotImplementedError
-               elif interface == "core":
-                       self.sink, self.source = self.core.sink, self.core.source
                else:
-                       raise ValueError("EthMAC only supports Wishbone, DMA or core interfaces")
+                       raise ValueError(inteface + " not supported by LiteEthMac!")
 
        def get_csrs(self):
                return self.csrs