-
Notifications
You must be signed in to change notification settings - Fork 55
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
Signals with non power of two maximum value #39
Comments
What about using |
While this is a nice solution for the |
They will. If you have an especially braindead synthesis tool that can't do that, just use Yosys to preprocess the gateware by running architecture-independent optimizations before feeding it to that tool. |
Ok then the |
Currently the maximum value of a
Signal
specified using themax
parameter is rounded up to the next power of two.Because of this something like the following fails with
IndexError: Cannot end slice 10 bits into 9-bit value
While I understand the cause for this error, I don't think this is the best solution possible.
I can think of two possible ways to improve:
Signal
that supports non power of two maximum values (and guarantees that it is not excceded). Guaranteeing this may come with a high cost, but would also simplify some code, like this counter.Signal
proposed.The text was updated successfully, but these errors were encountered: