Slight optimization to the SRAM macro install, which allows the
SPICE netlists to be renames through a filter script instead of
calling out each file in the Makefile. That prevents the Makefile
from having to be updated whenever the SRAM macro repository
changes.
diff --git a/sky130/custom/scripts/sp_to_spice.py b/sky130/custom/scripts/sp_to_spice.py
new file mode 100755
index 0000000..bbcc641
--- /dev/null
+++ b/sky130/custom/scripts/sp_to_spice.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python3
+#
+# sp_to_spice ---
+#
+# This script runs as a filter to foundry_install.sh and converts file
+# names ending with ".sp" to ".spice". If the file has multiple extensions
+# then all are stripped before adding ".spice".
+#
+# This script is a filter to be run by setting the name of this script as
+# the value to "filter=" for the model install in the sky130 Makefile.
+
+import os
+import sys
+
+def filter(inname):
+
+ filepath = os.path.split(inname)[0]
+ filename = os.path.split(inname)[1]
+
+ filebits = filename.split('.')
+ newname = filebits[0] + '.spice'
+ outname = os.path.join(filepath, newname)
+ if not os.path.isfile(inname):
+ print('No such file ' + inname)
+ return 1
+
+ print('Renaming file ' + filename + ' to ' + newname)
+ os.rename(inname, outname)
+ return 0
+
+if __name__ == '__main__':
+
+ # This script expects to get one argument, which is the input file.
+ # The script renames the file.
+
+ options = []
+ arguments = []
+ for item in sys.argv[1:]:
+ if item.find('-', 0) == 0:
+ options.append(item[1:])
+ else:
+ arguments.append(item)
+
+ if len(arguments) > 0:
+ infilename = arguments[0]
+ else:
+ sys.exit(1)
+
+ result = filter(infilename)
+ sys.exit(result)