From 2b7d89d2c155a2ffd7918c93309bd38dcf50912b Mon Sep 17 00:00:00 2001 From: mrg Date: Mon, 13 Jul 2020 14:59:31 -0700 Subject: [PATCH] Fix netlist_only in sky130 --- compiler/pgates/pinv_dec.py | 4 ---- compiler/pgates/ptx.py | 4 ++-- compiler/pgates/single_level_column_mux.py | 26 ++++++++++++++-------- compiler/verify/__init__.py | 6 +++-- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/compiler/pgates/pinv_dec.py b/compiler/pgates/pinv_dec.py index 3ce6ad80..4d4f2229 100644 --- a/compiler/pgates/pinv_dec.py +++ b/compiler/pgates/pinv_dec.py @@ -13,10 +13,6 @@ from vector import vector from globals import OPTS from sram_factory import factory -if(OPTS.tech_name == "sky130"): - from tech import nmos_bins, pmos_bins - - class pinv_dec(pinv.pinv): """ This is another version of pinv but with layout for the decoder. diff --git a/compiler/pgates/ptx.py b/compiler/pgates/ptx.py index ad741870..ce8591fd 100644 --- a/compiler/pgates/ptx.py +++ b/compiler/pgates/ptx.py @@ -129,7 +129,7 @@ class ptx(design.design): # be decided in the layout later. area_sd = 2.5 * self.poly_width * self.tx_width perimeter_sd = 2 * self.poly_width + 2 * self.tx_width - if OPTS.tech_name == "sky130" and OPTS.lvs_exe[0] == "calibre": + if OPTS.tech_name == "sky130" and OPTS.lvs_exe and OPTS.lvs_exe[0] == "calibre": # sky130 simulation cannot use the mult parameter in simulation (self.tx_width, self.mults) = pgate.bin_width(self.tx_type, self.tx_width) main_str = "M{{0}} {{1}} {0} m={1} w={2} l={3} ".format(spice[self.tx_type], @@ -150,7 +150,7 @@ class ptx(design.design): self.spice_device = main_str + area_str self.spice.append("\n* ptx " + self.spice_device) - if OPTS.tech_name == "sky130" and OPTS.lvs_exe[0] == "calibre": + if OPTS.tech_name == "sky130" and OPTS.lvs_exe and OPTS.lvs_exe[0] == "calibre": # sky130 requires mult parameter too self.lvs_device = "M{{0}} {{1}} {0} m={1} w={2} l={3} mult={1}".format(spice[self.tx_type], self.mults, diff --git a/compiler/pgates/single_level_column_mux.py b/compiler/pgates/single_level_column_mux.py index b594f2e4..ca7c3e51 100644 --- a/compiler/pgates/single_level_column_mux.py +++ b/compiler/pgates/single_level_column_mux.py @@ -56,7 +56,8 @@ class single_level_column_mux(pgate.pgate): self.pin_height = 2 * self.pin_width self.width = self.bitcell.width self.height = self.nmos_upper.uy() + self.pin_height - + + self.place_ptx() self.connect_poly() self.add_bitline_pins() self.connect_bitlines() @@ -104,20 +105,27 @@ class single_level_column_mux(pgate.pgate): """ Create the two pass gate NMOS transistors to switch the bitlines""" # Space it in the center - nmos_lower_position = self.nmos.active_offset.scale(0, 1) \ - + vector(0.5 * self.bitcell.width- 0.5 * self.nmos.active_width, 0) self.nmos_lower = self.add_inst(name="mux_tx1", - mod=self.nmos, - offset=nmos_lower_position) + mod=self.nmos) self.connect_inst(["bl", "sel", "bl_out", "gnd"]) # This aligns it directly above the other tx with gates abutting - nmos_upper_position = nmos_lower_position \ - + vector(0, self.nmos.active_height + max(self.active_space, self.poly_space)) self.nmos_upper = self.add_inst(name="mux_tx2", - mod=self.nmos, - offset=nmos_upper_position) + mod=self.nmos) self.connect_inst(["br", "sel", "br_out", "gnd"]) + + def place_ptx(self): + """ Create the two pass gate NMOS transistors to switch the bitlines""" + + # Space it in the center + nmos_lower_position = self.nmos.active_offset.scale(0, 1) \ + + vector(0.5 * self.bitcell.width- 0.5 * self.nmos.active_width, 0) + self.nmos_lower.place(nmos_lower_position) + + # This aligns it directly above the other tx with gates abutting + nmos_upper_position = nmos_lower_position \ + + vector(0, self.nmos.active_height + max(self.active_space, self.poly_space)) + self.nmos_upper.place(nmos_upper_position) if OPTS.tech_name == "sky130": self.add_implants() diff --git a/compiler/verify/__init__.py b/compiler/verify/__init__.py index a28581d8..4d9eb151 100644 --- a/compiler/verify/__init__.py +++ b/compiler/verify/__init__.py @@ -30,13 +30,15 @@ if not OPTS.check_lvsdrc: OPTS.drc_exe = None OPTS.lvs_exe = None OPTS.pex_exe = None + if OPTS.tech_name == "sky130": + OPTS.magic_exe = None else: debug.info(1, "Finding DRC/LVS/PEX tools.") OPTS.drc_exe = get_tool("DRC", ["calibre", "assura", "magic"], drc_name) OPTS.lvs_exe = get_tool("LVS", ["calibre", "assura", "netgen"], lvs_name) OPTS.pex_exe = get_tool("PEX", ["calibre", "magic"], pex_name) if OPTS.tech_name == "sky130": - OPTS.magic_exe = get_tool("GDS", ["magic"], None) + OPTS.magic_exe = get_tool("GDS", ["magic"]) if not OPTS.drc_exe: from .none import run_drc, print_drc_stats @@ -71,7 +73,7 @@ else: debug.warning("Did not find a supported PEX tool.") if OPTS.tech_name == "sky130": - if "magic"==OPTS.magic_exe[0]: + if OPTS.magic_exe and "magic"==OPTS.magic_exe[0]: from .magic import filter_gds else: debug.warning("Did not find Magic.")