diff --git a/compiler/modules/dff_buf.py b/compiler/modules/dff_buf.py index 9e2ff0aa..82f567e6 100644 --- a/compiler/modules/dff_buf.py +++ b/compiler/modules/dff_buf.py @@ -49,10 +49,11 @@ class dff_buf(design.design): self.create_instances() def create_layout(self): - self.width = self.dff.width + self.inv1.width + self.inv2.width + self.place_instances() + self.width = self.inv2_inst.rx() self.height = self.dff.height - self.place_instances() + self.route_wires() self.add_layout_pins() self.add_boundary() @@ -100,7 +101,10 @@ class dff_buf(design.design): self.dff_inst.place(vector(0,0)) # Add INV1 to the right - self.inv1_inst.place(vector(self.dff_inst.rx(),0)) + well_spacing = max(self.nwell_space, + self.pwell_space, + self.pwell_to_nwell) + self.inv1_inst.place(vector(self.dff_inst.rx() + well_spacing + self.well_extend_active,0)) # Add INV2 to the right self.inv2_inst.place(vector(self.inv1_inst.rx(),0)) diff --git a/compiler/modules/dff_buf_array.py b/compiler/modules/dff_buf_array.py index 8b8e21dc..67c7522f 100644 --- a/compiler/modules/dff_buf_array.py +++ b/compiler/modules/dff_buf_array.py @@ -70,6 +70,12 @@ class dff_buf_array(design.design): inv2_size=self.inv2_size) self.add_mod(self.dff) + well_spacing = max(self.nwell_space, + self.pwell_space, + self.pwell_to_nwell) + + self.dff_pitch = self.dff.width + well_spacing + self.well_extend_active + def create_dff_array(self): self.dff_insts={} for row in range(self.rows): @@ -89,10 +95,10 @@ class dff_buf_array(design.design): for col in range(self.columns): name = "Xdff_r{0}_c{1}".format(row,col) if (row % 2 == 0): - base = vector(col*self.dff.width,row*self.dff.height) + base = vector(col*self.dff_pitch,row*self.dff.height) mirror = "R0" else: - base = vector(col*self.dff.width,(row+1)*self.dff.height) + base = vector(col*self.dff_pitch,(row+1)*self.dff.height) mirror = "MX" self.dff_insts[row,col].place(offset=base, mirror=mirror)