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-08 17:42:32 +02:00
|
|
|
from .worst_case import *
|
2018-10-04 18:29:44 +02:00
|
|
|
from .simulation import *
|
2018-12-11 23:06:11 +01:00
|
|
|
from .bitline_delay 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:
|
2018-01-26 22:00:25 +01:00
|
|
|
(OPTS.spice_name,OPTS.spice_exe) = get_tool("spice",["xa", "hspice", "ngspice", "ngspice.exe"])
|
2017-11-16 02:02:53 +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)
|
|
|
|
|
|
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
|
|
|
|