cfc9b28133639906496f7a80dd6767fa65b31b1d
4 from migen
.genlib
.fsm
import *
6 from misoc
.interconnect
.stream
import Sink
, Source
7 from misoc
.cores
.liteeth_mini
.common
import eth_phy_description
, eth_interpacket_gap
10 class LiteEthMACGap(Module
):
11 def __init__(self
, dw
, ack_on_gap
=False):
12 self
.sink
= sink
= Sink(eth_phy_description(dw
))
13 self
.source
= source
= Source(eth_phy_description(dw
))
17 gap
= math
.ceil(eth_interpacket_gap
/(dw
//8))
18 counter
= Signal(max=gap
)
19 counter_reset
= Signal()
25 counter
.eq(counter
+ 1)
28 self
.submodules
.fsm
= fsm
= FSM(reset_state
="COPY")
31 Record
.connect(sink
, source
),
32 If(sink
.stb
& sink
.eop
& sink
.ack
,
38 sink
.ack
.eq(int(ack_on_gap
)),
39 If(counter
== (gap
-1),