From f71cfe0d9d41c36c3739c49a27c239a26cac01b5 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Fri, 13 Dec 2019 14:56:14 -0800 Subject: [PATCH] Generalize active and poly stacks --- compiler/bitcells/pbitcell.py | 4 ++-- compiler/pgates/pgate.py | 4 ++-- compiler/pgates/precharge.py | 2 +- compiler/pgates/ptristate_inv.py | 2 +- compiler/pgates/ptx.py | 6 +++--- compiler/pgates/single_level_column_mux.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compiler/bitcells/pbitcell.py b/compiler/bitcells/pbitcell.py index 0f4b8183..8f9cd602 100644 --- a/compiler/bitcells/pbitcell.py +++ b/compiler/bitcells/pbitcell.py @@ -1019,7 +1019,7 @@ class pbitcell(bitcell_base.bitcell_base): # add well contacts # connect pimplants to gnd offset = vector(0, self.gnd_position.y) - self.add_via_center(layers=("active", "contact", "metal1"), + self.add_via_center(layers=self.active_stack, offset=offset, directions=("H", "H"), implant_type="p", @@ -1027,7 +1027,7 @@ class pbitcell(bitcell_base.bitcell_base): # connect nimplants to vdd offset = vector(0, self.vdd_position.y) - self.add_via_center(layers=("active", "contact", "metal1"), + self.add_via_center(layers=self.active_stack, offset=offset, directions=("H", "H"), implant_type="n", diff --git a/compiler/pgates/pgate.py b/compiler/pgates/pgate.py index 5ad98fad..b55ad9c3 100644 --- a/compiler/pgates/pgate.py +++ b/compiler/pgates/pgate.py @@ -168,7 +168,7 @@ class pgate(design.design): def add_nwell_contact(self, pmos, pmos_pos): """ Add an nwell contact next to the given pmos device. """ - layer_stack = ("active", "contact", "metal1") + layer_stack = self.active_stack # To the right a spacing away from the pmos right active edge contact_xoffset = pmos_pos.x + pmos.active_width \ @@ -221,7 +221,7 @@ class pgate(design.design): def add_pwell_contact(self, nmos, nmos_pos): """ Add an pwell contact next to the given nmos device. """ - layer_stack = ("active", "contact", "metal1") + layer_stack = self.active_stack pwell_position = vector(0, -0.5 * self.m1_width) diff --git a/compiler/pgates/precharge.py b/compiler/pgates/precharge.py index d27b9f9c..9641a1f3 100644 --- a/compiler/pgates/precharge.py +++ b/compiler/pgates/precharge.py @@ -177,7 +177,7 @@ class precharge(design.design): well_contact_pos = self.upper_pmos1_inst.get_pin("D").center().scale(1, 0) \ + vector(0, self.upper_pmos1_inst.uy() + contact.well.height / 2 \ + drc("well_extend_active")) - self.add_via_center(layers=("active", "contact", "metal1"), + self.add_via_center(layers=self.active_stack, offset=well_contact_pos, implant_type="n", well_type="n") diff --git a/compiler/pgates/ptristate_inv.py b/compiler/pgates/ptristate_inv.py index 2a972407..4a17b46a 100644 --- a/compiler/pgates/ptristate_inv.py +++ b/compiler/pgates/ptristate_inv.py @@ -191,7 +191,7 @@ class ptristate_inv(pgate.pgate): supplies AFTER the wells are created """ - layer_stack = ("active", "contact", "metal1") + layer_stack = self.active_stack drain_pos = self.nmos1_inst.get_pin("S").center() vdd_pos = self.get_pin("vdd").center() diff --git a/compiler/pgates/ptx.py b/compiler/pgates/ptx.py index d0854711..61610a88 100644 --- a/compiler/pgates/ptx.py +++ b/compiler/pgates/ptx.py @@ -124,7 +124,7 @@ class ptx(design.design): # This is not actually instantiated but used for calculations self.active_contact = factory.create(module_type="contact", - layer_stack=("active", "contact", "metal1"), + layer_stack=self.active_stack, dimensions=(1, self.num_contacts)) @@ -373,7 +373,7 @@ class ptx(design.design): [source_positions,drain_positions] = self.get_contact_positions() for pos in source_positions: - contact=self.add_via_center(layers=("active", "contact", "metal1"), + contact=self.add_via_center(layers=self.active_stack, offset=pos, size=(1, self.num_contacts), directions=("H","V"), @@ -387,7 +387,7 @@ class ptx(design.design): for pos in drain_positions: - contact=self.add_via_center(layers=("active", "contact", "metal1"), + contact=self.add_via_center(layers=self.active_stack, offset=pos, size=(1, self.num_contacts), directions=("H","V"), diff --git a/compiler/pgates/single_level_column_mux.py b/compiler/pgates/single_level_column_mux.py index a642eeca..525c1680 100644 --- a/compiler/pgates/single_level_column_mux.py +++ b/compiler/pgates/single_level_column_mux.py @@ -175,7 +175,7 @@ class single_level_column_mux(pgate.pgate): # Add it to the right, aligned in between the two tx active_pos = vector(self.bitcell.width, self.nmos_upper.by() - 0.5 * self.poly_space) - self.add_via_center(layers=("active", "contact", "metal1"), + self.add_via_center(layers=self.active_stack, offset=active_pos, implant_type="p", well_type="p")