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
Support division of negative numbers? #478
Comments
Reasonable. I think we might want to wait until there's a Yosys release, because we can't shim over the lack of |
The verilog backend in that commit (which I do not claim to fully understand) does seem to "shim" over the lack of flooring division in Verilog, so I think it might technically be possible to work around it, but I agree waiting for a Yosys release is easier. Bit unfortunate that Yosys releases are not exactly frequent. |
I guess you could, when targeting older Yosys, always provide a |
Probably not... |
It appears that Yosys now supports
$divfloor
as of YosysHQ/yosys@edd8ff2In
ast.py
it is mentioned that the different semantics mean it's not supported:https://github.com/nmigen/nmigen/blob/e46118dac0df315694b0fc6b9367d285a8fc12dd/nmigen/hdl/ast.py#L173-L179
I'm not sure what division synthesizes to in Yosys in general, or if it supports the general case at all, but it seems that on the nMigen side we can now emit
$divfloor
and fully support division with correct semantics. I'd be happy to put together a PR for this at some point.The text was updated successfully, but these errors were encountered: