2019-04-26 12:21:50 -07:00
|
|
|
# See LICENSE for licensing information.
|
|
|
|
|
#
|
2024-01-03 14:32:44 -08:00
|
|
|
# Copyright (c) 2016-2024 Regents of the University of California and The Board
|
2019-06-14 08:43:41 -07: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 12:21:50 -07:00
|
|
|
#
|
2017-11-15 17:02:53 -08:00
|
|
|
import os
|
2022-11-27 13:01:20 -08:00
|
|
|
from openram import debug
|
|
|
|
|
from openram import OPTS, find_exe, get_tool
|
2018-05-11 16:32:00 -07:00
|
|
|
from .lib import *
|
|
|
|
|
from .delay import *
|
2020-12-02 14:06:39 -08:00
|
|
|
from .elmore import *
|
2020-12-02 15:20:50 -08:00
|
|
|
from .linear_regression import *
|
2021-06-07 12:26:45 -07:00
|
|
|
from .neural_network import *
|
2018-05-11 16:32:00 -07:00
|
|
|
from .setup_hold import *
|
2018-09-20 15:04:59 -07:00
|
|
|
from .functional import *
|
2018-10-04 09:29:44 -07:00
|
|
|
from .simulation import *
|
2018-12-19 18:33:06 -08:00
|
|
|
from .measurements import *
|
2019-01-03 05:51:28 -08:00
|
|
|
from .model_check import *
|
2020-12-02 15:20:50 -08:00
|
|
|
from .analytical_util import *
|
2023-01-23 17:44:38 -08:00
|
|
|
from .fake_sram import *
|
2017-11-15 17:02:53 -08:00
|
|
|
|
2021-02-10 12:10:04 -08:00
|
|
|
debug.info(1, "Initializing characterizer...")
|
2018-01-26 13:00:25 -08:00
|
|
|
OPTS.spice_exe = ""
|
2017-11-15 17:02:53 -08:00
|
|
|
|
2023-07-07 12:39:19 -07:00
|
|
|
if not OPTS.analytical_delay or OPTS.top_process in ["memfunc", "memchar"]:
|
2021-06-01 16:41:14 -07:00
|
|
|
if OPTS.spice_name:
|
2021-05-14 16:16:25 -07:00
|
|
|
# Capitalize Xyce
|
|
|
|
|
if OPTS.spice_name == "xyce":
|
|
|
|
|
OPTS.spice_name = "Xyce"
|
2018-01-26 13:00:25 -08:00
|
|
|
OPTS.spice_exe=find_exe(OPTS.spice_name)
|
2018-10-25 09:08:56 -07:00
|
|
|
if OPTS.spice_exe=="" or OPTS.spice_exe==None:
|
2021-02-10 12:10:04 -08:00
|
|
|
debug.error("{0} not found. Unable to perform characterization.".format(OPTS.spice_name), 1)
|
2017-11-15 17:02:53 -08:00
|
|
|
else:
|
2021-05-21 12:05:10 -07:00
|
|
|
(OPTS.spice_name, OPTS.spice_exe) = get_tool("spice", ["Xyce", "ngspice", "ngspice.exe", "hspice", "xa"])
|
2017-11-15 17:02:53 -08:00
|
|
|
|
2021-05-18 14:58:57 -07:00
|
|
|
if OPTS.spice_name in ["Xyce", "xyce"]:
|
2021-05-14 11:45:37 -07:00
|
|
|
(OPTS.mpi_name, OPTS.mpi_exe) = get_tool("mpi", ["mpirun"])
|
2021-05-14 16:16:25 -07:00
|
|
|
OPTS.hier_seperator = ":"
|
2021-05-14 11:45:37 -07:00
|
|
|
else:
|
|
|
|
|
OPTS.mpi_name = None
|
|
|
|
|
OPTS.mpi_exe = ""
|
|
|
|
|
|
2020-11-03 06:29:17 -08:00
|
|
|
# set the input dir for spice files if using ngspice
|
2017-11-22 15:57:29 -08:00
|
|
|
if OPTS.spice_name == "ngspice":
|
2017-11-15 17:02:53 -08:00
|
|
|
os.environ["NGSPICE_INPUT_DIR"] = "{0}".format(OPTS.openram_temp)
|
2020-11-03 06:29:17 -08:00
|
|
|
|
2021-06-01 16:41:14 -07:00
|
|
|
if not OPTS.spice_exe:
|
2021-02-10 12:10:04 -08:00
|
|
|
debug.error("No recognizable spice version found. Unable to perform characterization.", 1)
|
2021-05-14 16:16:25 -07: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 12:00:15 -07:00
|
|
|
else:
|
2021-02-10 12:10:04 -08:00
|
|
|
debug.info(1, "Analytical model enabled.")
|
2017-11-15 17:02:53 -08:00
|
|
|
|