By default uniquify instances based on macro name.

This commit is contained in:
mrg
2022-03-11 18:01:45 -08:00
parent b981ad5814
commit 229a3b5b3d
10 changed files with 19 additions and 34 deletions
+10
View File
@@ -8,6 +8,7 @@
import hierarchy_layout
import hierarchy_spice
import debug
import os
from globals import OPTS
@@ -22,6 +23,15 @@ class hierarchy_design(hierarchy_spice.spice, hierarchy_layout.layout):
self.drc_errors = "skipped"
self.lvs_errors = "skipped"
# Flag for library cells which is recomputed in hierachy_layout
gds_file = OPTS.openram_tech + "gds_lib/" + cell_name + ".gds"
is_library_cell = os.path.isfile(gds_file)
# Uniquify names to address the flat GDS namespace
# except for the top/output name
if not is_library_cell and name != OPTS.output_name:
name = OPTS.output_name + "_" + name
cell_name = name
hierarchy_spice.spice.__init__(self, name, cell_name)
hierarchy_layout.layout.__init__(self, name, cell_name)
self.init_graph_params()
+1 -6
View File
@@ -42,6 +42,7 @@ class layout():
self.cell_name = cell_name
self.gds_file = OPTS.openram_tech + "gds_lib/" + cell_name + ".gds"
self.is_library_cell = os.path.isfile(self.gds_file)
self.width = None
self.height = None
@@ -60,8 +61,6 @@ class layout():
self.pin_map = {}
# List of modules we have already visited
self.visited = []
# Flag for library cells
self.is_library_cell = False
self.gds_read()
@@ -903,10 +902,6 @@ class layout():
"""Reads a GDSII file in the library and checks if it exists
Otherwise, start a new layout for dynamic generation."""
# This must be done for netlist only mode too
if os.path.isfile(self.gds_file):
self.is_library_cell = True
if OPTS.netlist_only:
self.gds = None
return