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

Address line width off-by-one #46

Closed
leolitenstorrent opened this issue Jun 12, 2023 · 1 comment
Closed

Address line width off-by-one #46

leolitenstorrent opened this issue Jun 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@leolitenstorrent
Copy link

Hello PeakRDL Development Team,

It seems that for an address map with size 128 bytes, the Verilog module generated by PeakRDL will have an address line that is 8 bits wide. However, in reality, only 7 bits are required for the address line because the address range only goes from 0 to 127.

I checked your source code and saw the line self.addr_width = self.top_node.size.bit_length() under class DesignState and request that it be changed to self.addr_width = (self.top_node.size - 1).bit_length().

Thank you!

@amykyta3
Copy link
Member

I agree this is a bug I must have missed. Thanks for reporting!

I have fixed it and it will be published in the next release

@amykyta3 amykyta3 added the bug Something isn't working label Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants