diff --git a/compiler/base/hierarchy_design.py b/compiler/base/hierarchy_design.py index 20c40f21..ac3fb30b 100644 --- a/compiler/base/hierarchy_design.py +++ b/compiler/base/hierarchy_design.py @@ -11,7 +11,7 @@ import verify import debug import os from globals import OPTS - +import tech 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 # 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): self.lvs_file = lvs_dir + name + ".sp" else: diff --git a/compiler/pgates/ptx.py b/compiler/pgates/ptx.py index fb127158..9af08e61 100644 --- a/compiler/pgates/ptx.py +++ b/compiler/pgates/ptx.py @@ -131,8 +131,8 @@ 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": - # sky130 technology is in microns, also needs mult parameter + if OPTS.tech_name == "sky130" 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], self.mults, @@ -152,19 +152,17 @@ class ptx(design.design): self.spice_device = main_str + area_str self.spice.append("\n* ptx " + self.spice_device) - # LVS lib is always in SI units - if os.path.exists(OPTS.openram_tech + "lvs_lib"): - if OPTS.tech_name == "sky130": - # 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, - self.tx_width, - drc("minwidth_poly")) - else: - self.lvs_device = "M{{0}} {{1}} {0} m={1} w={2}u l={3}u ".format(spice[self.tx_type], - self.mults, - self.tx_width, - drc("minwidth_poly")) + if OPTS.tech_name == "sky130" 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, + self.tx_width, + drc("minwidth_poly")) + else: + self.lvs_device = "M{{0}} {{1}} {0} m={1} w={2}u l={3}u ".format(spice[self.tx_type], + self.mults, + self.tx_width, + drc("minwidth_poly")) def setup_layout_constants(self): """