GitHub
04/05/2023, 5:14 PMimport multiprocessing
def process_sections(sections):
result = ""
with StringIO() as f:
for i in range(1, len(sections) - 1, 2):
vio_name = sections[i].strip()
for vio in sections[i + 1].split("\n"):
vio = vio.strip()
if len(vio):
print(f'box {vio}; feedback add "{vio_name}" medium', file=f)
result = f.getvalue()
return result
def magic_to_tcl_parallel(magic_input: str) -> str:
sections = magic_input.split(MAGIC_SPLIT_LINE)
section_lists = [sections[i:i+2] for i in range(1, len(sections) - 1, 2)]
with multiprocessing.Pool() as pool:
results = pool.map(process_sections, section_lists)
return ''.join(results)
Similar thing for the other functions in the file.
• Or add variables to skip this section if the output files are not used in the later stages.
MAGIC_CONVERT_DRC_TO_RDB
MAGIC_CONVERT_DRC_TO_TCL
MAGIC_CONVERT_DRC_TO_TR
MAGIC_CONVERT_DRC_TO_KLAYOUT
The-OpenROAD-Project/OpenLane