From f23d2e36a798685c3d0795f6c4c711da0229afd7 Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 29 Jul 2020 10:31:18 -0700 Subject: [PATCH] Don't obstruct control logic signals with dffs when no column mux. --- compiler/sram/sram_1bank.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compiler/sram/sram_1bank.py b/compiler/sram/sram_1bank.py index a5dfb0e5..fc390f37 100644 --- a/compiler/sram/sram_1bank.py +++ b/compiler/sram/sram_1bank.py @@ -160,7 +160,10 @@ class sram_1bank(sram_base): port = 0 # Add the col address flops below the bank to the right of the control logic x_offset = self.control_logic_insts[port].rx() + self.dff.width - y_offset = - self.data_bus_size[port] - self.dff.height + # Place it a data bus below the x-axis, but at least as low as the control logic to not block + # the control logic signals + y_offset = min(-self.data_bus_size[port] - self.dff.height, + self.control_logic_insts[port].by()) if self.col_addr_dff: self.col_addr_pos[port] = vector(x_offset, y_offset) @@ -201,7 +204,10 @@ class sram_1bank(sram_base): # Add the col address flops below the bank to the right of the control logic x_offset = self.control_logic_insts[port].lx() - 2 * self.dff.width - y_offset = self.bank.height + self.data_bus_size[port] + self.dff.height + # Place it a data bus below the x-axis, but at least as high as the control logic to not block + # the control logic signals + y_offset = max(self.bank.height + self.data_bus_size[port] + self.dff.height, + self.control_logic_insts[port].uy() - self.dff.height) if self.col_addr_dff: self.col_addr_pos[port] = vector(x_offset, y_offset)