mirror of https://github.com/VLSIDA/OpenRAM.git
Fix print errors in code format unit test.
This commit is contained in:
parent
69d5731d67
commit
5db470155e
|
|
@ -78,7 +78,7 @@ class design(hierarchy_design):
|
|||
for pin_name in self.pins:
|
||||
pins = self.get_pins(pin_name)
|
||||
for pin in pins:
|
||||
print(pin_name, pin)
|
||||
debug.info(0, "{0} {1}".format(pin_name, pin))
|
||||
|
||||
def setup_multiport_constants(self):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -141,30 +141,28 @@ class layout():
|
|||
layout.active_space)
|
||||
|
||||
# These are for debugging previous manual rules
|
||||
if False:
|
||||
print("poly_width", layout.poly_width)
|
||||
print("poly_space", layout.poly_space)
|
||||
print("m1_width", layout.m1_width)
|
||||
print("m1_space", layout.m1_space)
|
||||
print("m2_width", layout.m2_width)
|
||||
print("m2_space", layout.m2_space)
|
||||
print("m3_width", layout.m3_width)
|
||||
print("m3_space", layout.m3_space)
|
||||
print("m4_width", layout.m4_width)
|
||||
print("m4_space", layout.m4_space)
|
||||
print("active_width", layout.active_width)
|
||||
print("active_space", layout.active_space)
|
||||
print("contact_width", layout.contact_width)
|
||||
print("poly_to_active", layout.poly_to_active)
|
||||
print("poly_extend_active", layout.poly_extend_active)
|
||||
print("poly_to_contact", layout.poly_to_contact)
|
||||
print("active_contact_to_gate", layout.active_contact_to_gate)
|
||||
print("poly_contact_to_gate", layout.poly_contact_to_gate)
|
||||
print("well_enclose_active", layout.well_enclose_active)
|
||||
print("implant_enclose_active", layout.implant_enclose_active)
|
||||
print("implant_space", layout.implant_space)
|
||||
import sys
|
||||
sys.exit(1)
|
||||
level=99
|
||||
debug.info(level, "poly_width".format(layout.poly_width))
|
||||
debug.info(level, "poly_space".format(layout.poly_space))
|
||||
debug.info(level, "m1_width".format(layout.m1_width))
|
||||
debug.info(level, "m1_space".format(layout.m1_space))
|
||||
debug.info(level, "m2_width".format(layout.m2_width))
|
||||
debug.info(level, "m2_space".format(layout.m2_space))
|
||||
debug.info(level, "m3_width".format(layout.m3_width))
|
||||
debug.info(level, "m3_space".format(layout.m3_space))
|
||||
debug.info(level, "m4_width".format(layout.m4_width))
|
||||
debug.info(level, "m4_space".format(layout.m4_space))
|
||||
debug.info(level, "active_width".format(layout.active_width))
|
||||
debug.info(level, "active_space".format(layout.active_space))
|
||||
debug.info(level, "contact_width".format(layout.contact_width))
|
||||
debug.info(level, "poly_to_active".format(layout.poly_to_active))
|
||||
debug.info(level, "poly_extend_active".format(layout.poly_extend_active))
|
||||
debug.info(level, "poly_to_contact".format(layout.poly_to_contact))
|
||||
debug.info(level, "active_contact_to_gate".format(layout.active_contact_to_gate))
|
||||
debug.info(level, "poly_contact_to_gate".format(layout.poly_contact_to_gate))
|
||||
debug.info(level, "well_enclose_active".format(layout.well_enclose_active))
|
||||
debug.info(level, "implant_enclose_active".format(layout.implant_enclose_active))
|
||||
debug.info(level, "implant_space".format(layout.implant_space))
|
||||
|
||||
@classmethod
|
||||
def setup_layer_constants(layout):
|
||||
|
|
@ -202,21 +200,19 @@ class layout():
|
|||
"{}_nonpref_pitch".format(layer_id),
|
||||
layout.compute_pitch(layer_id, False))
|
||||
|
||||
if False:
|
||||
for name in tech_layer_indices:
|
||||
if name == "active":
|
||||
continue
|
||||
try:
|
||||
print("{0} width {1} space {2}".format(name,
|
||||
getattr(layout, "{}_width".format(name)),
|
||||
getattr(layout, "{}_space".format(name))))
|
||||
level=99
|
||||
for name in tech_layer_indices:
|
||||
if name == "active":
|
||||
continue
|
||||
try:
|
||||
debug.info(level, "{0} width {1} space {2}".format(name,
|
||||
getattr(layout, "{}_width".format(name)),
|
||||
getattr(layout, "{}_space".format(name))))
|
||||
|
||||
print("pitch {0} nonpref {1}".format(getattr(layout, "{}_pitch".format(name)),
|
||||
getattr(layout, "{}_nonpref_pitch".format(name))))
|
||||
except AttributeError:
|
||||
pass
|
||||
import sys
|
||||
sys.exit(1)
|
||||
debug.info(level, "pitch {0} nonpref {1}".format(getattr(layout, "{}_pitch".format(name)),
|
||||
getattr(layout, "{}_nonpref_pitch".format(name))))
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def compute_pitch(layer, preferred=True):
|
||||
|
|
|
|||
|
|
@ -97,6 +97,10 @@ log.create_file = True
|
|||
|
||||
def info(lev, str):
|
||||
from globals import OPTS
|
||||
# 99 is a special never print level
|
||||
if lev == 99:
|
||||
return
|
||||
|
||||
if (OPTS.verbose_level >= lev):
|
||||
frm = inspect.stack()[1]
|
||||
mod = inspect.getmodule(frm[0])
|
||||
|
|
|
|||
|
|
@ -805,7 +805,7 @@ class router(router_tech):
|
|||
try:
|
||||
x = track[0]*self.track_width - 0.5*self.track_width
|
||||
except TypeError:
|
||||
print(track[0], type(track[0]), self.track_width, type(self.track_width))
|
||||
debug.warning("{} {} {} {}".format(track[0], type(track[0]), self.track_width, type(self.track_width)))
|
||||
y = track[1]*self.track_width - 0.5*self.track_width
|
||||
# offset lowest corner object to to (-track halo,-track halo)
|
||||
ll = snap_to_grid(vector(x, y))
|
||||
|
|
|
|||
|
|
@ -145,13 +145,14 @@ class supply_tree_router(router):
|
|||
connections.append((x, y))
|
||||
|
||||
# Route MST components
|
||||
level=99
|
||||
for index, (src, dest) in enumerate(connections):
|
||||
if not (index % 25):
|
||||
debug.info(1, "{0} supply segments routed, {1} remaining.".format(index, len(connections) - index))
|
||||
self.route_signal(pin_name, src, dest)
|
||||
if False and pin_name == "gnd":
|
||||
print("\nSRC {}: ".format(src) + str(self.pin_groups[pin_name][src].grids) + str(self.pin_groups[pin_name][src].blockages))
|
||||
print("DST {}: ".format(dest) + str(self.pin_groups[pin_name][dest].grids) + str(self.pin_groups[pin_name][dest].blockages))
|
||||
debug.info(level, "\nSRC {}: ".format(src) + str(self.pin_groups[pin_name][src].grids) + str(self.pin_groups[pin_name][src].blockages))
|
||||
debug.info(level, ("DST {}: ".format(dest) + str(self.pin_groups[pin_name][dest].grids) + str(self.pin_groups[pin_name][dest].blockages)))
|
||||
self.write_debug_gds("post_{0}_{1}.gds".format(src, dest), False)
|
||||
|
||||
#self.write_debug_gds("final_tree_router_{}.gds".format(pin_name), False)
|
||||
|
|
|
|||
|
|
@ -125,6 +125,11 @@ def check_file_format_whitespace(file_name):
|
|||
def check_print_output(file_name):
|
||||
"""Check if any files (except debug.py) call the _print_ function. We should
|
||||
use the debug output with verbosity instead!"""
|
||||
|
||||
skip_files = ["printGDS.py", "uniquifyGDS.py", "processGDS.py", "model_data_util.py"]
|
||||
base_file_name = os.path.basename(file_name)
|
||||
if base_file_name in skip_files:
|
||||
return(0)
|
||||
file = open(file_name, "r+b")
|
||||
line = file.read().decode('utf-8')
|
||||
# skip comments with a hash
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@ class model_delay_test(openram_test):
|
|||
else:
|
||||
self.assertTrue(False) # other techs fail
|
||||
|
||||
print('spice_delays', spice_delays)
|
||||
print('model_delays', model_delays)
|
||||
debug.info(3, 'spice_delays {}'.fomrat(spice_delays))
|
||||
debug.info(3, 'model_delays {}'.format(model_delays))
|
||||
|
||||
# Check if no too many or too few results
|
||||
self.assertTrue(len(spice_delays.keys())==len(model_delays.keys()))
|
||||
|
|
|
|||
Loading…
Reference in New Issue