From 197763e46eb4628de6afb0a759eca627b59b98f6 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Fri, 27 Feb 2026 11:18:27 -0500 Subject: [PATCH] Modified the output of "save .tcl" so that (1) it strips the ".tcl" off of the name, so that the cell name remains the same, and (2) it uses "units" instead of "snap", as the latter is no longer used for setting the unit type. --- VERSION | 2 +- database/DBio.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 549505b6..ddac89a1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.609 +8.3.610 diff --git a/database/DBio.c b/database/DBio.c index c18a2175..e54bade0 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -4187,7 +4187,8 @@ DBCellWriteCommandFile(cellDef, f) Label *lab; struct writeArg arg; - int pNum; + char *dotptr; + int pNum, namelen; TileType type, stype; TileTypeBitMask typeMask, *sMask; static const char *directionNames[] = {"c", "n", "ne", "e", "se", @@ -4197,12 +4198,20 @@ DBCellWriteCommandFile(cellDef, f) SigDisableInterrupts(); + /* If cellDef->cd_name has the ".tcl" extension, then strip it off */ + + namelen = strlen(cellDef->cd_name); + if ((namelen > 4) && (!strcmp(cellDef->cd_name + + strlen(cellDef->cd_name) - 4, ".tcl"))) + *(cellDef->cd_name + strlen(cellDef->cd_name) - 4) = '\0'; + /* Write a descriptive header */ fprintf(f, "# Command script for generating cell %s\n", cellDef->cd_name); fprintf(f, "\n"); fprintf(f, "suspendall\n"); fprintf(f, "tech unlock *\n"); - fprintf(f, "snap internal\n"); + fprintf(f, "set curunits [units]\n"); + fprintf(f, "units internal\n"); fprintf(f, "load %s -silent\n", cellDef->cd_name); fprintf(f, "box values 0 0 0 0\n"); @@ -4364,6 +4373,7 @@ DBCellWriteCommandFile(cellDef, f) fprintf(f, "select clear\n"); fprintf(f, "view\n"); fprintf(f, "tech revert\n"); + fprintf(f, "units {*}$curunits\n"); fprintf(f, "resumeall\n"); if (fflush(f) == EOF || ferror(f))