mirror of https://github.com/VLSIDA/OpenRAM.git
Add technology parameter for library prefix during uniquification of GDS
This commit is contained in:
parent
bd64912977
commit
cce1305da3
|
|
@ -12,6 +12,7 @@ nominal_corner_only = True
|
||||||
route_supplies = "ring"
|
route_supplies = "ring"
|
||||||
#route_supplies = "left"
|
#route_supplies = "left"
|
||||||
check_lvsdrc = True
|
check_lvsdrc = True
|
||||||
|
uniquify = True
|
||||||
#perimeter_pins = False
|
#perimeter_pins = False
|
||||||
#netlist_only = True
|
#netlist_only = True
|
||||||
#analytical_delay = False
|
#analytical_delay = False
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ class VlsiLayout:
|
||||||
coordinatesRotate.extend((newX,newY))
|
coordinatesRotate.extend((newX,newY))
|
||||||
return coordinatesRotate
|
return coordinatesRotate
|
||||||
|
|
||||||
def uniquify(self):
|
def uniquify(self, prefix_name=None):
|
||||||
new_structures = {}
|
new_structures = {}
|
||||||
if self.rootStructureName[-1] == "\x00":
|
if self.rootStructureName[-1] == "\x00":
|
||||||
prefix = self.rootStructureName[0:-1] + "_"
|
prefix = self.rootStructureName[0:-1] + "_"
|
||||||
|
|
@ -92,7 +92,10 @@ class VlsiLayout:
|
||||||
base_name = name[0:-1]
|
base_name = name[0:-1]
|
||||||
else:
|
else:
|
||||||
base_name = name
|
base_name = name
|
||||||
if name != self.rootStructureName:
|
# Don't do library cells
|
||||||
|
if prefix_name and base_name.startswith(prefix_name):
|
||||||
|
new_name = name
|
||||||
|
elif name != self.rootStructureName:
|
||||||
new_name = self.padText(prefix + base_name)
|
new_name = self.padText(prefix + base_name)
|
||||||
else:
|
else:
|
||||||
new_name = name
|
new_name = name
|
||||||
|
|
@ -105,7 +108,11 @@ class VlsiLayout:
|
||||||
base_sref_name = sref.sName[0:-1]
|
base_sref_name = sref.sName[0:-1]
|
||||||
else:
|
else:
|
||||||
base_sref_name = sref.sName
|
base_sref_name = sref.sName
|
||||||
new_sref_name = self.padText(prefix + base_sref_name)
|
# Don't do library cells
|
||||||
|
if prefix_name and base_sref_name.startswith(prefix_name):
|
||||||
|
new_sref_name = sref.sName
|
||||||
|
else:
|
||||||
|
new_sref_name = self.padText(prefix + base_sref_name)
|
||||||
sref.sName = new_sref_name
|
sref.sName = new_sref_name
|
||||||
#print("SREF: {0} -> {1}".format(base_sref_name, new_sref_name))
|
#print("SREF: {0} -> {1}".format(base_sref_name, new_sref_name))
|
||||||
self.structures = new_structures
|
self.structures = new_structures
|
||||||
|
|
@ -774,9 +781,9 @@ class VlsiLayout:
|
||||||
shapes = self.getAllShapes(lpp)
|
shapes = self.getAllShapes(lpp)
|
||||||
else:
|
else:
|
||||||
lpp = layer_override[label_text]
|
lpp = layer_override[label_text]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
for boundary in shapes:
|
for boundary in shapes:
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
#!/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])
|
|
||||||
|
|
@ -69,7 +69,12 @@ class sram():
|
||||||
reader = gdsMill.Gds2reader(gds)
|
reader = gdsMill.Gds2reader(gds)
|
||||||
reader.loadFromFile(name)
|
reader.loadFromFile(name)
|
||||||
|
|
||||||
gds.uniquify()
|
# Uniquify but skip the library cells since they are hard coded
|
||||||
|
try:
|
||||||
|
from tech import library_prefix_name
|
||||||
|
except ImportError:
|
||||||
|
library_prefix_name = None
|
||||||
|
gds.uniquify(library_prefix_name)
|
||||||
|
|
||||||
writer = gdsMill.Gds2writer(gds)
|
writer = gdsMill.Gds2writer(gds)
|
||||||
unique_name = name.replace(".gds", "_unique.gds")
|
unique_name = name.replace(".gds", "_unique.gds")
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,17 @@
|
||||||
import sys
|
import sys
|
||||||
from gdsMill import gdsMill
|
from gdsMill import gdsMill
|
||||||
|
|
||||||
if len(sys.argv) < 3:
|
if len(sys.argv) < 4:
|
||||||
print("Script to prefix every instance and structure with the root cell name to provide unique namespace.")
|
print("Script to prefix every instance and structure with the root cell name to provide unique namespace, but skip cells that begin with the library prefix.")
|
||||||
print("Usage: {0} in.gds out.gds".format(sys.argv[0]))
|
print("Usage: {0} <library prefix> in.gds out.gds".format(sys.argv[0]))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
gds_file = sys.argv[1]
|
gds_file = sys.argv[2]
|
||||||
gds = gdsMill.VlsiLayout()
|
gds = gdsMill.VlsiLayout()
|
||||||
reader = gdsMill.Gds2reader(gds)
|
reader = gdsMill.Gds2reader(gds)
|
||||||
reader.loadFromFile(gds_file)
|
reader.loadFromFile(gds_file)
|
||||||
|
|
||||||
gds.uniquify()
|
gds.uniquify(prefix_name=sys.argv[1])
|
||||||
|
|
||||||
writer = gdsMill.Gds2writer(gds)
|
writer = gdsMill.Gds2writer(gds)
|
||||||
writer.writeToFile(sys.argv[2])
|
writer.writeToFile(sys.argv[3])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue