2018-08-22 20:37:24 +02:00
|
|
|
#!/usr/bin/env python3
|
2017-05-24 19:50:19 +02:00
|
|
|
"Run a regresion test the library cells for DRC"
|
|
|
|
|
|
|
|
|
|
import unittest
|
2018-08-22 20:37:24 +02:00
|
|
|
from testutils import header,openram_test
|
2017-05-24 19:50:19 +02:00
|
|
|
import sys,os
|
|
|
|
|
sys.path.append(os.path.join(sys.path[0],"../.."))
|
|
|
|
|
sys.path.append(os.path.join(sys.path[0],".."))
|
|
|
|
|
import globals
|
|
|
|
|
import debug
|
|
|
|
|
|
|
|
|
|
OPTS = globals.OPTS
|
|
|
|
|
|
2018-08-22 20:37:24 +02:00
|
|
|
class big_test(openram_test):
|
2017-05-24 19:50:19 +02:00
|
|
|
"""
|
|
|
|
|
Simplest two pin route test with no blockages using the pin locations instead of labels.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def runTest(self):
|
|
|
|
|
globals.init_openram("config_{0}".format(OPTS.tech_name))
|
2018-08-22 20:37:24 +02:00
|
|
|
from gds_cell import gds_cell
|
|
|
|
|
from design import design
|
2018-08-23 00:56:19 +02:00
|
|
|
from signal_router import signal_router as router
|
2017-05-24 19:50:19 +02:00
|
|
|
|
2018-08-22 20:37:24 +02:00
|
|
|
class routing(design, openram_test):
|
2017-05-24 19:50:19 +02:00
|
|
|
"""
|
|
|
|
|
A generic GDS design that we can route on.
|
|
|
|
|
"""
|
2017-06-05 23:42:56 +02:00
|
|
|
def __init__(self, name):
|
2018-08-22 20:37:24 +02:00
|
|
|
design.__init__(self, "top")
|
2017-05-24 19:50:19 +02:00
|
|
|
|
2018-08-22 20:37:24 +02:00
|
|
|
# Instantiate a GDS cell with the design
|
|
|
|
|
gds_file = "{0}/{1}.gds".format(os.path.dirname(os.path.realpath(__file__)),name)
|
|
|
|
|
cell = gds_cell(name, gds_file)
|
2017-06-05 23:42:56 +02:00
|
|
|
self.add_inst(name=name,
|
2017-05-24 19:50:19 +02:00
|
|
|
mod=cell,
|
|
|
|
|
offset=[0,0])
|
|
|
|
|
self.connect_inst([])
|
|
|
|
|
|
2018-08-22 20:37:24 +02:00
|
|
|
layer_stack =("metal1","via1","metal2")
|
2018-10-04 23:04:29 +02:00
|
|
|
r=router(layer_stack,self,gds_file)
|
2017-06-05 23:42:56 +02:00
|
|
|
connections=[('out_0_2', 'a_0_0'),
|
|
|
|
|
('out_0_3', 'b_0_0'),
|
|
|
|
|
('out_0_0', 'a_0_1'),
|
|
|
|
|
('out_1_2', 'a_1_0'),
|
|
|
|
|
('out_1_3', 'b_1_0'),
|
|
|
|
|
('out_1_0', 'a_1_1'),
|
|
|
|
|
('out_2_1', 'a_2_0'),
|
|
|
|
|
('out_2_2', 'b_2_0'),
|
|
|
|
|
('out_3_1', 'a_3_0'),
|
|
|
|
|
('out_3_2', 'b_3_0'),
|
|
|
|
|
('out_4_6', 'a_4_0'),
|
|
|
|
|
('out_4_7', 'b_4_0'),
|
|
|
|
|
('out_4_8', 'a_4_2'),
|
|
|
|
|
('out_4_9', 'b_4_2'),
|
|
|
|
|
('out_4_10', 'a_4_4'),
|
|
|
|
|
('out_4_11', 'b_4_4'),
|
|
|
|
|
('out_4_0', 'a_4_1'),
|
|
|
|
|
('out_4_2', 'b_4_1'),
|
|
|
|
|
('out_4_4', 'a_4_5'),
|
|
|
|
|
('out_4_1', 'a_4_3'),
|
|
|
|
|
('out_4_5', 'b_4_3')]
|
|
|
|
|
for (src,tgt) in connections:
|
2018-10-04 23:04:29 +02:00
|
|
|
self.assertTrue(r.route(src=src,dest=tgt))
|
2017-05-24 19:50:19 +02:00
|
|
|
|
2017-05-24 22:57:27 +02:00
|
|
|
# This test only runs on scn3me_subm tech
|
2017-05-24 19:50:19 +02:00
|
|
|
if OPTS.tech_name=="scn3me_subm":
|
2017-06-05 23:42:56 +02:00
|
|
|
r = routing("07_big_test_{0}".format(OPTS.tech_name))
|
2018-08-22 20:37:24 +02:00
|
|
|
self.local_drc_check(r)
|
2017-05-24 19:50:19 +02:00
|
|
|
else:
|
2017-05-24 22:57:27 +02:00
|
|
|
debug.warning("This test does not support technology {0}".format(OPTS.tech_name))
|
2017-05-24 19:50:19 +02:00
|
|
|
|
|
|
|
|
# fails if there are any DRC errors on any cells
|
|
|
|
|
globals.end_openram()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# instantiate a copy of the class to actually run the test
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
(OPTS, args) = globals.parse_args()
|
|
|
|
|
del sys.argv[1:]
|
|
|
|
|
header(__file__, OPTS.tech_name)
|
|
|
|
|
unittest.main()
|