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

Update UART Example so that acknowledging RX data sets RX ready low. #593

Merged
merged 1 commit into from Dec 16, 2021

Conversation

newhouseb
Copy link
Contributor

@newhouseb newhouseb commented Feb 10, 2021

The UART example code currently sets rx_rdy high when data has been received. I had assumed that setting rx_ack to high would clear this until data is ready again, but in the existing implementation rx_rdy only goes low when new data arrives. This small diff changes rx_ack to clear rx_rdy so that a user can acknowledge data after the first byte and then waits on rx_rdy for the next one. It also updates the simulation to verify that the right thing happens.

I suppose this could've been designed with the intent that the user strobes out a signal when rx_rdy goes from low to high, but I'm not sure what the use of rx_ack is if this was the intended design. Sorry if I'm being oblivious, but if I am, feel free to close out this diff.

The UART example code currently sets `rx_rdy` high when data has been received. I had assumed that setting `rx_ack` to high would clear this until data is ready again, but in the existing implementation `rx_rdy` only goes low when new data arrives. This small diff changes `rx_ack` to clear `rx_rdy` so that a user can acknowledge data after the first byte and then wait on `rx_rdy` for the next one.

I suppose this could've been design with the intent that the user strobes out a signal when `rx_rdy` goes from low to high, but I'm not sure what the use of `rx_ack` is if this was the intended design. Sorry if I'm being oblivious, but if I am, feel free to close out this diff.
@codecov
Copy link

codecov bot commented Feb 10, 2021

Codecov Report

Merging #593 (1e70684) into master (f7c2b94) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #593   +/-   ##
=======================================
  Coverage   81.50%   81.50%           
=======================================
  Files          49       49           
  Lines        6461     6461           
  Branches     1287     1287           
=======================================
  Hits         5266     5266           
  Misses       1007     1007           
  Partials      188      188           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f7c2b94...1e70684. Read the comment docs.

Copy link
Member

@modwizcode modwizcode left a comment

I agree this makes more sense.

Copy link
Member

@whitequark whitequark left a comment

LGTM

@whitequark whitequark merged commit 55756e9 into amaranth-lang:main Dec 16, 2021
7 checks passed
@whitequark
Copy link
Member

whitequark commented Dec 16, 2021

Thank you!

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