liteeth/phy/rmii: Move crs first/last detection outside of FSM.
This commit is contained in:
parent
1c89387d09
commit
5538c87115
|
@ -61,9 +61,12 @@ class LiteEthPHYRMIIRX(LiteXModule):
|
|||
rx_data.eq(pads.rx_data)
|
||||
]
|
||||
|
||||
crs_first = (crs_dv & (rx_data != 0b00))
|
||||
crs_last = (~crs_dv & ~crs_dv_d) # End of frame when 2 consecutives 0 on crs_dv.
|
||||
|
||||
self.fsm = fsm = FSM(reset_state="IDLE")
|
||||
fsm.act("IDLE",
|
||||
If(crs_dv & (rx_data != 0b00),
|
||||
If(crs_first,
|
||||
delay.sink.valid.eq(1),
|
||||
delay.sink.data.eq(rx_data),
|
||||
NextState("RECEIVE")
|
||||
|
@ -74,8 +77,7 @@ class LiteEthPHYRMIIRX(LiteXModule):
|
|||
fsm.act("RECEIVE",
|
||||
delay.sink.valid.eq(1),
|
||||
delay.sink.data.eq(rx_data),
|
||||
# End of frame when 2 consecutives 0 on crs_dv.
|
||||
If(~(crs_dv | crs_dv_d),
|
||||
If(crs_last,
|
||||
converter.sink.last.eq(1),
|
||||
NextState("IDLE")
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue