Slight extension to the "options=" option to allow the value to be
a Tcl expression instead of a filename, in case only a one-line
addition is needed to a script.
diff --git a/VERSION b/VERSION
index 874b2e6..36e38bd 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.135
+1.0.136
diff --git a/common/foundry_install.py b/common/foundry_install.py
index ea50eeb..d2fd919 100755
--- a/common/foundry_install.py
+++ b/common/foundry_install.py
@@ -123,7 +123,9 @@
# options: Followed by "=" and the name of a script. Behavior
# is dependent on the mode; if applied to "-gds",
# then the script is inserted before the GDS read
-# in the Tcl generate script passed to magic.
+# in the Tcl generate script passed to magic. If
+# what follows the "=" is not a file, then it is
+# Tcl code to be inserted verbatim.
#
# NOTE: This script can be called once for all libraries if all file
# types (gds, cdl, lef, etc.) happen to all work with the same wildcards.
@@ -1234,8 +1236,13 @@
print('Creating magic generation script to generate magic database files.')
if tclscript:
- with open(tclscript, 'r') as ifile:
- tcllines = ifile.read().splitlines()
+ # If tclscript is a file, then read it. Otherwise, assume
+ # that the option contents should be inserted verbatim.
+ if os.path.isfile(tclscript):
+ with open(tclscript, 'r') as ifile:
+ tcllines = ifile.read().splitlines()
+ else:
+ tcllines = list(tclscript)
with open(destlibdir + '/generate_magic.tcl', 'w') as ofile:
print('#!/usr/bin/env wish', file=ofile)
diff --git a/sky130/custom/scripts/gds_import_setup.tcl b/sky130/custom/scripts/gds_import_setup.tcl
new file mode 100644
index 0000000..f3a8585
--- /dev/null
+++ b/sky130/custom/scripts/gds_import_setup.tcl
@@ -0,0 +1,4 @@
+# Set the GDS input style to sky130(vendor). This treats labels on the
+# TXT purpose (5) as pins, which is unfortunately done in a lot of the
+# vendor GDS files.
+cif istyle sky130(vendor)