2019-04-26 21:21:50 +02:00
|
|
|
# See LICENSE for licensing information.
|
|
|
|
|
#
|
2019-06-14 17:43:41 +02:00
|
|
|
# Copyright (c) 2016-2019 Regents of the University of California and The Board
|
|
|
|
|
# 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
|
2018-07-11 21:00:15 +02:00
|
|
|
import globals
|
2017-11-16 02:02:53 +01:00
|
|
|
from globals import OPTS,find_exe,get_tool
|
2018-05-12 01:32:00 +02:00
|
|
|
from .lib import *
|
|
|
|
|
from .delay import *
|
|
|
|
|
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 *
|
2017-11-16 02:02:53 +01:00
|
|
|
|
2018-07-11 21:00:15 +02: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:
|
2018-07-11 21:00:15 +02:00
|
|
|
debug.info(1, "Finding spice simulator.")
|
|
|
|
|
|
2017-11-23 00:57:29 +01:00
|
|
|
if OPTS.spice_name != "":
|
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:
|
2017-11-23 00:57:29 +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:
|
2019-01-04 04:20:31 +01:00
|
|
|
(OPTS.spice_name,OPTS.spice_exe) = get_tool("spice",["hspice", "ngspice", "ngspice.exe", "xa"])
|
2017-11-16 02:02:53 +01:00
|
|
|
|
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 == "":
|
2017-11-16 02:02:53 +01:00
|
|
|
debug.error("No recognizable spice version found. Unable to perform characterization.",1)
|
2018-07-11 21:00:15 +02:00
|
|
|
else:
|
|
|
|
|
debug.info(1,"Analytical model enabled.")
|
2017-11-16 02:02:53 +01:00
|
|
|
|
2018-01-26 22:00:25 +01:00
|
|
|
|