From ba92467fec2967a7f652c540c10ff80535aa3788 Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 24 Jun 2020 12:07:47 -0700 Subject: [PATCH] Add no well enclosure for techs without wells --- compiler/pgates/pgate.py | 62 +++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/compiler/pgates/pgate.py b/compiler/pgates/pgate.py index 9fa8c916..02a04b97 100644 --- a/compiler/pgates/pgate.py +++ b/compiler/pgates/pgate.py @@ -252,31 +252,47 @@ class pgate(design.design): """ Add top-to-bottom implants for adjacency issues in s8. """ + if self.add_wells: + rightx = None + else: + rightx = self.width + nmos_insts = self.get_tx_insts("nmos") + if len(nmos_insts) > 0: + self.add_enclosure(nmos_insts, + layer="nimplant", + extend=self.implant_enclose_active, + leftx=0, + rightx=rightx, + boty=0) + pmos_insts = self.get_tx_insts("pmos") - ntap_insts = [self.nwell_contact] - ptap_insts = [self.pwell_contact] - - self.add_enclosure(nmos_insts, - layer="nimplant", - extend=self.implant_enclose_active, - leftx=0, - boty=0) - self.add_enclosure(pmos_insts, - layer="pimplant", - extend=self.implant_enclose_active, - leftx=0, - topy=self.height) - self.add_enclosure(ntap_insts, - layer="nimplant", - extend=self.implant_enclose_active, - rightx=self.width, - topy=self.height) - self.add_enclosure(ptap_insts, - layer="pimplant", - extend=self.implant_enclose_active, - rightx=self.width, - boty=0) + if len(pmos_insts) > 0: + self.add_enclosure(pmos_insts, + layer="pimplant", + extend=self.implant_enclose_active, + leftx=0, + rightx=rightx, + topy=self.height) + + try: + ntap_insts = [self.nwell_contact] + self.add_enclosure(ntap_insts, + layer="nimplant", + extend=self.implant_enclose_active, + rightx=self.width, + topy=self.height) + except AttributeError: + pass + try: + ptap_insts = [self.pwell_contact] + self.add_enclosure(ptap_insts, + layer="pimplant", + extend=self.implant_enclose_active, + rightx=self.width, + boty=0) + except AttributeError: + pass def add_pwell_contact(self, nmos, nmos_pos): """ Add an pwell contact next to the given nmos device. """