From b148ade774dd618699b10a5bec7b1edd5a4c68a5 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 7 Jul 2023 09:11:06 +0200 Subject: [PATCH] core/bankmachine: Minor cleanup on _AddressSlicer.col. --- litedram/core/bankmachine.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/litedram/core/bankmachine.py b/litedram/core/bankmachine.py index 144929d..5e3e58c 100644 --- a/litedram/core/bankmachine.py +++ b/litedram/core/bankmachine.py @@ -34,10 +34,19 @@ class _AddressSlicer: def col(self, address): split = self.colbits - self.address_align - if self.colbits>10: # A10 is reserved for auto-precharge, this bit needs to be skipped for col addresses - return Cat(Replicate(0, self.address_align), address[:10-self.address_align], 0, address[10-self.address_align:split]) + if self.colbits > 10: + # A10 is reserved for auto-precharge, this bit needs to be skipped for col addresses. + return Cat( + Constant(0, self.address_align), + address[:10-self.address_align], + Constant(0, 1), + address[10-self.address_align:split] + ) else: - return Cat(Replicate(0, self.address_align), address[:split]) + return Cat( + Constant(0, self.address_align), + address[:split] + ) # BankMachine --------------------------------------------------------------------------------------