move apporach select to options.py

This commit is contained in:
FriedrichWu 2024-12-21 18:22:06 +01:00
parent bda3adf9f9
commit 474a240f38
4 changed files with 9 additions and 8 deletions

View File

@ -408,7 +408,7 @@ class sram_1bank(design, verilog, lef):
design=self,
mod=mod)
rtr.route(self.pins_to_route)
elif route_option == "fast":
elif route_option == "quality":
# use io_pin_placer
# put the IO pins at the edge
from openram.router.io_pin_placer import io_pin_placer as placer
@ -1135,7 +1135,7 @@ class sram_1bank(design, verilog, lef):
if OPTS.route_supplies:
if route_option == "classic":
self.route_supplies(init_bbox)
else: # fast
else: # quality
self.route_supplies_constructive(init_bbox)
def route_dffs(self, add_routes=True):

View File

@ -52,6 +52,8 @@ class options(optparse.Values):
words_per_row = None
num_spare_rows = 0
num_spare_cols = 0
# Route approach
route_approach = "classic"# "classic" or "quality"
###################
# ROM configuration options

View File

@ -20,7 +20,7 @@ class sram():
results.
We can later add visualizer and other high-level functions as needed.
"""
def __init__(self, sram_config=None, name=None, route_option="classic"):
def __init__(self, sram_config=None, name=None):
# Create default configs if custom config isn't provided
if sram_config is None:
@ -48,7 +48,6 @@ class sram():
start_time = datetime.datetime.now()
self.name = name
self.route_option = route_option # "classic" or "fast"
from openram.modules.sram_1bank import sram_1bank as sram
@ -57,7 +56,7 @@ class sram():
self.s.create_netlist()# not placed & routed jet
# choose the routung method, maze router or constructive
if self.route_option == "classic":
if OPTS.route_approach == "classic":
cur_state = "IDLE"
if not OPTS.netlist_only:
i = 0
@ -112,13 +111,13 @@ class sram():
else:
cur_state = "FINISH"
break
elif self.route_option == "fast":
elif OPTS.route_approach == "quality":
if not OPTS.netlist_only:
i = 0
while i < 10:
debug.warning("current i: i = {0}".format(i))
try:
self.s.create_layout(position_add=i, route_option=route_option)
self.s.create_layout(position_add=i, route_option="quality")
except AssertionError as e:
i = i + 1
if i == 9: #failed in routing

View File

@ -70,7 +70,7 @@ for path in output_files:
# Create an SRAM (we can also pass sram_config, see documentation/tutorials for details)
from openram import sram
s = sram(route_option="classic")# "classic" or "fast"
s = sram()
# Output the files for the resulting SRAM
s.save()