mirror of https://github.com/VLSIDA/OpenRAM.git
Added router timing code. Commented combine adjacent pins due to run-time complexity
This commit is contained in:
parent
5ed9904855
commit
6f171ad147
|
|
@ -387,13 +387,13 @@ def import_tech():
|
||||||
OPTS.temperatures = tech.spice["temperatures"]
|
OPTS.temperatures = tech.spice["temperatures"]
|
||||||
|
|
||||||
|
|
||||||
def print_time(name, now_time, last_time=None):
|
def print_time(name, now_time, last_time=None, indentation=2):
|
||||||
""" Print a statement about the time delta. """
|
""" Print a statement about the time delta. """
|
||||||
if last_time:
|
if last_time:
|
||||||
time = str(round((now_time-last_time).total_seconds(),1)) + " seconds"
|
time = str(round((now_time-last_time).total_seconds(),1)) + " seconds"
|
||||||
else:
|
else:
|
||||||
time = now_time.strftime('%m/%d/%Y %H:%M:%S')
|
time = now_time.strftime('%m/%d/%Y %H:%M:%S')
|
||||||
print("** {0}: {1}".format(name,time))
|
print("{0} {1}: {2}".format("*"*indentation,name,time))
|
||||||
|
|
||||||
|
|
||||||
def report_status():
|
def report_status():
|
||||||
|
|
@ -410,6 +410,7 @@ def report_status():
|
||||||
debug.error("Tech name must be specified in config file.")
|
debug.error("Tech name must be specified in config file.")
|
||||||
|
|
||||||
print("Technology: {0}".format(OPTS.tech_name))
|
print("Technology: {0}".format(OPTS.tech_name))
|
||||||
|
print("Total size: {} kbits".format(OPTS.word_size*OPTS.num_words*OPTS.num_banks))
|
||||||
print("Word size: {0}\nWords: {1}\nBanks: {2}".format(OPTS.word_size,
|
print("Word size: {0}\nWords: {1}\nBanks: {2}".format(OPTS.word_size,
|
||||||
OPTS.num_words,
|
OPTS.num_words,
|
||||||
OPTS.num_banks))
|
OPTS.num_banks))
|
||||||
|
|
|
||||||
|
|
@ -123,16 +123,6 @@ class router(router_tech):
|
||||||
debug.info(3,"Retrieved pin {}".format(str(pin)))
|
debug.info(3,"Retrieved pin {}".format(str(pin)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def find_pins(self,pin_name):
|
|
||||||
"""
|
|
||||||
Finds the pin shapes and converts to tracks.
|
|
||||||
Pin can either be a label or a location,layer pair: [[x,y],layer].
|
|
||||||
"""
|
|
||||||
debug.info(1,"Finding pins for {}.".format(pin_name))
|
|
||||||
self.retrieve_pins(pin_name)
|
|
||||||
self.analyze_pins(pin_name)
|
|
||||||
|
|
||||||
def find_blockages(self):
|
def find_blockages(self):
|
||||||
"""
|
"""
|
||||||
Iterate through all the layers and write the obstacles to the routing grid.
|
Iterate through all the layers and write the obstacles to the routing grid.
|
||||||
|
|
@ -143,7 +133,6 @@ class router(router_tech):
|
||||||
for layer in [self.vert_layer_number,self.horiz_layer_number]:
|
for layer in [self.vert_layer_number,self.horiz_layer_number]:
|
||||||
self.retrieve_blockages(layer)
|
self.retrieve_blockages(layer)
|
||||||
|
|
||||||
|
|
||||||
def find_pins_and_blockages(self, pin_list):
|
def find_pins_and_blockages(self, pin_list):
|
||||||
"""
|
"""
|
||||||
Find the pins and blockages in the design
|
Find the pins and blockages in the design
|
||||||
|
|
@ -151,32 +140,53 @@ class router(router_tech):
|
||||||
# This finds the pin shapes and sorts them into "groups" that are connected
|
# This finds the pin shapes and sorts them into "groups" that are connected
|
||||||
# This must come before the blockages, so we can not count the pins themselves
|
# This must come before the blockages, so we can not count the pins themselves
|
||||||
# as blockages.
|
# as blockages.
|
||||||
for pin in pin_list:
|
start_time = datetime.now()
|
||||||
self.find_pins(pin)
|
for pin_name in pin_list:
|
||||||
|
self.retrieve_pins(pin_name)
|
||||||
|
print_time("Retrieving pins",datetime.now(), start_time, 4)
|
||||||
|
|
||||||
|
start_time = datetime.now()
|
||||||
|
for pin_name in pin_list:
|
||||||
|
self.analyze_pins(pin_name)
|
||||||
|
print_time("Analyzing pins",datetime.now(), start_time, 4)
|
||||||
|
|
||||||
# This will get all shapes as blockages and convert to grid units
|
# This will get all shapes as blockages and convert to grid units
|
||||||
# This ignores shapes that were pins
|
# This ignores shapes that were pins
|
||||||
|
start_time = datetime.now()
|
||||||
self.find_blockages()
|
self.find_blockages()
|
||||||
|
print_time("Finding blockages",datetime.now(), start_time, 4)
|
||||||
|
|
||||||
# Convert the blockages to grid units
|
# Convert the blockages to grid units
|
||||||
|
start_time = datetime.now()
|
||||||
self.convert_blockages()
|
self.convert_blockages()
|
||||||
|
print_time("Converting blockages",datetime.now(), start_time, 4)
|
||||||
|
|
||||||
# This will convert the pins to grid units
|
# This will convert the pins to grid units
|
||||||
# It must be done after blockages to ensure no DRCs between expanded pins and blocked grids
|
# It must be done after blockages to ensure no DRCs between expanded pins and blocked grids
|
||||||
|
start_time = datetime.now()
|
||||||
for pin in pin_list:
|
for pin in pin_list:
|
||||||
self.convert_pins(pin)
|
self.convert_pins(pin)
|
||||||
|
print_time("Converting pins",datetime.now(), start_time, 4)
|
||||||
|
|
||||||
# Combine adjacent pins into pin groups to reduce run-time
|
# Combine adjacent pins into pin groups to reduce run-time
|
||||||
for pin in pin_list:
|
# by reducing the number of maze routes.
|
||||||
self.combine_adjacent_pins(pin)
|
# This algorithm is > O(n^2) so remove it for now
|
||||||
|
# start_time = datetime.now()
|
||||||
|
# for pin in pin_list:
|
||||||
|
# self.combine_adjacent_pins(pin)
|
||||||
|
# print_time("Combining adjacent pins",datetime.now(), start_time, 4)
|
||||||
|
|
||||||
|
|
||||||
# Separate any adjacent grids of differing net names that overlap
|
# Separate any adjacent grids of differing net names that overlap
|
||||||
# Must be done before enclosing pins
|
# Must be done before enclosing pins
|
||||||
|
start_time = datetime.now()
|
||||||
self.separate_adjacent_pins(0)
|
self.separate_adjacent_pins(0)
|
||||||
|
print_time("Separating adjacent pins",datetime.now(), start_time, 4)
|
||||||
|
|
||||||
# Enclose the continguous grid units in a metal rectangle to fix some DRCs
|
# Enclose the continguous grid units in a metal rectangle to fix some DRCs
|
||||||
|
start_time = datetime.now()
|
||||||
self.enclose_pins()
|
self.enclose_pins()
|
||||||
|
print_time("Enclosing pins",datetime.now(), start_time, 4)
|
||||||
|
|
||||||
def combine_adjacent_pins(self, pin_name):
|
def combine_adjacent_pins(self, pin_name):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,12 @@ class supply_router(router):
|
||||||
self.create_routing_grid()
|
self.create_routing_grid()
|
||||||
|
|
||||||
# Get the pin shapes
|
# Get the pin shapes
|
||||||
|
start_time = datetime.now()
|
||||||
self.find_pins_and_blockages([self.vdd_name, self.gnd_name])
|
self.find_pins_and_blockages([self.vdd_name, self.gnd_name])
|
||||||
|
print_time("Finding pins and blockages",datetime.now(), start_time, 3)
|
||||||
|
|
||||||
# Add the supply rails in a mesh network and connect H/V with vias
|
# Add the supply rails in a mesh network and connect H/V with vias
|
||||||
|
start_time = datetime.now()
|
||||||
# Block everything
|
# Block everything
|
||||||
self.prepare_blockages(self.gnd_name)
|
self.prepare_blockages(self.gnd_name)
|
||||||
# Determine the rail locations
|
# Determine the rail locations
|
||||||
|
|
@ -77,15 +80,19 @@ class supply_router(router):
|
||||||
self.prepare_blockages(self.vdd_name)
|
self.prepare_blockages(self.vdd_name)
|
||||||
# Determine the rail locations
|
# Determine the rail locations
|
||||||
self.route_supply_rails(self.vdd_name,1)
|
self.route_supply_rails(self.vdd_name,1)
|
||||||
|
print_time("Routing supply rails",datetime.now(), start_time, 3)
|
||||||
|
|
||||||
|
start_time = datetime.now()
|
||||||
self.route_simple_overlaps(vdd_name)
|
self.route_simple_overlaps(vdd_name)
|
||||||
self.route_simple_overlaps(gnd_name)
|
self.route_simple_overlaps(gnd_name)
|
||||||
|
print_time("Simple overlap routing",datetime.now(), start_time, 3)
|
||||||
|
|
||||||
# Route the supply pins to the supply rails
|
# Route the supply pins to the supply rails
|
||||||
# Route vdd first since we want it to be shorter
|
# Route vdd first since we want it to be shorter
|
||||||
|
start_time = datetime.now()
|
||||||
self.route_pins_to_rails(vdd_name)
|
self.route_pins_to_rails(vdd_name)
|
||||||
self.route_pins_to_rails(gnd_name)
|
self.route_pins_to_rails(gnd_name)
|
||||||
|
print_time("Maze routing supplies",datetime.now(), start_time, 3)
|
||||||
#self.write_debug_gds("final.gds",False)
|
#self.write_debug_gds("final.gds",False)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue