Skip to content

Commit

Permalink
soc/core/hyperbus: Avoid combinatorial loop on write bursts (Reported…
Browse files Browse the repository at this point in the history
… when building with Vivado).
  • Loading branch information
enjoy-digital committed Sep 19, 2024
1 parent ad2c3fc commit 6e9dffd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions litex/soc/cores/hyperbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,13 @@ def __init__(self, phy, latency=7, latency_mode="fixed", clk_ratio="4:1", with_b
NextState("REG-READ")
).Else(
bus_latch.eq(1),
NextValue(burst_r_first, 1),
# Bus Write.
If(bus.we,
bus.ack.eq(1),
NextState("DAT-WRITE")
# Bus Read.
).Else(
NextValue(burst_r_first, 1),
NextState("DAT-READ")
)
)
Expand Down Expand Up @@ -472,7 +475,6 @@ def __init__(self, phy, latency=7, latency_mode="fixed", clk_ratio="4:1", with_b
bus_dat_w.eq(bus.dat_w),
)
]
self.comb += If(bus_latch, bus.ack.eq(bus.we))
self.comb += burst_w.eq(
# Notified Incrementing Burst.
(bus_cti == 0b010) |
Expand All @@ -488,8 +490,10 @@ def __init__(self, phy, latency=7, latency_mode="fixed", clk_ratio="4:1", with_b
source.rwds_oe.eq(1),
source.dat_w.eq(1),
If(dat_tx_conv.sink.ready,
# Stay in DAT-WRITE while Incrementing Burst ongoing...
If(with_bursting & bus.cyc & bus.stb & burst_w,
# Ack while Incrementing Burst ongoing...
bus.ack.eq(with_bursting & bus.cyc & bus.stb & burst_w),
# If Ack, stay in DAT-WRITE.
If(bus.ack,
bus_latch.eq(1),
NextState("DAT-WRITE")
# ..else exit.
Expand Down

0 comments on commit 6e9dffd

Please sign in to comment.