Commit prefixGDS.py utility script

This commit is contained in:
mrg 2021-06-29 17:06:43 -07:00
parent 1ae68637ee
commit 4d49851396
1 changed files with 19 additions and 0 deletions

19
compiler/prefixGDS.py Normal file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env python3
import sys
from gdsMill import gdsMill
if len(sys.argv) < 3:
print("Script to prefix every instance and structure with the root cell name to provide unique namespace.")
print("Usage: {0} in.gds out.gds".format(sys.argv[0]))
sys.exit(1)
gds_file = sys.argv[1]
gds = gdsMill.VlsiLayout()
reader = gdsMill.Gds2reader(gds)
reader.loadFromFile(gds_file)
gds.uniquify()
writer = gdsMill.Gds2writer(gds)
writer.writeToFile(sys.argv[2])