Use different LVS libs based on tech and sky130

This commit is contained in:
mrg 2020-06-23 14:53:24 -07:00
parent 031862c749
commit e849a9b973
2 changed files with 19 additions and 17 deletions

View File

@ -11,7 +11,7 @@ import verify
import debug import debug
import os import os
from globals import OPTS from globals import OPTS
import tech
class hierarchy_design(hierarchy_spice.spice, hierarchy_layout.layout): class hierarchy_design(hierarchy_spice.spice, hierarchy_layout.layout):
""" """
@ -26,7 +26,11 @@ class hierarchy_design(hierarchy_spice.spice, hierarchy_layout.layout):
# If we have a separate lvs directory, then all the lvs files # If we have a separate lvs directory, then all the lvs files
# should be in there (all or nothing!) # should be in there (all or nothing!)
lvs_dir = OPTS.openram_tech + "lvs_lib/" try:
lvs_subdir = tech.lvs_lib
except AttributeError:
lvs_subdir = "lvs_lib"
lvs_dir = OPTS.openram_tech + lvs_subdir + "/"
if os.path.exists(lvs_dir): if os.path.exists(lvs_dir):
self.lvs_file = lvs_dir + name + ".sp" self.lvs_file = lvs_dir + name + ".sp"
else: else:

View File

@ -131,8 +131,8 @@ class ptx(design.design):
# be decided in the layout later. # be decided in the layout later.
area_sd = 2.5 * self.poly_width * self.tx_width area_sd = 2.5 * self.poly_width * self.tx_width
perimeter_sd = 2 * self.poly_width + 2 * self.tx_width perimeter_sd = 2 * self.poly_width + 2 * self.tx_width
if OPTS.tech_name == "sky130": if OPTS.tech_name == "sky130" and OPTS.lvs_exe[0] == "calibre":
# sky130 technology is in microns, also needs mult parameter # sky130 simulation cannot use the mult parameter in simulation
(self.tx_width, self.mults) = pgate.bin_width(self.tx_type, self.tx_width) (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], main_str = "M{{0}} {{1}} {0} m={1} w={2} l={3} ".format(spice[self.tx_type],
self.mults, self.mults,
@ -152,19 +152,17 @@ class ptx(design.design):
self.spice_device = main_str + area_str self.spice_device = main_str + area_str
self.spice.append("\n* ptx " + self.spice_device) self.spice.append("\n* ptx " + self.spice_device)
# LVS lib is always in SI units if OPTS.tech_name == "sky130" and OPTS.lvs_exe[0] == "calibre":
if os.path.exists(OPTS.openram_tech + "lvs_lib"): # sky130 requires mult parameter too
if OPTS.tech_name == "sky130": self.lvs_device = "M{{0}} {{1}} {0} m={1} w={2} l={3} mult={1}".format(spice[self.tx_type],
# sky130 requires mult parameter too self.mults,
self.lvs_device = "M{{0}} {{1}} {0} m={1} w={2} l={3} mult={1}".format(spice[self.tx_type], self.tx_width,
self.mults, drc("minwidth_poly"))
self.tx_width, else:
drc("minwidth_poly")) self.lvs_device = "M{{0}} {{1}} {0} m={1} w={2}u l={3}u ".format(spice[self.tx_type],
else: self.mults,
self.lvs_device = "M{{0}} {{1}} {0} m={1} w={2}u l={3}u ".format(spice[self.tx_type], self.tx_width,
self.mults, drc("minwidth_poly"))
self.tx_width,
drc("minwidth_poly"))
def setup_layout_constants(self): def setup_layout_constants(self):
""" """