mirror of https://github.com/VLSIDA/OpenRAM.git
Finalize uniquify option for SRAMs
This commit is contained in:
parent
8095c72fc8
commit
c69eb47a7a
|
|
@ -81,8 +81,9 @@ class VlsiLayout:
|
|||
coordinatesRotate.extend((newX,newY))
|
||||
return coordinatesRotate
|
||||
|
||||
def prefixAll(self, prefix):
|
||||
def uniquify(self):
|
||||
new_structures = {}
|
||||
prefix = self.rootStructureName + "_"
|
||||
|
||||
for name in self.structures:
|
||||
if name != self.rootStructureName:
|
||||
|
|
|
|||
|
|
@ -166,6 +166,9 @@ class options(optparse.Values):
|
|||
|
||||
keep_temp = False
|
||||
|
||||
# Add a prefix of the root cell before every structure in the GDS
|
||||
# after outputting the GDS2
|
||||
uniquify = False
|
||||
|
||||
# These are the default modules that can be over-riden
|
||||
bank_select = "bank_select"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import sys
|
|||
from gdsMill import gdsMill
|
||||
|
||||
if len(sys.argv) < 4:
|
||||
print("Script to prefix every instance and structure to create a unique namespace.")
|
||||
print("Usage: {0} prefix in.gds out.gds".format(sys.argv[0]))
|
||||
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)
|
||||
|
||||
prefix = sys.argv[1]
|
||||
|
|
@ -15,7 +15,7 @@ gds = gdsMill.VlsiLayout()
|
|||
reader = gdsMill.Gds2reader(gds)
|
||||
reader.loadFromFile(gds_file)
|
||||
|
||||
gds.prefixAll(prefix)
|
||||
gds.uniquify()
|
||||
|
||||
writer = gdsMill.Gds2writer(gds)
|
||||
writer.writeToFile(sys.argv[3])
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import debug
|
|||
import verify
|
||||
from characterizer import functional
|
||||
from globals import OPTS, print_time
|
||||
import shutil
|
||||
|
||||
|
||||
class sram():
|
||||
|
|
@ -60,6 +61,21 @@ class sram():
|
|||
def gds_write(self, name):
|
||||
self.s.gds_write(name)
|
||||
|
||||
# This addresses problems with flat GDS namespaces when we
|
||||
# want to merge this SRAM with other SRAMs.
|
||||
if OPTS.uniquify:
|
||||
import gdsMill
|
||||
gds = gdsMill.VlsiLayout()
|
||||
reader = gdsMill.Gds2reader(gds)
|
||||
reader.loadFromFile(name)
|
||||
|
||||
gds.uniquify()
|
||||
|
||||
writer = gdsMill.Gds2writer(gds)
|
||||
unique_name = name.replace(".gds", "_unique.gds")
|
||||
writer.writeToFile(unique_name)
|
||||
shutil.move(unique_name, name)
|
||||
|
||||
def verilog_write(self, name):
|
||||
self.s.verilog_write(name)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue