From 49b8e8724c52f752ec82c873c07f3242a87e48dc Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Thu, 29 Feb 2024 22:38:35 +0200 Subject: [PATCH] feat(tt_tool): support for specifying custom GDS file for PNG render tinytapeout/tt-gds-action#12 --- project.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/project.py b/project.py index c661d9b..d141015 100644 --- a/project.py +++ b/project.py @@ -548,12 +548,17 @@ class Project: # Read and return top-level GDS data from the final GDS file, using gdstk: def get_final_gds_top_cells(self): - gds = glob.glob( - os.path.join(self.local_dir, "runs/wokwi/results/final/gds/*gds") - ) - if self.args.openlane2: - gds = glob.glob(os.path.join(self.local_dir, "runs/wokwi/final/gds/*gds")) - library = gdstk.read_gds(gds[0]) + if "GDS_PATH" in os.environ: + gds_path = os.environ["GDS_PATH"] + elif self.args.openlane2: + gds_path = glob.glob( + os.path.join(self.local_dir, "runs/wokwi/results/final/gds/*.gds") + )[0] + else: + gds_path = glob.glob( + os.path.join(self.local_dir, "runs/wokwi/final/gds/*.gds") + )[0] + library = gdstk.read_gds(gds_path) top_cells = library.top_level() return top_cells[0]