Modified a number of custom scripts (and corresponding calls to the
scripts in the sky130 Makefile) to do the following: (1) Revert the
change to use the "tempfile" library because this just causes an
additional error when the /tmp directory is not in the same filesystem
as the staging area (especially as the original method was working
fine except for problem #2), and (2) Fix a number of custom scripts
to use the correct path to either sky130A or sky130B depending, when
needed, on an option passed to the script. Standalone scripts need
the option; filter scripts can divine the name of the PDK from the
target path.
diff --git a/sky130/custom/scripts/xyce_hack2.py b/sky130/custom/scripts/xyce_hack2.py
index 9442ad5..9308dad 100755
--- a/sky130/custom/scripts/xyce_hack2.py
+++ b/sky130/custom/scripts/xyce_hack2.py
@@ -10,7 +10,6 @@
import os
import re
import sys
-import tempfile
plist = ["ldif", "hdif", "rd", "rs", "rsc", "rdc", "nqsmod"]
regexps = []
@@ -27,10 +26,10 @@
filepath = os.path.split(infile_name)[0]
filename = os.path.split(infile_name)[1]
fileroot = os.path.splitext(filename)[0]
+ outfile_name = os.path.join(filepath, fileroot + '_temp')
infile = open(infile_name, 'r')
- handle, outfile_name = tempfile.mkstemp()
- outfile = os.fdopen(handle, 'w')
+ outfile = open(outfile_name, 'w')
line_number = 0
replaced_something = False