From efba4d785e52b0661f5d462362a7cae25a0c5bfb Mon Sep 17 00:00:00 2001 From: Eren Dogan Date: Sun, 22 Jan 2023 18:15:38 -0800 Subject: [PATCH] Fix other commands to use conda as well --- compiler/characterizer/stimuli.py | 5 +++++ compiler/verify/magic.py | 13 ++----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/compiler/characterizer/stimuli.py b/compiler/characterizer/stimuli.py index 7984db58..81c7c89f 100644 --- a/compiler/characterizer/stimuli.py +++ b/compiler/characterizer/stimuli.py @@ -405,6 +405,11 @@ class stimuli(): spice_stdout = open("{0}spice_stdout.log".format(OPTS.openram_temp), 'w') spice_stderr = open("{0}spice_stderr.log".format(OPTS.openram_temp), 'w') + # Wrap the command with conda activate & conda deactivate + # FIXME: Should use verify/run_script.py here but run_script doesn't return + # the return code of the subprocess. File names might also mismatch. + from openram import CONDA_HOME + cmd = "source {0}/bin/activate && {1} && conda deactivate".format(CONDA_HOME, cmd) debug.info(2, cmd) retcode = subprocess.call(cmd, stdout=spice_stdout, stderr=spice_stderr, shell=True) diff --git a/compiler/verify/magic.py b/compiler/verify/magic.py index a19f235d..50623574 100644 --- a/compiler/verify/magic.py +++ b/compiler/verify/magic.py @@ -414,17 +414,9 @@ def run_pex(name, gds_name, sp_name, output=None, final_verification=False, outp # pex_fix did run the pex using a script while dev orignial method # use batch mode. # the dev old code using batch mode does not run and is split into functions - pex_runset = write_script_pex_rule(gds_name, name, sp_name, output) + write_script_pex_rule(gds_name, name, sp_name, output) - errfile = "{0}{1}.pex.err".format(output_path, name) - outfile = "{0}{1}.pex.out".format(output_path, name) - - script_cmd = "{0} 2> {1} 1> {2}".format(pex_runset, - errfile, - outfile) - cmd = script_cmd - debug.info(2, cmd) - os.system(cmd) + (outfile, errfile, resultsfile) = run_script(name, "pex") # rename technology models pex_nelist = open(output, 'r') @@ -533,7 +525,6 @@ def write_script_pex_rule(gds_name, cell_name, sp_name, output): f.close() os.system("chmod u+x {}".format(run_file)) - return run_file def find_error(results):