2019-04-26 21:21:50 +02:00
|
|
|
# See LICENSE for licensing information.
|
|
|
|
|
#
|
2021-01-22 20:23:28 +01:00
|
|
|
# Copyright (c) 2016-2021 Regents of the University of California and The Board
|
2019-06-14 17:43:41 +02:00
|
|
|
# of Regents for the Oklahoma Agricultural and Mechanical College
|
|
|
|
|
# (acting for and on behalf of Oklahoma State University)
|
|
|
|
|
# All rights reserved.
|
2019-04-26 21:21:50 +02:00
|
|
|
#
|
2017-11-16 02:02:53 +01:00
|
|
|
import os
|
|
|
|
|
import debug
|
2021-02-10 21:10:04 +01:00
|
|
|
from globals import OPTS, find_exe, get_tool
|
2018-05-12 01:32:00 +02:00
|
|
|
from .lib import *
|
|
|
|
|
from .delay import *
|
2020-12-02 23:06:39 +01:00
|
|
|
from .elmore import *
|
2020-12-03 00:20:50 +01:00
|
|
|
from .linear_regression import *
|
2018-05-12 01:32:00 +02:00
|
|
|
from .setup_hold import *
|
2018-09-21 00:04:59 +02:00
|
|
|
from .functional import *
|
2018-10-04 18:29:44 +02:00
|
|
|
from .simulation import *
|
2018-12-20 03:33:06 +01:00
|
|
|
from .measurements import *
|
2019-01-03 14:51:28 +01:00
|
|
|
from .model_check import *
|
2020-12-03 00:20:50 +01:00
|
|
|
from .analytical_util import *
|
2021-01-19 23:19:50 +01:00
|
|
|
from .regression_model import *
|
2017-11-16 02:02:53 +01:00
|
|
|
|
2021-02-10 21:10:04 +01:00
|
|
|
debug.info(1, "Initializing characterizer...")
|
2018-01-26 22:00:25 +01:00
|
|
|
OPTS.spice_exe = ""
|
2017-11-16 02:02:53 +01:00
|
|
|
|
2018-01-05 17:32:23 +01:00
|
|
|
if not OPTS.analytical_delay:
|
2017-11-23 00:57:29 +01:00
|
|
|
if OPTS.spice_name != "":
|
2021-05-15 01:16:25 +02:00
|
|
|
# Capitalize Xyce
|
|
|
|
|
if OPTS.spice_name == "xyce":
|
|
|
|
|
OPTS.spice_name = "Xyce"
|
2018-01-26 22:00:25 +01:00
|
|
|
OPTS.spice_exe=find_exe(OPTS.spice_name)
|
2018-10-25 18:08:56 +02:00
|
|
|
if OPTS.spice_exe=="" or OPTS.spice_exe==None:
|
2021-02-10 21:10:04 +01:00
|
|
|
debug.error("{0} not found. Unable to perform characterization.".format(OPTS.spice_name), 1)
|
2017-11-16 02:02:53 +01:00
|
|
|
else:
|
2021-05-14 20:28:29 +02:00
|
|
|
(OPTS.spice_name, OPTS.spice_exe) = get_tool("spice", ["Xyce", "ngspice", "ngspice.exe", "hspice", "xa"])
|
2017-11-16 02:02:53 +01:00
|
|
|
|
2021-05-14 20:45:37 +02:00
|
|
|
if OPTS.spice_name == "Xyce":
|
|
|
|
|
(OPTS.mpi_name, OPTS.mpi_exe) = get_tool("mpi", ["mpirun"])
|
2021-05-15 01:16:25 +02:00
|
|
|
OPTS.hier_seperator = ":"
|
2021-05-14 20:45:37 +02:00
|
|
|
else:
|
|
|
|
|
OPTS.mpi_name = None
|
|
|
|
|
OPTS.mpi_exe = ""
|
|
|
|
|
|
2020-11-03 15:29:17 +01:00
|
|
|
# set the input dir for spice files if using ngspice
|
2017-11-23 00:57:29 +01:00
|
|
|
if OPTS.spice_name == "ngspice":
|
2017-11-16 02:02:53 +01:00
|
|
|
os.environ["NGSPICE_INPUT_DIR"] = "{0}".format(OPTS.openram_temp)
|
2020-11-03 15:29:17 +01:00
|
|
|
|
2018-01-26 22:00:25 +01:00
|
|
|
if OPTS.spice_exe == "":
|
2021-02-10 21:10:04 +01:00
|
|
|
debug.error("No recognizable spice version found. Unable to perform characterization.", 1)
|
2021-05-15 01:16:25 +02:00
|
|
|
else:
|
|
|
|
|
debug.info(1, "Finding spice simulator: {} ({})".format(OPTS.spice_name, OPTS.spice_exe))
|
|
|
|
|
if OPTS.mpi_name:
|
|
|
|
|
debug.info(1, "MPI for spice simulator: {} ({})".format(OPTS.mpi_name, OPTS.mpi_exe))
|
|
|
|
|
debug.info(1, "Simulation threads: {}".format(OPTS.num_sim_threads))
|
|
|
|
|
|
2018-07-11 21:00:15 +02:00
|
|
|
else:
|
2021-02-10 21:10:04 +01:00
|
|
|
debug.info(1, "Analytical model enabled.")
|
2017-11-16 02:02:53 +01:00
|
|
|
|
2018-01-26 22:00:25 +01:00
|
|
|
|