Merge branch 'spmodels' into s8_single_port

This commit is contained in:
jcirimel 2020-10-26 01:42:19 -07:00
commit ff464601f3
2 changed files with 28 additions and 15 deletions

View File

@ -33,11 +33,22 @@ class stimuli():
self.sf = stim_file
(self.process, self.voltage, self.temperature) = corner
found = False
self.device_libraries = []
self.device_models = []
try:
self.device_libraries = tech.spice["fet_libraries"][self.process]
except:
self.device_models = tech.spice["fet_models"][self.process]
self.device_libraries += tech.spice["fet_libraries"][self.process]
found = True
except KeyError:
pass
try:
self.device_models += tech.spice["fet_models"][self.process]
found = True
except KeyError:
pass
if not found:
debug.error("Must define either fet_libraries or fet_models.", -1)
def inst_model(self, pins, model_name):
""" Function to instantiate a generic model with a set of pins """
@ -265,16 +276,14 @@ class stimuli():
"""Writes include statements, inputs are lists of model files"""
self.sf.write("* {} process corner\n".format(self.process))
if OPTS.tech_name == "sky130":
for item in self.device_libraries:
if os.path.isfile(item[0]):
self.sf.write(".lib \"{0}\" {1}\n".format(item[0], item[1]))
else:
debug.error("Could not find spice library: {0}\nSet SPICE_MODEL_DIR to over-ride path.\n".format(item[0]))
includes = [circuit]
else:
includes = self.device_models + [circuit]
for item in self.device_libraries:
if os.path.isfile(item[0]):
self.sf.write(".lib \"{0}\" {1}\n".format(item[0], item[1]))
else:
debug.error("Could not find spice library: {0}\nSet SPICE_MODEL_DIR to over-ride path.\n".format(item[0]))
includes = self.device_models + [circuit]
for item in list(includes):
if os.path.isfile(item):
self.sf.write(".include \"{0}\"\n".format(item))

View File

@ -152,7 +152,11 @@ class ptx(design.design):
if OPTS.tech_name == "sky130" and OPTS.lvs_exe and OPTS.lvs_exe[0] == "calibre":
# sky130 requires mult parameter too
self.lvs_device = "X{{0}} {{1}} {0} m={1} w={2} l={3} mult={1}".format(spice[self.tx_type],
# self.lvs_device = "X{{0}} {{1}} {0} m={1} w={2} l={3} mult={1}".format(spice[self.tx_type],
# self.mults,
# self.tx_width,
# drc("minwidth_poly"))
self.lvs_device = "M{{0}} {{1}} {0} m={1} w={2} l={3} mult={1}".format("nshort" if self.tx_type == "nmos" else "pshort",
self.mults,
self.tx_width,
drc("minwidth_poly"))