Flip freepdk45 flop, dff_buf route layer change

This commit is contained in:
mrg 2020-06-09 13:48:16 -07:00
parent 8c6d5b49be
commit 157926960b
2 changed files with 25 additions and 25 deletions

View File

@ -7,7 +7,7 @@
# #
import debug import debug
import design import design
from tech import parameter from tech import parameter, layer
from tech import cell_properties as props from tech import cell_properties as props
from vector import vector from vector import vector
from globals import OPTS from globals import OPTS
@ -52,7 +52,6 @@ class dff_buf(design.design):
def create_layout(self): def create_layout(self):
self.place_instances() self.place_instances()
self.width = self.inv2_inst.rx() self.width = self.inv2_inst.rx()
self.height = self.dff.height self.height = self.dff.height
self.route_wires() self.route_wires()
self.add_layout_pins() self.add_layout_pins()
@ -125,34 +124,32 @@ class dff_buf(design.design):
self.inv2_inst.place(vector(self.inv1_inst.rx(), 0)) self.inv2_inst.place(vector(self.inv1_inst.rx(), 0))
def route_wires(self): def route_wires(self):
if "li" in layer:
self.route_layer = "li"
else:
self.route_layer = "m1"
# Route dff q to inv1 a # Route dff q to inv1 a
q_pin = self.dff_inst.get_pin("Q") q_pin = self.dff_inst.get_pin("Q")
a1_pin = self.inv1_inst.get_pin("A") a1_pin = self.inv1_inst.get_pin("A")
mid_x_offset = 0.5 * (a1_pin.cx() + q_pin.cx()) mid1 = vector(a1_pin.cx(), q_pin.cy())
mid1 = vector(mid_x_offset, q_pin.cy()) self.add_path(q_pin.layer, [q_pin.center(), mid1, a1_pin.center()])
mid2 = vector(mid_x_offset, a1_pin.cy()) self.add_via_stack_center(from_layer=a1_pin.layer,
self.add_path("m3", [q_pin.center(), mid1, mid2, a1_pin.center()]) to_layer=q_pin.layer,
self.add_via_center(layers=self.m2_stack, offset=a1_pin.center())
offset=q_pin.center())
self.add_via_center(layers=self.m2_stack,
offset=a1_pin.center())
self.add_via_center(layers=self.m1_stack,
offset=a1_pin.center())
# Route inv1 z to inv2 a # Route inv1 z to inv2 a
z1_pin = self.inv1_inst.get_pin("Z") z1_pin = self.inv1_inst.get_pin("Z")
a2_pin = self.inv2_inst.get_pin("A") a2_pin = self.inv2_inst.get_pin("A")
mid_x_offset = 0.5 * (z1_pin.cx() + a2_pin.cx()) self.mid_qb_pos = vector(0.5 * (z1_pin.cx() + a2_pin.cx()), z1_pin.cy())
self.mid_qb_pos = vector(mid_x_offset, z1_pin.cy()) self.add_zjog(z1_pin.layer, z1_pin.center(), a2_pin.center())
mid2 = vector(mid_x_offset, a2_pin.cy())
self.add_path("m1", [z1_pin.center(), self.mid_qb_pos, mid2, a2_pin.center()])
def add_layout_pins(self): def add_layout_pins(self):
# Continous vdd rail along with label. # Continous vdd rail along with label.
vdd_pin=self.dff_inst.get_pin("vdd") vdd_pin=self.dff_inst.get_pin("vdd")
self.add_layout_pin(text="vdd", self.add_layout_pin(text="vdd",
layer="m1", layer=vdd_pin.layer,
offset=vdd_pin.ll(), offset=vdd_pin.ll(),
width=self.width, width=self.width,
height=vdd_pin.height()) height=vdd_pin.height())
@ -160,7 +157,7 @@ class dff_buf(design.design):
# Continous gnd rail along with label. # Continous gnd rail along with label.
gnd_pin=self.dff_inst.get_pin("gnd") gnd_pin=self.dff_inst.get_pin("gnd")
self.add_layout_pin(text="gnd", self.add_layout_pin(text="gnd",
layer="m1", layer=gnd_pin.layer,
offset=gnd_pin.ll(), offset=gnd_pin.ll(),
width=self.width, width=self.width,
height=vdd_pin.height()) height=vdd_pin.height())
@ -185,17 +182,20 @@ class dff_buf(design.design):
self.add_layout_pin_rect_center(text="Q", self.add_layout_pin_rect_center(text="Q",
layer="m2", layer="m2",
offset=q_pos) offset=q_pos)
self.add_path("m1", [dout_pin.center(), mid_pos, q_pos]) self.add_path(self.route_layer, [dout_pin.center(), mid_pos, q_pos])
self.add_via_center(layers=self.m1_stack, self.add_via_stack_center(from_layer=dout_pin.layer,
offset=q_pos) to_layer="m2",
offset=q_pos)
qb_pos = self.mid_qb_pos + vector(0, self.m2_pitch) qb_pos = self.mid_qb_pos + vector(0, self.m2_pitch)
self.add_layout_pin_rect_center(text="Qb", self.add_layout_pin_rect_center(text="Qb",
layer="m2", layer="m2",
offset=qb_pos) offset=qb_pos)
self.add_path("m1", [self.mid_qb_pos, qb_pos]) self.add_path(self.route_layer, [self.mid_qb_pos, qb_pos])
self.add_via_center(layers=self.m1_stack, a2_pin = self.inv2_inst.get_pin("A")
offset=qb_pos) self.add_via_stack_center(from_layer=a2_pin.layer,
to_layer="m2",
offset=qb_pos)
def get_clk_cin(self): def get_clk_cin(self):
"""Return the total capacitance (in relative units) that the clock is loaded by in the dff""" """Return the total capacitance (in relative units) that the clock is loaded by in the dff"""

Binary file not shown.