mirror of
https://github.com/enjoy-digital/liteeth.git
synced 2025-01-03 03:43:37 -05:00
mac/preamble: Fix inserter to work for 32/64 bit
The signal won't get wider in the 8 bit case, since max moves from 6 to 7 Untested for 64 bit
This commit is contained in:
parent
8c72362385
commit
688011f936
1 changed files with 4 additions and 1 deletions
|
@ -25,13 +25,16 @@ class LiteEthMACPreambleInserter(Module):
|
|||
Preamble, SFD, and packet octets.
|
||||
"""
|
||||
def __init__(self, dw):
|
||||
assert dw in [8, 16, 32, 64]
|
||||
self.sink = stream.Endpoint(eth_phy_description(dw))
|
||||
self.source = stream.Endpoint(eth_phy_description(dw))
|
||||
|
||||
# # #
|
||||
|
||||
preamble = Signal(64, reset=eth_preamble)
|
||||
count = Signal(max=(64//dw)-1, reset_less=True)
|
||||
# For 64 bits, `count` doesn't need to change. But migen won't create a
|
||||
# signal with a width of 0 bits, so add an unused bit for 64 bit path
|
||||
count = Signal(max=(64//dw) if dw != 64 else 2, reset_less=True)
|
||||
self.submodules.fsm = fsm = FSM(reset_state="IDLE")
|
||||
fsm.act("IDLE",
|
||||
self.sink.ready.eq(1),
|
||||
|
|
Loading…
Reference in a new issue