Revert "Fix whitespace"

This commit is contained in:
Matt Guthaus 2022-07-22 13:39:48 -07:00 committed by GitHub
parent f1e452c8e3
commit 5d6e56763f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
81 changed files with 752 additions and 727 deletions

View File

@ -220,3 +220,4 @@ class lef:
round(item[1],
self.round_grid)))
self.lef.write(" ;\n")

View File

@ -153,3 +153,4 @@ class timing_graph():
""" override print function output """
return str(self)

View File

@ -118,3 +118,5 @@ class cacti(simulation):
debug.info(1, "Dynamic Power: {0} mW".format(power.dynamic))
debug.info(1, "Leakage Power: {0} mW".format(power.leakage))
return power

View File

@ -40,3 +40,4 @@ class linear_regression(regression_model):
pred = model.predict(features)
return pred

View File

@ -211,3 +211,4 @@ class voltage_at_measure(spice_measurement):
meas_name = self.name
targ_name = self.targ_name_no_port
return (meas_name, targ_name, time_at)

View File

@ -448,3 +448,6 @@ class model_check(delay):
name_dict[self.sae_model_name] = name_dict["sae_measures"]
return name_dict

View File

@ -41,3 +41,4 @@ class neural_network(regression_model):
pred = model.predict(features)
reshape_pred = np.reshape(pred, (len(pred),1))
return reshape_pred

View File

@ -205,3 +205,4 @@ class regression_model(simulation):
OPTS.model_dict[model_name+"_coef"] = list(model.coef_[0])
debug.info(1,"Coefs of {}:{}".format(model_name,OPTS.model_dict[model_name+"_coef"]))
OPTS.model_dict[model_name+"_intercept"] = float(model.intercept_)

View File

@ -134,3 +134,4 @@ def bp():
and whenever you encounter the debug.bp() they won't be "reset".
"""
pass

View File

@ -290,3 +290,4 @@ class cell_properties():
@property
def row_cap_2port(self):
return self._row_cap_2port

View File

@ -267,3 +267,27 @@ if __name__ == "__main__":
input_dir_path = sys.argv[1]
out_path = sys.argv[2]
gen_model_csv(input_dir_path, out_path)

View File

@ -213,3 +213,8 @@ class grid:
"""
path.set_path(False)
path.set_blocked(True)

View File

@ -49,3 +49,4 @@ class grid_cell:
type_string += "P"
return type_string

View File

@ -102,3 +102,5 @@ class signal_escape_router(router):
# breakpoint()
self.write_debug_gds("debug_route.gds", True)

View File

@ -77,3 +77,5 @@ class supply_grid(signal_grid):
wave = wave_path.neighbor(direct)
return wave_path

View File

@ -392,3 +392,4 @@ class supply_grid_router(router):
debug.info(4, "Blocking supply rail")
for rail_name in self.supply_rail_tracks:
self.rg.set_blocked(self.supply_rail_tracks[rail_name])

View File

@ -28,7 +28,6 @@ class code_format_test(openram_test):
continue
errors += check_file_format_tab(code)
errors += check_file_format_carriage(code)
errors += check_file_format_whitespace(code)
for code in source_codes:
if re.search("gdsMill", code):
@ -52,7 +51,7 @@ def setup_files(path):
files = []
for (dir, _, current_files) in os.walk(path):
for f in current_files:
files.append(os.path.join(dir, f))
files.append(os.getenv("OPENRAM_HOME"))
nametest = re.compile("\.py$", re.IGNORECASE)
select_files = list(filter(nametest.search, files))
return select_files
@ -93,35 +92,13 @@ def check_file_format_carriage(file_name):
if len(key_positions)>10:
line_numbers = key_positions[:10] + [" ..."]
else:
line_numbers = key_positions
line_numbers = key_positoins
debug.info(0, '\nFound ' + str(len(key_positions)) + ' carriage returns in ' +
str(file_name) + ' (lines ' + ",".join(str(x) for x in line_numbers) + ')')
f.close()
return len(key_positions)
def check_file_format_whitespace(file_name):
"""
Check if file contains a line with whitespace at the end
and return the number of these lines.
"""
f = open(file_name, "r")
key_positions = []
for num, line in enumerate(f.readlines()):
if re.match(r".*[ \t]$", line):
key_positions.append(num)
if len(key_positions) > 0:
if len(key_positions) > 10:
line_numbers = key_positions[:10] + [" ..."]
else:
line_numbers = key_positions
debug.info(0, "\nFound " + str(len(key_positions)) + " ending whitespace in " +
str(file_name) + " (lines " + ",".join(str(x) for x in line_numbers) + ")")
f.close()
return len(key_positions)
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!"""