Change layout function names to be consistent.

This commit is contained in:
Matt Guthaus 2017-11-30 12:01:04 -08:00
parent 0214cfb48e
commit 107cad15a1
6 changed files with 56 additions and 56 deletions

View File

@ -506,7 +506,7 @@ class bank(design.design):
height=self.decoder_min_point-self.min_point-self.m2_pitch)
bank_sel_inv_in_pos = bank_sel_inv.get_pin("A").lc()
self.add_center_via(layers=("metal1","via1","metal2"),
self.add_via_center(layers=("metal1","via1","metal2"),
offset=bank_sel_inv_in_pos,
rotate=90)
@ -516,7 +516,7 @@ class bank(design.design):
layer="metal3",
start=bank_sel_pin_pos,
end=bank_sel_line_pos)
self.add_center_via(layers=("metal2","via2","metal3"),
self.add_via_center(layers=("metal2","via2","metal3"),
offset=bank_sel_line_pos,
rotate=90)
@ -528,7 +528,7 @@ class bank(design.design):
width=self.m2_width,
height=2*self.inv.height)
bank_sel_out_pin = bank_sel_inv.get_pin("Z").rc()
self.add_center_via(layers=("metal1","via1","metal2"),
self.add_via_center(layers=("metal1","via1","metal2"),
offset=bank_sel_out_pin)
@ -599,13 +599,13 @@ class bank(design.design):
out_pos = inv_inst.get_pin("Z").rc() - vector(0.5*self.m1m2_via.height,0)
bus_pos = vector(self.central_line_xoffset[gated_name] + 0.5*self.m2_width, out_pos.y)
self.add_path("metal3",[out_pos, bus_pos])
self.add_center_via(layers=("metal2", "via2", "metal3"),
self.add_via_center(layers=("metal2", "via2", "metal3"),
offset=bus_pos,
rotate=90)
self.add_center_via(layers=("metal1", "via1", "metal2"),
self.add_via_center(layers=("metal1", "via1", "metal2"),
offset=out_pos,
rotate=90)
self.add_center_via(layers=("metal2", "via2", "metal3"),
self.add_via_center(layers=("metal2", "via2", "metal3"),
offset=out_pos,
rotate=90)
@ -613,7 +613,7 @@ class bank(design.design):
logic_pin = logic_inst.get_pin("B")
input_pos = vector(xoffset_bank_signal,logic_pin.cy())
self.add_path("metal2",[logic_pin.lc(), input_pos])
self.add_center_via(layers=("metal1", "via1", "metal2"),
self.add_via_center(layers=("metal1", "via1", "metal2"),
offset=logic_pin.lc(),
rotate=90)
@ -621,11 +621,11 @@ class bank(design.design):
# Connect the logic A input to the input pin
logic_pos = logic_inst.get_pin("A").lc()
input_pos = vector(self.left_vdd_x_offset,logic_pos.y)
self.add_center_via(layers=("metal1", "via1", "metal2"),
self.add_via_center(layers=("metal1", "via1", "metal2"),
offset=logic_pos,
rotate=90)
self.add_center_via(layers=("metal2", "via2", "metal3"),
self.add_via_center(layers=("metal2", "via2", "metal3"),
offset=logic_pos,
rotate=90)
@ -860,13 +860,13 @@ class bank(design.design):
gnd_rail_position = vector(self.gnd_x_offset, decoder_gnd_position.y)
self.add_path("metal1", [decoder_gnd_position, via_position])
self.add_path("metal3", [via_position, gnd_rail_position])
self.add_center_via(layers=("metal1","via1","metal2"),
self.add_via_center(layers=("metal1","via1","metal2"),
offset=via_position,
rotate=90)
self.add_center_via(layers=("metal2","via2","metal3"),
self.add_via_center(layers=("metal2","via2","metal3"),
offset=via_position,
rotate=90)
self.add_center_via(layers=("metal2","via2","metal3"),
self.add_via_center(layers=("metal2","via2","metal3"),
offset=gnd_rail_position,
rotate=270)
@ -929,7 +929,7 @@ class bank(design.design):
mux_addr_position = self.col_mux_array_inst.get_pin(name).lc()
wire_position = vector(self.central_line_xoffset[name]+0.5*self.m2_width, mux_addr_position.y)
self.add_path("metal1", [wire_position,mux_addr_position])
self.add_center_via(layers=("metal1", "via1", "metal2"),
self.add_via_center(layers=("metal1", "via1", "metal2"),
offset=wire_position,
rotate=90)
@ -979,10 +979,10 @@ class bank(design.design):
mid_position = vector(in_position.x,dout_position.y)
self.add_path("metal3",[dout_position, mid_position, in_position])
self.add_center_via(layers=("metal2", "via2", "metal3"),
self.add_via_center(layers=("metal2", "via2", "metal3"),
offset=dout_position,
rotate=90)
self.add_center_via(layers=("metal2", "via2", "metal3"),
self.add_via_center(layers=("metal2", "via2", "metal3"),
offset=in_position)
@ -1141,7 +1141,7 @@ class bank(design.design):
control_position = vector(self.central_line_xoffset[control_signal] + 0.5*self.m2_width, pin_position.y)
self.add_path("metal1", [control_position, pin_position])
#via_offset = vector(control_x_offset, pin_position.y - 0.5*drc["minwidth_metal2"])
self.add_center_via(layers=("metal1", "via1", "metal2"),
self.add_via_center(layers=("metal1", "via1", "metal2"),
offset=control_position,
rotate=90)

View File

@ -117,7 +117,7 @@ class layout:
return self.objs[-1]
return None
def add_center_rect(self, layer, offset, width=0, height=0):
def add_rect_center(self, layer, offset, width=0, height=0):
"""Adds a rectangle on a given layer at the center point with width and height"""
if width==0:
width=drc["minwidth_{}".format(layer)]
@ -132,7 +132,7 @@ class layout:
return None
def add_center_segment(self, layer, start, end):
def add_segment_center(self, layer, start, end):
""" Add a min-width rectanglular segment using center line on the start to end point """
minwidth_layer = drc["minwidth_{}".format(layer)]
if start.x!=end.x and start.y!=end.y:
@ -312,9 +312,9 @@ class layout:
mirror=mirror,
rotate=rotate)
def add_center_contact(self, layers, offset, size=[1,1], mirror="R0", rotate=0):
def add_contact_center(self, layers, offset, size=[1,1], mirror="R0", rotate=0):
""" This is just an alias for a via."""
return self.add_center_via(layers=layers,
return self.add_via_center(layers=layers,
offset=offset,
size=size,
mirror=mirror,
@ -335,7 +335,7 @@ class layout:
self.connect_inst([])
return via
def add_center_via(self, layers, offset, size=[1,1], mirror="R0", rotate=0):
def add_via_center(self, layers, offset, size=[1,1], mirror="R0", rotate=0):
""" Add a three layer via structure by the center coordinate accounting for mirroring and rotation. """
import contact
via = contact.contact(layer_stack=layers,

View File

@ -263,7 +263,7 @@ class pinv(design.design):
# Add the via to the cell midpoint along the gate
left_gate_offset = vector(nmos_gate_pin.lx(),self.middle_position.y)
contact_offset = left_gate_offset - vector(0.5*self.poly_contact.height,0)
self.add_center_contact(layers=("poly", "contact", "metal1"),
self.add_contact_center(layers=("poly", "contact", "metal1"),
offset=contact_offset,
rotate=90)
self.add_layout_pin_center_segment(text="A",
@ -273,7 +273,7 @@ class pinv(design.design):
# This is to ensure that the contact is connected to the gate
mid_point = contact_offset.scale(0.5,1)+left_gate_offset.scale(0.5,0)
self.add_center_rect(layer="poly",
self.add_rect_center(layer="poly",
offset=mid_point,
height=self.poly_contact.first_layer_width,
width=left_gate_offset.x-contact_offset.x)
@ -322,7 +322,7 @@ class pinv(design.design):
# Offset by half a contact in x and y
nwell_offset += vector(0.5*self.nmos.active_contact.first_layer_width,
0.5*self.nmos.active_contact.first_layer_height)
self.nwell_contact=self.add_center_contact(layers=layer_stack,
self.nwell_contact=self.add_contact_center(layers=layer_stack,
offset=nwell_offset,
size=(1,self.nmos.num_contacts))
self.add_path("metal1",[nwell_offset,nwell_offset.scale(1,0)])
@ -348,7 +348,7 @@ class pinv(design.design):
# Offset by half a contact
pwell_offset += vector(0.5*self.pmos.active_contact.first_layer_width,
0.5*self.pmos.active_contact.first_layer_height)
self.pwell_contact=self.add_center_contact(layers=layer_stack,
self.pwell_contact=self.add_contact_center(layers=layer_stack,
offset=pwell_offset,
size=(1,self.pmos.num_contacts))
self.add_path("metal1",[pwell_offset,vector(pwell_offset.x,self.height)])

View File

@ -221,7 +221,7 @@ class ptx(design.design):
for i in range(0, self.mults):
# Add this duplicate rectangle in case we remove the pin when joining fingers
self.add_center_rect(layer="poly",
self.add_rect_center(layer="poly",
offset=poly_offset,
height=self.poly_height,
width=self.poly_width)
@ -298,7 +298,7 @@ class ptx(design.design):
[source_positions,drain_positions] = self.get_contact_positions()
for pos in source_positions:
contact=self.add_center_contact(layers=("active", "contact", "metal1"),
contact=self.add_contact_center(layers=("active", "contact", "metal1"),
offset=pos,
size=(1, self.num_contacts))
self.add_layout_pin_center_rect(text="S",
@ -309,7 +309,7 @@ class ptx(design.design):
for pos in drain_positions:
contact=self.add_center_contact(layers=("active", "contact", "metal1"),
contact=self.add_contact_center(layers=("active", "contact", "metal1"),
offset=pos,
size=(1, self.num_contacts))
self.add_layout_pin_center_rect(text="D",

View File

@ -215,12 +215,12 @@ class sram(design.design):
break
rail_pos = vector(pin_pos.x,self.horz_control_bus_positions[n].y)
self.add_path("metal2",[pin_pos,rail_pos])
self.add_center_via(("metal1","via1","metal2"),rail_pos)
self.add_via_center(("metal1","via1","metal2"),rail_pos)
# connect the control logic cross bar
for n in self.control_logic_outputs:
cross_pos = vector(self.vert_control_bus_positions[n].x,self.horz_control_bus_positions[n].y)
self.add_center_via(("metal1","via1","metal2"),cross_pos)
self.add_via_center(("metal1","via1","metal2"),cross_pos)
# connect the bank select signals to the vertical bus
for i in range(self.num_banks):
@ -228,7 +228,7 @@ class sram(design.design):
pin_pos = pin.rc() if i==0 else pin.lc()
rail_pos = vector(self.vert_control_bus_positions["bank_sel[{}]".format(i)].x,pin_pos.y)
self.add_path("metal3",[pin_pos,rail_pos])
self.add_center_via(("metal2","via2","metal3"),rail_pos)
self.add_via_center(("metal2","via2","metal3"),rail_pos)
# connect the horizontal control bus to the vertical bus
@ -244,13 +244,13 @@ class sram(design.design):
pin_pos = self.bank_inst[i].get_pin(n).bc()
rail_pos = vector(pin_pos.x,self.data_bus_positions[n].y)
self.add_path("metal2",[pin_pos,rail_pos])
self.add_center_via(("metal2","via2","metal3"),rail_pos)
self.add_via_center(("metal2","via2","metal3"),rail_pos)
for i in [2,3]:
pin_pos = self.bank_inst[i].get_pin(n).uc()
rail_pos = vector(pin_pos.x,self.data_bus_positions[n].y)
self.add_path("metal2",[pin_pos,rail_pos])
self.add_center_via(("metal2","via2","metal3"),rail_pos)
self.add_via_center(("metal2","via2","metal3"),rail_pos)
# route msb address bits
# route 2:4 decoder
@ -269,7 +269,7 @@ class sram(design.design):
pin1_pos = self.bank_inst[bank_id+1].get_pin(n).lc()
rail_pos = vector(self.vert_control_bus_positions[n].x,pin0_pos.y)
self.add_path("metal3",[pin0_pos,pin1_pos])
self.add_center_via(("metal2","via2","metal3"),rail_pos)
self.add_via_center(("metal2","via2","metal3"),rail_pos)
self.route_bank_supply_rails(bottom_banks=[2,3])
@ -477,7 +477,7 @@ class sram(design.design):
pin_pos = self.bank_inst[i].get_pin(n).uc()
rail_pos = vector(pin_pos.x,self.data_bus_positions[n].y)
self.add_path("metal2",[pin_pos,rail_pos])
self.add_center_via(("metal2","via2","metal3"),rail_pos)
self.add_via_center(("metal2","via2","metal3"),rail_pos)
self.route_single_msb_address()
@ -492,7 +492,7 @@ class sram(design.design):
pin1_pos = self.bank_inst[1].get_pin(n).lc()
rail_pos = vector(self.vert_control_bus_positions[n].x,pin0_pos.y)
self.add_path("metal3",[pin0_pos,pin1_pos])
self.add_center_via(("metal2","via2","metal3"),rail_pos)
self.add_via_center(("metal2","via2","metal3"),rail_pos)
self.route_bank_supply_rails(bottom_banks=[0,1])
@ -512,7 +512,7 @@ class sram(design.design):
break
rail_pos = vector(self.vert_control_bus_positions[self.msb_bank_sel_addr[i]].x,msb_pin_pos.y)
self.add_path("metal3",[msb_pin_pos,rail_pos])
self.add_center_via(("metal2","via2","metal3"),rail_pos)
self.add_via_center(("metal2","via2","metal3"),rail_pos)
# Connect clk
clk_pin = self.msb_address_inst.get_pin("clk")
@ -527,7 +527,7 @@ class sram(design.design):
msb_pin_pos = msb_pin.lc()
rail_pos = vector(self.vert_control_bus_positions["bank_sel[{}]".format(i)].x,msb_pin_pos.y)
self.add_path("metal1",[msb_pin_pos,rail_pos])
self.add_center_via(("metal1","via1","metal2"),rail_pos)
self.add_via_center(("metal1","via1","metal2"),rail_pos)
# connect MSB flop outputs to the bank decoder inputs
msb_pin = self.msb_address_inst.get_pin("dout[0]")
@ -537,8 +537,8 @@ class sram(design.design):
out_pos = msb_pin_pos + vector(1*self.m2_pitch,0) # route out to the right
up_pos = vector(out_pos.x,in_pos.y) # and route up to the decoer
self.add_wire(("metal1","via1","metal2"),[msb_pin_pos,out_pos,up_pos,in_pos])
self.add_center_via(("metal1","via1","metal2"),in_pos)
self.add_center_via(("metal1","via1","metal2"),msb_pin_pos,rotate=90)
self.add_via_center(("metal1","via1","metal2"),in_pos)
self.add_via_center(("metal1","via1","metal2"),msb_pin_pos,rotate=90)
msb_pin = self.msb_address_inst.get_pin("dout[1]")
msb_pin_pos = msb_pin.rc()
@ -547,8 +547,8 @@ class sram(design.design):
out_pos = msb_pin_pos + vector(2*self.m2_pitch,0) # route out to the right
up_pos = vector(out_pos.x,in_pos.y) # and route up to the decoer
self.add_wire(("metal1","via1","metal2"),[msb_pin_pos,out_pos,up_pos,in_pos])
self.add_center_via(("metal1","via1","metal2"),in_pos)
self.add_center_via(("metal1","via1","metal2"),msb_pin_pos,rotate=90)
self.add_via_center(("metal1","via1","metal2"),in_pos)
self.add_via_center(("metal1","via1","metal2"),msb_pin_pos,rotate=90)
# Route the right-most vdd/gnd of the right upper bank to the top of the decoder
vdd_pins = self.bank_inst[1].get_pins("vdd")
@ -599,9 +599,9 @@ class sram(design.design):
down_pos = vdd_pos - vector(0,self.m1_pitch)
rail_pos = vector(vdd_pos.x,self.horz_control_bus_positions["vdd"].y)
self.add_path("metal1",[vdd_pos,down_pos])
self.add_center_via(("metal1","via1","metal2"),down_pos,rotate=90)
self.add_via_center(("metal1","via1","metal2"),down_pos,rotate=90)
self.add_path("metal2",[down_pos,rail_pos])
self.add_center_via(("metal1","via1","metal2"),rail_pos)
self.add_via_center(("metal1","via1","metal2"),rail_pos)
# gnd pins go right to the rail
gnd_pins = self.msb_address_inst.get_pins("gnd")
for gnd_pin in gnd_pins:
@ -609,7 +609,7 @@ class sram(design.design):
gnd_pos = gnd_pin.rc()
rail_pos = vector(bank_gnd_pos.x+bank_gnd_pin.width(),gnd_pos.y)
self.add_path("metal1",[gnd_pos,rail_pos])
self.add_center_via(("metal1","via1","metal2"),gnd_pos,rotate=90)
self.add_via_center(("metal1","via1","metal2"),gnd_pos,rotate=90)
self.add_via(("metal1","via1","metal2"),rail_pos- vector(0,0.5*self.m1_width),rotate=90,size=[1,3])
def route_single_msb_address(self):
@ -623,9 +623,9 @@ class sram(design.design):
down_pos = vdd_pos - vector(0,self.m1_pitch)
rail_pos = vector(vdd_pos.x,self.horz_control_bus_positions["vdd"].y)
self.add_path("metal1",[vdd_pos,down_pos])
self.add_center_via(("metal1","via1","metal2"),down_pos,rotate=90)
self.add_via_center(("metal1","via1","metal2"),down_pos,rotate=90)
self.add_path("metal2",[down_pos,rail_pos])
self.add_center_via(("metal1","via1","metal2"),rail_pos)
self.add_via_center(("metal1","via1","metal2"),rail_pos)
gnd_pins = self.msb_address_inst.get_pins("gnd")
# Only add the ground connection to the lowest metal2 rail in the flop array
@ -638,7 +638,7 @@ class sram(design.design):
gnd_pos = gnd_pin.ur()
rail_pos = vector(gnd_pos.x,self.horz_control_bus_positions["gnd"].y)
self.add_path("metal2",[gnd_pos,rail_pos])
self.add_center_via(("metal1","via1","metal2"),rail_pos)
self.add_via_center(("metal1","via1","metal2"),rail_pos)
# connect the MSB flop to the address input bus
msb_pins = self.msb_address_inst.get_pins("din[0]")
@ -648,7 +648,7 @@ class sram(design.design):
break
rail_pos = vector(self.vert_control_bus_positions[self.msb_bank_sel_addr].x,msb_pin_pos.y)
self.add_path("metal3",[msb_pin_pos,rail_pos])
self.add_center_via(("metal2","via2","metal3"),rail_pos)
self.add_via_center(("metal2","via2","metal3"),rail_pos)
# Connect the output bar to select 0
msb_out_pin = self.msb_address_inst.get_pin("dout_bar[0]")
@ -658,7 +658,7 @@ class sram(design.design):
rail_pos = vector(self.vert_control_bus_positions["bank_sel[0]"].x,out_extend_up_pos.y)
self.add_path("metal2",[msb_out_pos,out_extend_right_pos,out_extend_up_pos])
self.add_wire(("metal3","via2","metal2"),[out_extend_right_pos,out_extend_up_pos,rail_pos])
self.add_center_via(("metal2","via2","metal3"),rail_pos)
self.add_via_center(("metal2","via2","metal3"),rail_pos)
# Connect the output to select 1
msb_out_pin = self.msb_address_inst.get_pin("dout[0]")
@ -668,7 +668,7 @@ class sram(design.design):
rail_pos = vector(self.vert_control_bus_positions["bank_sel[1]"].x,out_extend_down_pos.y)
self.add_path("metal2",[msb_out_pos,out_extend_right_pos,out_extend_down_pos])
self.add_wire(("metal3","via2","metal2"),[out_extend_right_pos,out_extend_down_pos,rail_pos])
self.add_center_via(("metal2","via2","metal3"),rail_pos)
self.add_via_center(("metal2","via2","metal3"),rail_pos)
# Connect clk
clk_pin = self.msb_address_inst.get_pin("clk")

View File

@ -141,10 +141,10 @@ class wordline_driver(design.design):
a_pin = inv1_inst.get_pin("A")
a_pos = a_pin.lc()
clk_offset = vector(en_pin.bc().x,a_pos.y)
self.add_center_segment(layer="metal1",
self.add_segment_center(layer="metal1",
start=clk_offset,
end=a_pos)
m1m2_via = self.add_center_via(layers=("metal1", "via1", "metal2"),
m1m2_via = self.add_via_center(layers=("metal1", "via1", "metal2"),
offset=clk_offset)
# first inv to nand2 B
@ -171,14 +171,14 @@ class wordline_driver(design.design):
layer="metal1",
start=input_offset,
end=mid_via_offset)
self.add_center_via(layers=("metal1", "via1", "metal2"),
self.add_via_center(layers=("metal1", "via1", "metal2"),
offset=mid_via_offset)
# now connect to the nand2 A
self.add_center_segment(layer="metal2",
self.add_segment_center(layer="metal2",
start=mid_via_offset,
end=a_pos)
self.add_center_via(layers=("metal1", "via1", "metal2"),
self.add_via_center(layers=("metal1", "via1", "metal2"),
offset=a_pos + vector(0.5*m1m2_via.height,0),
rotate=90)