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

Add rotate by constant #352

Merged
merged 1 commit into from Apr 13, 2020
Merged

Add rotate by constant #352

merged 1 commit into from Apr 13, 2020

Conversation

Ravenslofty
Copy link
Contributor

I think I got the signs right, anyway.

Closes #339.

Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some tests. In this case, some assertRepr tests in test_hdl_ast.py, and a functional test in test_sim.py. In the latter, if you write the literals in binary, it'll be easy to see if you got the signs right.

@codecov
Copy link

codecov bot commented Apr 11, 2020

Codecov Report

Merging #352 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #352      +/-   ##
==========================================
+ Coverage   82.69%   82.72%   +0.02%     
==========================================
  Files          35       35              
  Lines        5919     5940      +21     
  Branches     1201     1206       +5     
==========================================
+ Hits         4895     4914      +19     
- Misses        863      864       +1     
- Partials      161      162       +1     
Impacted Files Coverage Δ
nmigen/hdl/ast.py 88.71% <100.00%> (+0.18%) ⬆️
nmigen/hdl/rec.py 97.51% <0.00%> (-1.19%) ⬇️
nmigen/build/run.py 31.25% <0.00%> (ø)
nmigen/build/plat.py 28.15% <0.00%> (ø)

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 0e40dc0...220b5ad. Read the comment docs.

Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests for rotates by non-1, and in particular for rotates by values larger than the value size, since currently that would be an error.

Also, if you think negative rotates should be supported, tests for those, too. If you think they should not be, then add raise SyntaxError if they are encountered. (Personally I am fine with either option.)

nmigen/hdl/ast.py Outdated Show resolved Hide resolved
Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good after one more round of changes.

nmigen/hdl/ast.py Outdated Show resolved Hide resolved
nmigen/hdl/ast.py Outdated Show resolved Hide resolved
@whitequark whitequark merged commit 06c45c9 into amaranth-lang:master Apr 13, 2020
@Ravenslofty Ravenslofty deleted the const_rotates branch April 13, 2020 13:42
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.

Add rotate left/right by constant amount
2 participants