From 37db9e453b5bcc1e438dbdcff4a5627ae52fca58 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Wed, 18 Mar 2026 16:41:42 -0400 Subject: [PATCH] Extended the use of attribute labels to allow gate attributes to specify additional parameters for a device. Any gate attribute (label ending with "^") that has an "=" in it is considered a parameter, and is output with the device in the .ext file. This gives a way to add specific parameters to a device, which otherwise have no meaning to the layout editor. Note that prior to this extension, the gate attribute was used only to set the device index. If a gate attribute is made for a device index, it cannot have "=" in the name, so it remains backwardly compatible. Only non-parameter attributes are passed on to ext2spice. --- extract/ExtBasic.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/extract/ExtBasic.c b/extract/ExtBasic.c index d431e622..1b41f115 100644 --- a/extract/ExtBasic.c +++ b/extract/ExtBasic.c @@ -1835,6 +1835,8 @@ extOutputDevParams(reg, devptr, outFile, length, width, areavec, perimvec) ParamList *chkParam; HashEntry *he; ResValue resvalue; + LabRegion *node; /* Node connected to gate terminal */ + LabelList *ll; /* Gate's label list */ for (chkParam = devptr->exts_deviceParams; chkParam != NULL; chkParam = chkParam->pl_next) @@ -1966,6 +1968,34 @@ extOutputDevParams(reg, devptr, outFile, length, width, areavec, perimvec) break; } } + + /* If there are device attribute labels (labels attached to the device + * type ending with "^") with "=" in them, then treat them as extra + * parameters. Output each one and remove the gate attribute property + * from the label. + */ + + node = (LabRegion *)ExtGetRegion(reg->treg_tile, reg->treg_dinfo); + for (ll = node->lreg_labels; ll; ll = ll->ll_next) + { + if (ll->ll_attr == LL_GATEATTR) + { + char cs, *ct, *cp = ll->ll_label->lab_text; + if (strchr(cp, '=') != NULL) + { + /* Since this is an attribute label, it has a special character + * at the end, which needs to be stripped off while printing + * and then put back again. + */ + ct = ll->ll_label->lab_text + strlen(ll->ll_label->lab_text) - 1; + cs = *ct; + *ct = '\0'; + fprintf(outFile, " %s", ll->ll_label->lab_text); + ll->ll_attr = LL_NOATTR; + *ct = cs; + } + } + } } /* Structures used by extTermAPFunc() for storing area and perimeter data */