update the gate area for antenna violations to be the smallest gate area in the SCL

This commit is contained in:
mo-hosni 2023-04-10 06:57:50 -07:00
parent dd45696cb0
commit 29288fa6ab
1 changed files with 5 additions and 1 deletions

View File

@ -14,7 +14,7 @@ for filename in os.listdir(directory_path):
# define the lines to search for and the lines to insert # define the lines to search for and the lines to insert
input_lines = ["PIN", "DIRECTION INPUT", "USE SIGNAL", "ANTENNAGATEAREA"] input_lines = ["PIN", "DIRECTION INPUT", "USE SIGNAL", "ANTENNAGATEAREA"]
input_insert = " ANTENNAGATEAREA 0.196500 ;\n" input_insert = " ANTENNAGATEAREA 0.126000 ;\n"
output_lines = ["PIN", "DIRECTION OUTPUT", "USE SIGNAL", "ANTENNADIFFAREA"] output_lines = ["PIN", "DIRECTION OUTPUT", "USE SIGNAL", "ANTENNADIFFAREA"]
output_insert = " ANTENNADIFFAREA 0.340600 ;\n" output_insert = " ANTENNADIFFAREA 0.340600 ;\n"
@ -26,11 +26,15 @@ for filename in os.listdir(directory_path):
if input_lines[2] in lines[i+2]: if input_lines[2] in lines[i+2]:
if input_lines[3] not in lines[i+3]: if input_lines[3] not in lines[i+3]:
lines.insert(i+3, input_insert) lines.insert(i+3, input_insert)
else:
lines[i+3] = input_insert
if output_lines[0] in lines[i]: if output_lines[0] in lines[i]:
if output_lines[1] in lines[i+1]: if output_lines[1] in lines[i+1]:
if output_lines[2] in lines[i+2]: if output_lines[2] in lines[i+2]:
if output_lines[3] not in lines[i+3]: if output_lines[3] not in lines[i+3]:
lines.insert(i+3, output_insert) lines.insert(i+3, output_insert)
else:
lines[i+3] = output_insert
# write the modified contents back to the file # write the modified contents back to the file
with open(os.path.join(directory_path, filename), "w") as f: with open(os.path.join(directory_path, filename), "w") as f: