Merge branch 'dev' into xyce

This commit is contained in:
mrg 2021-06-16 09:52:17 -07:00
commit 1adada9e27
4 changed files with 93 additions and 5 deletions

View File

@ -711,6 +711,27 @@ class router(router_tech):
p = pin_layout("", [ll, ur], self.get_layer(track[2]))
return p
def convert_tracks_to_pin(self, tracks):
"""
Convert a list of grid point into a rectangle shape.
Must all be on the same layer.
"""
for t in tracks:
debug.check(t[2] == tracks[0][2], "Different layers used.")
# For each shape, convert it to a pin
pins = [self.convert_track_to_pin(t) for t in tracks]
# Now find the bounding box
minx = min([p.lx() for p in pins])
maxx = max([p.rx() for p in pins])
miny = min([p.by() for p in pins])
maxy = max([p.uy() for p in pins])
ll = vector(minx, miny)
ur = vector(maxx, maxy)
p = pin_layout("", [ll, ur], self.get_layer(tracks[0][2]))
return p
def convert_track_to_shape_pin(self, track):
"""
Convert a grid point into a rectangle shape
@ -1294,10 +1315,27 @@ class router(router_tech):
def get_perimeter_pin(self):
""" Return the shape of the last routed path that was on the perimeter """
for v in self.paths[-1]:
lastpath = self.paths[-1]
for v in lastpath:
if self.rg.is_target(v):
# Find neighboring grid to make double wide pin
neighbor = v + vector3d(0, 1, 0)
if neighbor in lastpath:
return self.convert_tracks_to_pin([v, neighbor])
neighbor = v + vector3d(0, -1, 0)
if neighbor in lastpath:
return self.convert_tracks_to_pin([v, neighbor])
neighbor = v + vector3d(1, 0, 0)
if neighbor in lastpath:
return self.convert_tracks_to_pin([v, neighbor])
neighbor = v + vector3d(-1, 0, 0)
if neighbor in lastpath:
return self.convert_tracks_to_pin([v, neighbor])
# Else if we came from a different layer, we can only add
# a signle grid
return self.convert_track_to_pin(v)
return None
def get_ll_pin(self, pin_name):

View File

@ -452,7 +452,6 @@ class sram_1bank(sram_base):
y_bottom = 0
y_offset = y_bottom - self.data_bus_size[port] + 2 * self.m3_pitch
offset = vector(self.control_logic_insts[port].rx() + self.dff.width,
y_offset)
cr = channel_route(netlist=route_map,

View File

@ -0,0 +1,51 @@
#!/usr/bin/env python3
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import unittest
from testutils import *
import sys, os
sys.path.append(os.getenv("OPENRAM_HOME"))
import globals
from globals import OPTS
from sram_factory import factory
import debug
class sram_1bank_nomux_test(openram_test):
def runTest(self):
config_file = "{}/tests/configs/config".format(os.getenv("OPENRAM_HOME"))
globals.init_openram(config_file)
OPTS.supply_pin_type = "ring"
from sram_config import sram_config
c = sram_config(word_size=4,
num_words=16,
num_banks=1)
c.words_per_row=1
c.recompute_sizes()
debug.info(1, "Layout test for {}rw,{}r,{}w sram "
"with {} bit words, {} words, {} words per "
"row, {} banks".format(OPTS.num_rw_ports,
OPTS.num_r_ports,
OPTS.num_w_ports,
c.word_size,
c.num_words,
c.words_per_row,
c.num_banks))
a = factory.create(module_type="sram", sram_config=c)
self.local_check(a, final_verification=True)
globals.end_openram()
# run the test from the command line
if __name__ == "__main__":
(OPTS, args) = globals.parse_args()
del sys.argv[1:]
header(__file__, OPTS.tech_name)
unittest.main(testRunner=debugTestRunner())

View File

@ -74,7 +74,7 @@ def write_drc_script(cell_name, gds_name, extract, final_verification, output_pa
magic_file = os.environ.get('OPENRAM_MAGICRC', None)
if not magic_file:
magic_file = OPTS.openram_tech + "tech/.magicrc"
if os.path.exists(magic_file):
shutil.copy(magic_file, output_path + "/.magicrc")
else:
@ -251,7 +251,7 @@ def write_lvs_script(cell_name, gds_name, sp_name, final_verification=False, out
if not output_path:
output_path = OPTS.openram_temp
# Copy .magicrc file into the output directory
# Copy setup.tcl file into the output directory
setup_file = os.environ.get('OPENRAM_NETGENRC', None)
if not setup_file:
setup_file = OPTS.openram_tech + "tech/setup.tcl"