1616from globals import OPTS
1717from pgate import pgate
1818
19+
1920class ptx (design .design ):
2021 """
2122 This module generates gds and spice of a parametrically NMOS or
@@ -24,6 +25,10 @@ class ptx(design.design):
2425 given width. Total width is therefore mults*width. Options allow
2526 you to connect the fingered gates and active for parallel devices.
2627 The add_*_contact option tells which layer to bring source/drain up to.
28+
29+ ll, ur, width and height refer to the active area.
30+ Wells and poly may extend beyond this.
31+
2732 """
2833 def __init__ (self ,
2934 name = "" ,
@@ -221,15 +226,13 @@ def setup_layout_constants(self):
221226 well_width_rule )
222227 self .well_height = max (self .active_height + 2 * self .well_enclose_active ,
223228 well_width_rule )
224- # We are going to shift the 0,0, so include that in the width and height
225- self .height = self .well_height - self .active_offset .y
226- self .width = self .well_width - self .active_offset .x
227229 else :
228- # The well is not included in the height and width
229- self .height = self .poly_height
230- self .width = self .active_width
231230 self .well_height = self .height
232231 self .well_width = self .width
232+
233+ # We are going to shift the 0,0, so include that in the width and height
234+ self .height = self .active_height
235+ self .width = self .active_width
233236
234237 # This is the center of the first active contact offset (centered vertically)
235238 self .contact_offset = self .active_offset + vector (0.5 * self .active_contact .width ,
@@ -353,18 +356,18 @@ def add_active(self):
353356 """
354357 Adding the diffusion (active region = diffusion region)
355358 """
356- self .add_rect (layer = "active" ,
357- offset = self .active_offset ,
358- width = self .active_width ,
359- height = self .active_height )
359+ self .active = self . add_rect (layer = "active" ,
360+ offset = self .active_offset ,
361+ width = self .active_width ,
362+ height = self .active_height )
360363 # If the implant must enclose the active, shift offset
361364 # and increase width/height
362365 enclose_width = self .implant_enclose_active
363366 enclose_offset = [enclose_width ] * 2
364- self .add_rect (layer = "{}implant" .format (self .implant_type ),
365- offset = self .active_offset - enclose_offset ,
366- width = self .active_width + 2 * enclose_width ,
367- height = self .active_height + 2 * enclose_width )
367+ self .implant = self . add_rect (layer = "{}implant" .format (self .implant_type ),
368+ offset = self .active_offset - enclose_offset ,
369+ width = self .active_width + 2 * enclose_width ,
370+ height = self .active_height + 2 * enclose_width )
368371
369372 def add_well_implant (self ):
370373 """
0 commit comments