Fix oversized address width calculation edge case. #46

This commit is contained in:
Alex Mykyta
2023-06-12 22:05:03 -07:00
parent b107be53bb
commit ac3f466fb2

View File

@@ -253,7 +253,7 @@ class DesignState:
#------------------------ #------------------------
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 is not None:
if user_addr_width < self.addr_width: if user_addr_width < self.addr_width:
msg.fatal(f"User-specified address width shall be greater than or equal to {self.addr_width}.") msg.fatal(f"User-specified address width shall be greater than or equal to {self.addr_width}.")