mirror of
https://github.com/enjoy-digital/usb3_pipe.git
synced 2025-01-04 10:18:41 +08:00
sim/lfps: now working in simulation
This commit is contained in:
parent
8803c75bbd
commit
1bd83c3ea4
2
sim.py
2
sim.py
@ -50,13 +50,11 @@ class USB3PIPESim(SoCMini):
|
|||||||
host_usb3_serdes = USB3SerDesModel()
|
host_usb3_serdes = USB3SerDesModel()
|
||||||
host_usb3_pipe = USB3PIPE(serdes=host_usb3_serdes, sys_clk_freq=sys_clk_freq)
|
host_usb3_pipe = USB3PIPE(serdes=host_usb3_serdes, sys_clk_freq=sys_clk_freq)
|
||||||
self.submodules += host_usb3_serdes, host_usb3_pipe
|
self.submodules += host_usb3_serdes, host_usb3_pipe
|
||||||
self.comb += host_usb3_pipe.ltssm.polling_fsm.skip_lfps.eq(1) # FIXME
|
|
||||||
|
|
||||||
# USB3 Device
|
# USB3 Device
|
||||||
dev_usb3_serdes = USB3SerDesModel()
|
dev_usb3_serdes = USB3SerDesModel()
|
||||||
dev_usb3_pipe = USB3PIPE(serdes=dev_usb3_serdes, sys_clk_freq=sys_clk_freq)
|
dev_usb3_pipe = USB3PIPE(serdes=dev_usb3_serdes, sys_clk_freq=sys_clk_freq)
|
||||||
self.submodules += dev_usb3_serdes, dev_usb3_pipe
|
self.submodules += dev_usb3_serdes, dev_usb3_pipe
|
||||||
self.comb += dev_usb3_pipe.ltssm.polling_fsm.skip_lfps.eq(1) # FIXME
|
|
||||||
|
|
||||||
# Connect Host <--> Device
|
# Connect Host <--> Device
|
||||||
self.comb += host_usb3_serdes.connect(dev_usb3_serdes)
|
self.comb += host_usb3_serdes.connect(dev_usb3_serdes)
|
||||||
|
@ -81,7 +81,7 @@ class LFPSChecker(Module):
|
|||||||
If(idle == 0,
|
If(idle == 0,
|
||||||
NextValue(count, burst_cycles - 1),
|
NextValue(count, burst_cycles - 1),
|
||||||
).Else(
|
).Else(
|
||||||
NextValue(count, repeat_cycles - burst_cycles - 1),
|
NextValue(count, repeat_cycles - 2*burst_cycles - 1),
|
||||||
NextState("TREPEAT")
|
NextState("TREPEAT")
|
||||||
)
|
)
|
||||||
).Else(
|
).Else(
|
||||||
|
@ -168,7 +168,6 @@ class PollingFSM(FSM):
|
|||||||
# FIXME: Simplified State Machine for initial tests, implement exits and timeouts.
|
# FIXME: Simplified State Machine for initial tests, implement exits and timeouts.
|
||||||
def __init__(self, serdes, lfps_unit, ts_unit):
|
def __init__(self, serdes, lfps_unit, ts_unit):
|
||||||
self.idle = Signal()
|
self.idle = Signal()
|
||||||
self.skip_lfps = Signal() # FIXME: for simulation
|
|
||||||
|
|
||||||
# # #
|
# # #
|
||||||
|
|
||||||
@ -187,7 +186,7 @@ class PollingFSM(FSM):
|
|||||||
NextValue(rx_ts2_seen, 0),
|
NextValue(rx_ts2_seen, 0),
|
||||||
serdes.rx_align.eq(1),
|
serdes.rx_align.eq(1),
|
||||||
lfps_unit.tx_polling.eq(1),
|
lfps_unit.tx_polling.eq(1),
|
||||||
If(lfps_unit.rx_polling | self.skip_lfps,
|
If(lfps_unit.rx_polling,
|
||||||
NextState("RX-EQ"),
|
NextState("RX-EQ"),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user