Skip to content

Commit

Permalink
core/crossbar: Fix cba_shifts when bank_byte_alignment is not defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Sep 2, 2024
1 parent facfad5 commit 100e6d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion litedram/core/crossbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ def do_finalize(self):
nmasters = len(self.masters)

# Address mapping --------------------------------------------------------------------------
cba_shifts = {"ROW_BANK_COL": max(controller.settings.geom.colbits - controller.address_align, log2_int(controller.settings.bank_byte_alignment //(controller.data_width // 8))) }
cba_shifts = {
"ROW_BANK_COL": max(
controller.settings.geom.colbits - controller.address_align,
log2_int(getattr(controller.settings, "bank_byte_alignment", 0) //(controller.data_width // 8))
)
}
cba_shift = cba_shifts[controller.settings.address_mapping]
m_ba = [m.get_bank_address(self.bank_bits, cba_shift)for m in self.masters]
m_rca = [m.get_row_column_address(self.bank_bits, self.rca_bits, cba_shift) for m in self.masters]
Expand Down

0 comments on commit 100e6d9

Please sign in to comment.