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_verilog_library.py b/common/create_verilog_library.py
index 32ce2c5..55e1c76 100755
--- a/common/create_verilog_library.py
+++ b/common/create_verilog_library.py
@@ -45,7 +45,18 @@
os.remove(alllibname)
print('Diagnostic: Creating consolidated verilog library ' + destlibroot + '.v')
- vlist = glob.glob(destlibdir + '/*.v')
+
+ # If file "filelist.txt" exists in the directory, get the list of files from it
+ if os.path.exists(destlibdir + '/filelist.txt'):
+ print('Diagnostic: Reading sorted verilog file list.')
+ with open(destlibdir + '/filelist.txt', 'r') as ifile:
+ rlist = ifile.read().splitlines()
+ vlist = []
+ for rfile in rlist:
+ vlist.append(destlibdir + '/' + rfile)
+ else:
+ vlist = glob.glob(destlibdir + '/*.v')
+
if alllibname in vlist:
vlist.remove(alllibname)