Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csr.wishbone: Only ack for 1 cycle #32

Merged
merged 1 commit into from Sep 16, 2021

Conversation

antonblanchard
Copy link
Contributor

@antonblanchard antonblanchard commented Sep 16, 2021

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
Copy link
Contributor Author

antonblanchard commented Sep 16, 2021

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

The current behaviour:

bad

and with this fix:

good

@whitequark
Copy link
Member

whitequark commented Sep 16, 2021

Looks reasonable. Can you add a test?

nmigen_soc/csr/wishbone.py Outdated Show resolved Hide resolved
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
Copy link
Contributor Author

antonblanchard commented Sep 16, 2021

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?

@whitequark whitequark merged commit e9f73e4 into amaranth-lang:master Sep 16, 2021
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants