amaranth-lang / amaranth-soc

System on Chip toolkit for Amaranth HDL
BSD 2-Clause "Simplified" License
75 stars 29 forks source link

csr.wishbone: Only ack for 1 cycle #32

Closed antonblanchard closed 3 years ago

antonblanchard commented 3 years ago

Currently we ack for 2 cycles, even if in the second cycle stb and cyc are not asserted. This could cause issues on a shared wishbone with asynchronous cycle termination, because that ack would be interpreted as completing the next transaction.

To avoid this just ack for 1 cycle only.

antonblanchard commented 3 years ago

A write and read from a CSR before and after the fix.

The current behaviour:

bad

and with this fix:

good

whitequark commented 3 years ago

Looks reasonable. Can you add a test?

antonblanchard commented 3 years ago

Looks reasonable. Can you add a test?

Sure, I added checks to the existing tests. Does that look ok, or would you prefer a separate test?