Added additional option "sort" to supply a sorting script to specify
the order of files when compiled into a library; this allows the
Makefile to enforce natural sort order and/or put dependent entries
at the top. Also added a custom script for sky130 to handle the
assortment of "include" statements in the standard cell verilog
before generating the library files.
diff --git a/common/create_spice_library.py b/common/create_spice_library.py
index ca95fa6..90d4e65 100755
--- a/common/create_spice_library.py
+++ b/common/create_spice_library.py
@@ -55,16 +55,24 @@
if os.path.isfile(outputname):
os.remove(outputname)
- if fformat == 'CDL':
- slist = glob.glob(destlibdir + '/*.cdl')
+ # If file "filelist.txt" exists in the directory, get the list of files from it
+ if os.path.exists(destlibdir + '/filelist.txt'):
+ with open(destlibdir + '/filelist.txt', 'r') as ifile:
+ rlist = ifile.read().splitlines()
+ slist = []
+ for rfile in rlist:
+ slist.append(destlibdir + '/' + rfile)
else:
- # Sadly, there is no consensus on what a SPICE file extension should be.
- slist = glob.glob(destlibdir + '/*.spc')
- slist.extend(glob.glob(destlibdir + '/*.spice'))
- slist.extend(glob.glob(destlibdir + '/*.spi'))
- slist.extend(glob.glob(destlibdir + '/*.ckt'))
- slist.extend(glob.glob(destlibdir + '/*.cir'))
- slist.extend(glob.glob(destlibdir + '/*' + spiext))
+ if fformat == 'CDL':
+ slist = glob.glob(destlibdir + '/*.cdl')
+ else:
+ # Sadly, there is no consensus on what a SPICE file extension should be.
+ slist = glob.glob(destlibdir + '/*.spc')
+ slist.extend(glob.glob(destlibdir + '/*.spice'))
+ slist.extend(glob.glob(destlibdir + '/*.spi'))
+ slist.extend(glob.glob(destlibdir + '/*.ckt'))
+ slist.extend(glob.glob(destlibdir + '/*.cir'))
+ slist.extend(glob.glob(destlibdir + '/*' + spiext))
if alllibname in slist:
slist.remove(alllibname)