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

Division and modulo are incorrect and unsound #238

Closed
whitequark opened this issue Sep 28, 2019 · 1 comment
Closed

Division and modulo are incorrect and unsound #238

whitequark opened this issue Sep 28, 2019 · 1 comment
Labels
Milestone

Comments

@whitequark
Copy link
Contributor

Incorrect: because Python uses div/mod semantics, and Verilog (and thus Yosys) uses quo/rem semantics.

Unsound: because nMigen should return 0 for x//0 and x%0, but Verilog (and thus Yosys) returns 'x.

@whitequark whitequark added the bug label Sep 28, 2019
@whitequark
Copy link
Contributor Author

Probably should just restrict them to unsigned values only, at least until someone implements correct behavior for signed values on top of Yosys' semantics (which is not trivial and not clearly desirable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant