Skip to content

Commit

Permalink
Fix oversized address width calculation edge case. #46
Browse files Browse the repository at this point in the history
  • Loading branch information
amykyta3 committed Jun 13, 2023
1 parent b107be5 commit ac3f466
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/peakrdl_regblock/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def __init__(self, top_node: AddrmapNode, kwargs: Any) -> None:

#------------------------

self.addr_width = self.top_node.size.bit_length()
self.addr_width = (self.top_node.size - 1).bit_length()
if user_addr_width is not None:
if user_addr_width < self.addr_width:
msg.fatal(f"User-specified address width shall be greater than or equal to {self.addr_width}.")
Expand Down

0 comments on commit ac3f466

Please sign in to comment.