mac: Move sram dw/sram checks to LiteEthMAC.

This commit is contained in:
Florent Kermarrec 2021-10-01 18:30:37 +02:00
parent 692df29981
commit e794459946
2 changed files with 5 additions and 6 deletions

View File

@ -22,7 +22,11 @@ class LiteEthMAC(Module, AutoCSR):
timestamp = None,
full_memory_we = False,
sys_data_path = False):
assert interface in ["crossbar", "wishbone", "hybrid"]
assert dw%8 == 0
assert interface in ["crossbar", "wishbone", "hybrid"]
assert endianness in ["big", "little"]
self.submodules.core = LiteEthMACCore(phy, dw, with_preamble_crc, sys_data_path)
self.csrs = []
if interface == "crossbar":

View File

@ -18,8 +18,6 @@ from litex.soc.interconnect.csr_eventmanager import *
class LastBEDecoder(Module):
def __init__(self, dw, last_be):
assert dw % 8 == 0, "dw must be evenly divisible by 8!"
bytes = dw // 8
# Decoded needs to be able to represent a count from 0 up to
@ -37,7 +35,6 @@ class LastBEDecoder(Module):
class LastBEEncoder(Module):
def __init__(self, dw, length_lsb):
assert dw % 8 == 0, "dw must be evenly divisible by 8!"
bytes = dw // 8
self.encoded = Signal(bytes)
@ -50,8 +47,6 @@ class LastBEEncoder(Module):
class LiteEthMACSRAMWriter(Module, AutoCSR):
def __init__(self, dw, depth, nslots=2, endianness="big", timestamp=None):
assert endianness in [
"big", "little"], "endianness must be either big or litte!"
self.sink = sink = stream.Endpoint(eth_phy_description(dw))
self.crc_error = Signal()