diff --git a/VERSION b/VERSION index 82c899d2..304a517a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.239 +8.3.240 diff --git a/calma/CalmaRdpt.c b/calma/CalmaRdpt.c index 4158f4f8..b08d62f8 100644 --- a/calma/CalmaRdpt.c +++ b/calma/CalmaRdpt.c @@ -316,7 +316,7 @@ calmaElementBoundary() if (lab == NULL) { /* There was no label in the area. Create a placeholder label */ - DBPutLabel(cifReadCellDef, &rpc, GEO_CENTER, "", type, 0); + DBPutLabel(cifReadCellDef, &rpc, GEO_CENTER, "", type, 0, 0); } } } @@ -970,10 +970,10 @@ calmaElementText() } if (font < 0) - lab = DBPutLabel(cifReadCellDef, &r, pos, textbody, type, flags); + lab = DBPutLabel(cifReadCellDef, &r, pos, textbody, type, flags, 0); else lab = DBPutFontLabel(cifReadCellDef, &r, font, size, angle, - &GeoOrigin, pos, textbody, type, flags); + &GeoOrigin, pos, textbody, type, flags, 0); if ((lab != NULL) && (cifnum >= 0) && (cifCurReadStyle->crs_labelSticky[cifnum] == LABEL_TYPE_PORT)) @@ -988,7 +988,7 @@ calmaElementText() i = -1; for (sl = cifReadCellDef->cd_labels; sl != NULL; sl = sl->lab_next) { - idx = sl->lab_flags & PORT_NUM_MASK; + idx = sl->lab_port; if (idx > i) i = idx; if ((idx > 0) && (sl != lab) && !strcmp(sl->lab_text, textbody)) { @@ -997,7 +997,7 @@ calmaElementText() } } i++; - lab->lab_flags |= (PORT_NUM_MASK & i); + lab->lab_port = i; lab->lab_flags |= PORT_DIR_NORTH | PORT_DIR_SOUTH | PORT_DIR_EAST | PORT_DIR_WEST; } diff --git a/calma/CalmaWrite.c b/calma/CalmaWrite.c index 232e9e56..634abef7 100644 --- a/calma/CalmaWrite.c +++ b/calma/CalmaWrite.c @@ -1262,8 +1262,8 @@ calmaOutFunc(def, f, cliprect) } else { - if ((int)(lab->lab_flags & PORT_NUM_MASK) > maxport) - maxport = (int)(lab->lab_flags & PORT_NUM_MASK); + if ((int)lab->lab_port > maxport) + maxport = (int)lab->lab_port; } } if (maxport >= 0) @@ -1272,7 +1272,7 @@ calmaOutFunc(def, f, cliprect) { type = CIFCurStyle->cs_portLayer[lab->lab_type]; if ((type >= 0) && ((lab->lab_flags & PORT_DIR_MASK) != 0) && - ((lab->lab_flags & PORT_NUM_MASK) == i)) + (lab->lab_port == i)) { calmaWriteLabelFunc(lab, type, f); /* break; */ /* Do not limit to unique labels! */ diff --git a/cif/CIFrdcl.c b/cif/CIFrdcl.c index ed2c6d00..5a69f0ab 100644 --- a/cif/CIFrdcl.c +++ b/cif/CIFrdcl.c @@ -1183,7 +1183,7 @@ cifParseUser94() flags = LABEL_STICKY; else flags = 0; - (void) DBPutLabel(cifReadCellDef, &rectangle, -1, name, type, flags); + (void) DBPutLabel(cifReadCellDef, &rectangle, -1, name, type, flags, 0); } freeMagic(name); return TRUE; @@ -1344,7 +1344,7 @@ cifParseUser95() flags = LABEL_STICKY; else flags = 0; - (void) DBPutLabel(cifReadCellDef, &rectangle, -1, name, type, flags); + (void) DBPutLabel(cifReadCellDef, &rectangle, -1, name, type, flags, 0); } freeMagic(name); diff --git a/commands/CmdFI.c b/commands/CmdFI.c index e1500cb0..18efd57d 100644 --- a/commands/CmdFI.c +++ b/commands/CmdFI.c @@ -1872,7 +1872,8 @@ flatCopyAllLabels(scx, lab, tpath, targetUse) { Rect labTargetRect; int targetPos; - int flags = 0; + unsigned short flags = 0; + unsigned int port = 0; CellDef *def; char labelname[1024]; char *n, *f, c; @@ -1903,7 +1904,10 @@ flatCopyAllLabels(scx, lab, tpath, targetUse) * top level cell, but certainly not any others. */ if (tpath && (*tpath->tp_first) == '\0') + { flags = lab->lab_flags; + port = lab->lab_port; + } /* To-do Feb. 2008: Translate target rotation and offset */ @@ -1913,7 +1917,7 @@ flatCopyAllLabels(scx, lab, tpath, targetUse) strcpy(n, lab->lab_text); DBPutFontLabel(def, &labTargetRect, lab->lab_font, lab->lab_size, lab->lab_rotate, &lab->lab_offset, targetPos, - f, lab->lab_type, flags); + f, lab->lab_type, flags, port); *n = c; return 0; diff --git a/commands/CmdLQ.c b/commands/CmdLQ.c index f8b14f05..808ae903 100644 --- a/commands/CmdLQ.c +++ b/commands/CmdLQ.c @@ -120,7 +120,7 @@ CmdLabelProc(text, font, size, rotate, offx, offy, pos, sticky, type) offset.p_y = offy; lab = DBPutFontLabel(EditCellUse->cu_def, &editBox, font, size, rotate, &offset, pos, text, type, - ((sticky) ? LABEL_STICKY : 0)); + ((sticky) ? LABEL_STICKY : 0), 0); DBAdjustLabels(EditCellUse->cu_def, &editBox); DBReComputeBbox(EditCellUse->cu_def); tmpArea = lab->lab_rect; @@ -1503,7 +1503,7 @@ CmdPort(w, cmd) int portidx = atoi(cmd->tx_argv[1]); for (sl = editDef->cd_labels; sl != NULL; sl = sl->lab_next) if (sl && ((sl->lab_flags & PORT_DIR_MASK) != 0)) - if ((sl->lab_flags & PORT_NUM_MASK) == portidx) + if ((int)sl->lab_port == portidx) { lab = sl; break; @@ -1622,7 +1622,7 @@ CmdPort(w, cmd) i = -1; for (sl = editDef->cd_labels; sl != NULL; sl = sl->lab_next) { - idx = sl->lab_flags & PORT_NUM_MASK; + idx = (int)sl->lab_port; if (idx > i) i = idx; } #ifdef MAGIC_WRAPPER @@ -1633,16 +1633,15 @@ CmdPort(w, cmd) break; case PORT_FIRST: - i = PORT_NUM_MASK + 1; + i = -1; for (sl = editDef->cd_labels; sl != NULL; sl = sl->lab_next) { if (sl->lab_flags & PORT_DIR_MASK) { - idx = sl->lab_flags & PORT_NUM_MASK; + idx = (int)sl->lab_port; if (idx < i) i = idx; } } - if (i == PORT_NUM_MASK + 1) i = -1; #ifdef MAGIC_WRAPPER Tcl_SetObjResult(magicinterp, Tcl_NewIntObj(i)); #else @@ -1651,18 +1650,17 @@ CmdPort(w, cmd) break; case PORT_NEXT: - refidx = lab->lab_flags & PORT_NUM_MASK; - i = PORT_NUM_MASK + 1; + refidx = (int)lab->lab_port; + i = -1; for (sl = editDef->cd_labels; sl != NULL; sl = sl->lab_next) { if (sl->lab_flags & PORT_DIR_MASK) { - idx = sl->lab_flags & PORT_NUM_MASK; + idx = (int)sl->lab_port; if (idx > refidx) if (idx < i) i = idx; } } - if (i == PORT_NUM_MASK + 1) i = -1; #ifdef MAGIC_WRAPPER Tcl_SetObjResult(magicinterp, Tcl_NewIntObj(i)); #else @@ -1705,7 +1703,7 @@ CmdPort(w, cmd) lab->lab_size, lab->lab_rotate, &lab->lab_offset, lab->lab_just, cmd->tx_argv[argstart + 1], - lab->lab_type, lab->lab_flags); + lab->lab_type, lab->lab_flags, lab->lab_port); DBEraseLabelsByContent(editDef, &lab->lab_rect, -1, lab->lab_text); DBWLabelChanged(editDef, sl, DBW_ALLWINDOWS); @@ -1849,7 +1847,7 @@ CmdPort(w, cmd) case PORT_INDEX: if (argc == 2) { - idx = lab->lab_flags & PORT_NUM_MASK; + idx = (int)lab->lab_port; #ifdef MAGIC_WRAPPER Tcl_SetObjResult(magicinterp, Tcl_NewIntObj(idx)); #else @@ -1867,8 +1865,7 @@ CmdPort(w, cmd) if (((sl->lab_flags & PORT_DIR_MASK) != 0) && !strcmp(sl->lab_text, lab->lab_text)) { - sl->lab_flags &= (~PORT_NUM_MASK); - sl->lab_flags |= atoi(cmd->tx_argv[argstart + 1]); + sl->lab_port = (unsigned int)atoi(cmd->tx_argv[argstart + 1]); } } editDef->cd_flags |= (CDMODIFIED | CDGETNEWSTAMP); @@ -1950,8 +1947,7 @@ CmdPort(w, cmd) if (!strcmp(lastlab->lab_text, tlab->lab_text)) p--; - tlab->lab_flags &= ~PORT_NUM_MASK; - tlab->lab_flags |= p; + tlab->lab_port = (unsigned int)p; lastlab = tlab; p++; } @@ -2019,7 +2015,7 @@ parseindex: if (sl == lab) continue; /* don't consider self */ if (sl->lab_flags & PORT_DIR_MASK) { - if ((sl->lab_flags & PORT_NUM_MASK) == idx) + if ((int)sl->lab_port == idx) { TxError("Port index %d is already used by port %s.\n" "Use command \"port index %d\" to force " @@ -2043,18 +2039,17 @@ parseindex: // declared a port, then use its index. if (!strcmp(sl->lab_text, lab->lab_text)) { - idx = (sl->lab_flags & PORT_NUM_MASK) - 1; + idx = (int)sl->lab_port - 1; break; } - else if ((sl->lab_flags & PORT_NUM_MASK) > idx) - idx = (sl->lab_flags & PORT_NUM_MASK); + else if (sl->lab_port > idx) + idx = sl->lab_port; } } idx++; } - lab->lab_flags &= ~PORT_NUM_MASK; - lab->lab_flags |= idx; + lab->lab_port = idx; /* * Find positions. diff --git a/commands/CmdRS.c b/commands/CmdRS.c index 460bb0de..1b86ae90 100644 --- a/commands/CmdRS.c +++ b/commands/CmdRS.c @@ -1633,7 +1633,8 @@ cmdLabelTextFunc(label, cellUse, transform, text) { newlab = DBPutFontLabel(cellDef, &label->lab_rect, label->lab_font, label->lab_size, label->lab_rotate, &label->lab_offset, - label->lab_just, text, label->lab_type, label->lab_flags); + label->lab_just, text, label->lab_type, label->lab_flags, + label->lab_port); DBEraseLabelsByContent(cellDef, &label->lab_rect, -1, label->lab_text); DBWLabelChanged(cellDef, newlab, DBW_ALLWINDOWS); } diff --git a/database/DBcellcopy.c b/database/DBcellcopy.c index 9b5d8419..8cfeb28f 100644 --- a/database/DBcellcopy.c +++ b/database/DBcellcopy.c @@ -641,7 +641,7 @@ dbCopyAllLabels(scx, lab, tpath, arg) DBEraseLabelsByContent(def, &labTargetRect, -1, lab->lab_text); DBPutFontLabel(def, &labTargetRect, lab->lab_font, lab->lab_size, labRotate, &labOffset, targetPos, - lab->lab_text, lab->lab_type, lab->lab_flags); + lab->lab_text, lab->lab_type, lab->lab_flags, lab->lab_port); if (arg->cla_bbox != NULL) { GeoIncludeAll(&labTargetRect, arg->cla_bbox); @@ -849,7 +849,8 @@ DBCellCopyLabels(scx, mask, xMask, targetUse, pArea) DBEraseLabelsByContent(def, &labTargetRect, -1, lab->lab_text); DBPutFontLabel(def, &labTargetRect, lab->lab_font, lab->lab_size, labRotate, &labOffset, targetPos, - lab->lab_text, lab->lab_type, lab->lab_flags); + lab->lab_text, lab->lab_type, lab->lab_flags, + lab->lab_port); if (pArea != NULL) (void) GeoIncludeAll(&labTargetRect, pArea); } diff --git a/database/DBconnect.c b/database/DBconnect.c index 1b665473..2ffbffee 100644 --- a/database/DBconnect.c +++ b/database/DBconnect.c @@ -668,13 +668,13 @@ dbcConnectLabelFunc(scx, lab, tpath, csa2) DBEraseLabelsByContent(def, &r, -1, lab->lab_text); DBPutFontLabel(def, &r, lab->lab_font, lab->lab_size, rotate, &offset, - pos, newlabptr, lab->lab_type, lab->lab_flags); + pos, newlabptr, lab->lab_type, lab->lab_flags, lab->lab_port); if (lab->lab_flags & PORT_DIR_MASK) { CellDef *orig_def = scx->scx_use->cu_def; Label *slab; - int lidx = lab->lab_flags & PORT_NUM_MASK; + int lidx = lab->lab_port; TileTypeBitMask *connectMask; /* Check for equivalent ports. For any found, call */ @@ -688,7 +688,7 @@ dbcConnectLabelFunc(scx, lab, tpath, csa2) for (slab = orig_def->cd_labels; slab != NULL; slab = slab->lab_next) if ((slab->lab_flags & PORT_DIR_MASK) && (slab != lab)) - if ((slab->lab_flags & PORT_NUM_MASK) == lidx) + if (slab->lab_port == lidx) { Rect newarea; int i, pNum; diff --git a/database/DBio.c b/database/DBio.c index dc673506..1195207f 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -2416,7 +2416,7 @@ dbReadLabels(cellDef, line, len, f, scalen, scaled) goto nextlabel; } /* lab->lab_flags &= ~LABEL_STICKY; */ - lab->lab_flags |= idx; + lab->lab_port = idx; for (pptr = &ppos[0]; *pptr != '\0'; pptr++) { switch(*pptr) @@ -2579,10 +2579,10 @@ dbReadLabels(cellDef, line, len, f, scalen, scaled) type = rtype; } if (font < 0) - DBPutLabel(cellDef, &r, orient, text, type, flags); + DBPutLabel(cellDef, &r, orient, text, type, flags, 0); else DBPutFontLabel(cellDef, &r, font, size, rotate, &offset, - orient, text, type, flags); + orient, text, type, flags, 0); nextlabel: if (dbFgets(line, len, f) == NULL) @@ -2947,8 +2947,7 @@ DBCellWriteFile(cellDef, f) if (lab->lab_flags & PORT_DIR_SOUTH) strcat(ppos, "s"); if (lab->lab_flags & PORT_DIR_EAST) strcat(ppos, "e"); if (lab->lab_flags & PORT_DIR_WEST) strcat(ppos, "w"); - sprintf(lstring, "port %d %s", lab->lab_flags & PORT_NUM_MASK, - ppos); + sprintf(lstring, "port %d %s", lab->lab_port, ppos); if (lab->lab_flags & (PORT_USE_MASK | PORT_CLASS_MASK | PORT_SHAPE_MASK)) { diff --git a/database/DBlabel.c b/database/DBlabel.c index 5dde37b8..32f2158d 100644 --- a/database/DBlabel.c +++ b/database/DBlabel.c @@ -91,17 +91,18 @@ DBIsSubcircuit(cellDef) */ Label * -DBPutLabel(cellDef, rect, align, text, type, flags) +DBPutLabel(cellDef, rect, align, text, type, flags, port) CellDef *cellDef; Rect *rect; int align; char *text; TileType type; - int flags; + unsigned short flags; + unsigned int port; { /* Draw text in a standard X11 font */ return DBPutFontLabel(cellDef, rect, -1, 0, 0, &GeoOrigin, - align, text, type, flags); + align, text, type, flags, port); } /* @@ -128,7 +129,7 @@ DBPutLabel(cellDef, rect, align, text, type, flags) * ---------------------------------------------------------------------------- */ Label * -DBPutFontLabel(cellDef, rect, font, size, rot, offset, align, text, type, flags) +DBPutFontLabel(cellDef, rect, font, size, rot, offset, align, text, type, flags, port) CellDef *cellDef; /* Cell in which label is placed */ Rect *rect; /* Location of label; see above for description */ int font; /* A vector outline font to use, or -1 for X11 font */ @@ -141,7 +142,8 @@ DBPutFontLabel(cellDef, rect, font, size, rot, offset, align, text, type, flags) */ char *text; /* Pointer to actual text of label */ TileType type; /* Type of tile to be labelled */ - int flags; /* Label flags */ + unsigned short flags; /* Label flags */ + unsigned int port; /* Port index (if label is a port, per the flags) */ { Label *lab; int len, x1, x2, y1, y2, tmp, labx, laby; @@ -208,6 +210,7 @@ DBPutFontLabel(cellDef, rect, font, size, rot, offset, align, text, type, flags) } lab->lab_type = type; lab->lab_flags = flags; + lab->lab_port = port; lab->lab_rect = *rect; lab->lab_next = NULL; if (cellDef->cd_labels == NULL) diff --git a/database/DBundo.c b/database/DBundo.c index 4845d9e8..7a64dce4 100644 --- a/database/DBundo.c +++ b/database/DBundo.c @@ -434,6 +434,7 @@ typedef Label labelUE; #define lue_offset lab_offset #define lue_flags lab_flags #define lue_text lab_text +#define lue_port lab_port /* * labelSize(n) is the size of a labelUE large enough to hold @@ -556,7 +557,7 @@ dbUndoLabelForw(up) lab = DBPutFontLabel(dbUndoLastCell, &up->lue_rect, up->lue_font, up->lue_size, up->lue_rotate, &up->lue_offset, up->lue_just, up->lue_text, - up->lue_type, up->lue_flags); + up->lue_type, up->lue_flags, up->lue_port); DBWLabelChanged(dbUndoLastCell, lab, DBW_ALLWINDOWS); /* diff --git a/database/database.h.in b/database/database.h.in index c4334e15..a4556395 100644 --- a/database/database.h.in +++ b/database/database.h.in @@ -252,9 +252,10 @@ typedef struct label Point lab_offset; /* Offset relative to origin point, in * units of (database units / 8) */ - unsigned int lab_flags; /* Information, especially for + unsigned short lab_flags; /* Information, especially for * marking port labels */ + unsigned int lab_port; /* Port number, if label is a port */ struct label *lab_next; /* Next label in list */ char lab_text[4]; /* Actual text of label. This field * is just a place-holder: the actual @@ -269,46 +270,44 @@ typedef struct label * Label flags bit fields */ -#define PORT_NUM_MASK 0x003fff /* Mask of port number (up to 16384) */ +#define PORT_DIR_MASK 0x00000f /* Mask of all port directions */ +#define PORT_DIR_NORTH 0x000001 /* Port allows connection to north */ +#define PORT_DIR_EAST 0x000002 /* Port allows connection to east */ +#define PORT_DIR_SOUTH 0x000004 /* Port allows connection to south */ +#define PORT_DIR_WEST 0x000008 /* Port allows connection to west */ -#define PORT_DIR_MASK 0x03c000 /* Mask of all port directions */ -#define PORT_DIR_NORTH 0x004000 /* Port allows connection to north */ -#define PORT_DIR_EAST 0x008000 /* Port allows connection to east */ -#define PORT_DIR_SOUTH 0x010000 /* Port allows connection to south */ -#define PORT_DIR_WEST 0x020000 /* Port allows connection to west */ +#define PORT_CLASS_MASK 0x070 /* Mask of all port classes */ +#define PORT_CLASS_DEFAULT 0x000 /* Port takes default class */ +#define PORT_CLASS_INPUT 0x010 /* Port is a digital input */ +#define PORT_CLASS_OUTPUT 0x020 /* Port is a digital output */ +#define PORT_CLASS_TRISTATE 0x030 /* Port is a tri-state output */ +#define PORT_CLASS_BIDIRECTIONAL 0x040 /* Port is analog or digital */ + /* bidirectional */ +#define PORT_CLASS_FEEDTHROUGH 0x050 /* Port touches no active */ + /* devices */ -#define PORT_CLASS_MASK 0x1c0000 /* Mask of all port classes */ -#define PORT_CLASS_DEFAULT 0x000000 /* Port takes default class */ -#define PORT_CLASS_INPUT 0x040000 /* Port is a digital input */ -#define PORT_CLASS_OUTPUT 0x080000 /* Port is a digital output */ -#define PORT_CLASS_TRISTATE 0x0c0000 /* Port is a tri-state output */ -#define PORT_CLASS_BIDIRECTIONAL 0x100000 /* Port is analog or digital */ - /* bidirectional */ -#define PORT_CLASS_FEEDTHROUGH 0x140000 /* Port touches no active */ - /* devices */ +#define PORT_USE_MASK 0x0780 /* Mask of all port uses */ +#define PORT_USE_DEFAULT 0x0000 /* Port takes default use */ +#define PORT_USE_SIGNAL 0x0080 /* Port is a digital signal */ +#define PORT_USE_ANALOG 0x0100 /* Port is an analog signal */ +#define PORT_USE_POWER 0x0180 /* Port is a power rail */ +#define PORT_USE_GROUND 0x0200 /* Port is a ground rail */ +#define PORT_USE_CLOCK 0x0280 /* Port is a digital clock */ +#define PORT_USE_RESET 0x0300 /* Port is a digital reset */ +#define PORT_USE_SCAN 0x0380 /* Port is a digital scan */ +#define PORT_USE_TIEOFF 0x0400 /* Port is a tie-off */ -#define PORT_USE_MASK 0x03c00000 /* Mask of all port uses */ -#define PORT_USE_DEFAULT 0x00000000 /* Port takes default use */ -#define PORT_USE_SIGNAL 0x00400000 /* Port is a digital signal */ -#define PORT_USE_ANALOG 0x00800000 /* Port is an analog signal */ -#define PORT_USE_POWER 0x00c00000 /* Port is a power rail */ -#define PORT_USE_GROUND 0x01000000 /* Port is a ground rail */ -#define PORT_USE_CLOCK 0x01400000 /* Port is a digital clock */ -#define PORT_USE_RESET 0x01800000 /* Port is a digital reset */ -#define PORT_USE_SCAN 0x01c00000 /* Port is a digital scan */ -#define PORT_USE_TIEOFF 0x02000000 /* Port is a tie-off */ +#define PORT_SHAPE_MASK 0x1800 /* Mask of all port shapes */ +#define PORT_SHAPE_DEFAULT 0x0000 /* Port takes default shape */ +#define PORT_SHAPE_ABUT 0x0800 /* Port is an abutment shape */ +#define PORT_SHAPE_RING 0x1000 /* Port is a ring shape */ +#define PORT_SHAPE_THRU 0x1800 /* Port is a feedthrough shape */ -#define PORT_SHAPE_MASK 0x0c000000 /* Mask of all port shapes */ -#define PORT_SHAPE_DEFAULT 0x00000000 /* Port takes default shape */ -#define PORT_SHAPE_ABUT 0x04000000 /* Port is an abutment shape */ -#define PORT_SHAPE_RING 0x08000000 /* Port is a ring shape */ -#define PORT_SHAPE_THRU 0x0c000000 /* Port is a feedthrough shape */ - -#define PORT_VISITED 0x10000000 /* Bit for checking if a port */ +#define PORT_VISITED 0x2000 /* Bit for checking if a port */ /* has been previously visited. */ -#define LABEL_STICKY 0x20000000 /* Label does not change layers */ -#define LABEL_GENERATE 0x40000000 /* Auto-generated label */ +#define LABEL_STICKY 0x4000 /* Label does not change layers */ +#define LABEL_GENERATE 0x8000 /* Auto-generated label */ /* * Macros for dealing with label rectangles. diff --git a/ext2spice/ext2hier.c b/ext2spice/ext2hier.c index e5a23549..91aad3c7 100644 --- a/ext2spice/ext2hier.c +++ b/ext2spice/ext2hier.c @@ -1979,8 +1979,10 @@ esHierVisit(hc, cdata) /* Reset the subcircuit hash table, if using HSPICE format */ if (esFormat == HSPICE) { + HashKill(&subcktNameTable); HashInit(&subcktNameTable, 32, HT_STRINGKEYS); #ifndef UNSORTED_SUBCKT + DQFree(&subcktNameQueue); DQInit(&subcktNameQueue, 64); #endif } diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index abf3c695..cda0725b 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -77,7 +77,7 @@ int esNoModelType; /* index for device type "None" (model-less device) */ * which also are meaningful. */ HashTable subcktNameTable ; /* the hash table itself */ -DQueue subcktNameQueue ; /* q used to print it sorted at the end*/ +DQueue subcktNameQueue ; /* q used to print it sorted at the end */ fetInfoList esFetInfo[TT_MAXTYPES]; @@ -1005,6 +1005,12 @@ runexttospice: EFFlatDone(); } EFDone(); + if (esFormat == HSPICE) { + HashKill(&subcktNameTable); +#ifndef UNSORTED_SUBCKT + DQFree(&subcktNameQueue); +#endif + } if (esSpiceF) fclose(esSpiceF); @@ -1163,6 +1169,12 @@ main(argc, argv) EFFlatDone(); EFDone(); + if (esFormat == HSPICE) { + HashKill(&subcktNameTable); +#ifndef UNSORTED_SUBCKT + DQFree(&subcktNameQueue); +#endif + } if (esSpiceF) fclose(esSpiceF); diff --git a/extract/ExtBasic.c b/extract/ExtBasic.c index c1b231f5..4ed10f7b 100644 --- a/extract/ExtBasic.c +++ b/extract/ExtBasic.c @@ -645,7 +645,7 @@ extOutputNodes(nodeList, outFile) { fprintf(outFile, "port \"%s\" %d %d %d %d %d %s\n", ll->ll_label->lab_text, - ll->ll_label->lab_flags & PORT_NUM_MASK, + ll->ll_label->lab_port, ll->ll_label->lab_rect.r_xbot, ll->ll_label->lab_rect.r_ybot, ll->ll_label->lab_rect.r_xtop, diff --git a/extract/ExtUnique.c b/extract/ExtUnique.c index 1f5acd00..a38b9f6c 100644 --- a/extract/ExtUnique.c +++ b/extract/ExtUnique.c @@ -186,7 +186,8 @@ extMakeUnique(def, ll, lreg, lregList, labelHash, option) int nsuffix, nwarn; Label saveLab, *lab; Rect r; - int flags; + unsigned short flags; + int portno; /* * Make a pass through all labels for all nodes. @@ -277,17 +278,17 @@ makeUnique: flags = ll2->ll_label->lab_flags; if (flags & PORT_DIR_MASK) { int idx; - int portno = -1; + portno = -1; /* Find the last port index used in the cell def */ for (lab = def->cd_labels; lab != NULL; lab = lab->lab_next) { - idx = lab->lab_flags & PORT_NUM_MASK; + idx = lab->lab_port; if (idx > portno) portno = idx; } portno++; - flags &= ~PORT_NUM_MASK; - flags |= portno; } + else + portno = 0; lab = ll2->ll_label; saveLab = *lab; @@ -296,7 +297,7 @@ makeUnique: (void) DBPutFontLabel(def, &saveLab.lab_rect, saveLab.lab_font, saveLab.lab_size, saveLab.lab_rotate, &saveLab.lab_offset, saveLab.lab_just, name2, - saveLab.lab_type, flags); + saveLab.lab_type, flags, (unsigned int)portno); ll2->ll_label = (Label *) NULL; } diff --git a/lef/defRead.c b/lef/defRead.c index 0f8a702f..e7567fde 100644 --- a/lef/defRead.c +++ b/lef/defRead.c @@ -616,7 +616,7 @@ endCoord: Rect r; r.r_xbot = r.r_xtop = (routeTop->r_r.r_xbot + routeTop->r_r.r_xtop) / 2; r.r_ybot = r.r_ytop = (routeTop->r_r.r_ybot + routeTop->r_r.r_ytop) / 2; - DBPutLabel(rootDef, &r, GEO_CENTER, netname, routeTop->r_type, 0); + DBPutLabel(rootDef, &r, GEO_CENTER, netname, routeTop->r_type, 0, 0); labeled = TRUE; } @@ -1132,7 +1132,7 @@ DefReadPins(f, rootDef, sname, oscale, total) DBPaint(rootDef, &topRect, rectList->r_type); DBPutLabel(rootDef, &topRect, -1, pinname, rectList->r_type, - pinNum | pinDir | pinUse | flags); + pinDir | pinUse | flags, pinNum); freeMagic(rectList); rectList = rectList->r_next; } @@ -1161,7 +1161,7 @@ DefReadPins(f, rootDef, sname, oscale, total) DBPaint(rootDef, &topRect, rectList->r_type); DBPutLabel(rootDef, &topRect, -1, pinname, rectList->r_type, - pinNum | pinDir | pinUse | flags); + pinDir | pinUse | flags, pinNum); freeMagic(rectList); rectList = rectList->r_next; } diff --git a/lef/lefRead.c b/lef/lefRead.c index 3634831e..64e35ced 100644 --- a/lef/lefRead.c +++ b/lef/lefRead.c @@ -1299,7 +1299,7 @@ LefReadPort(lefMacro, f, pinName, pinNum, pinDir, pinUse, pinShape, oscale, lann /* it. */ if (lanno->lab_flags & PORT_DIR_MASK) - pinNum = lanno->lab_flags & PORT_NUM_MASK; + pinNum = lanno->lab_port; else { Label *sl; @@ -1310,7 +1310,7 @@ LefReadPort(lefMacro, f, pinName, pinNum, pinDir, pinUse, pinShape, oscale, lann { if (sl->lab_flags & PORT_DIR_MASK) { - idx = sl->lab_flags & PORT_NUM_MASK; + idx = sl->lab_port; if (idx > pinNum) pinNum = idx; } } @@ -1319,7 +1319,7 @@ LefReadPort(lefMacro, f, pinName, pinNum, pinDir, pinUse, pinShape, oscale, lann } else /* Create a new label (non-rendered) */ - DBPutLabel(lefMacro, &rectList->r_r, -1, pinName, rectList->r_type, 0); + DBPutLabel(lefMacro, &rectList->r_r, -1, pinName, rectList->r_type, 0, 0); /* Set this label to be a port */ @@ -1607,7 +1607,7 @@ LefReadPin(lefMacro, f, pinname, pinNum, oscale, is_imported) else { if (lab->lab_flags & PORT_DIR_MASK) - pinNum = lab->lab_flags & PORT_NUM_MASK; + pinNum = lab->lab_port; else { Label *sl; @@ -1619,7 +1619,7 @@ LefReadPin(lefMacro, f, pinname, pinNum, oscale, is_imported) { if (sl->lab_flags & PORT_DIR_MASK) { - idx = sl->lab_flags & PORT_NUM_MASK; + idx = sl->lab_port; if (idx > pinNum) pinNum = idx; } } diff --git a/lef/lefWrite.c b/lef/lefWrite.c index d32818fe..b47bef82 100644 --- a/lef/lefWrite.c +++ b/lef/lefWrite.c @@ -1339,7 +1339,7 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster) if (lab->lab_flags & PORT_DIR_MASK) { curport++; - idx = lab->lab_flags & PORT_NUM_MASK; + idx = (int)lab->lab_port; if (idx > maxport) maxport = idx; } @@ -1356,7 +1356,7 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster) for (lab = def->cd_labels; lab != NULL; lab = lab->lab_next) if (lab->lab_flags & PORT_DIR_MASK) if (!(lab->lab_flags & PORT_VISITED)) - if ((lab->lab_flags & PORT_NUM_MASK) == idx) + if (lab->lab_port == idx) break; } else @@ -1610,7 +1610,7 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster) for (tlab = lab->lab_next; tlab != (Label *)NULL; tlab = tlab->lab_next) if (tlab->lab_flags & PORT_DIR_MASK) if (!(tlab->lab_flags & PORT_VISITED)) - if ((tlab->lab_flags & PORT_NUM_MASK) == idx) + if (tlab->lab_port == idx) { TileTypeBitMask lmask; TTMaskSetOnlyType(&lmask, tlab->lab_type); @@ -1637,7 +1637,7 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster) for (; lab != NULL; lab = lab->lab_next) if (lab->lab_flags & PORT_DIR_MASK) if (!(lab->lab_flags & PORT_VISITED)) - if ((lab->lab_flags & PORT_NUM_MASK) == idx) + if (lab->lab_port == idx) break; if (lc.numWrites > 0) @@ -1660,7 +1660,7 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster) for (tlab = reflab->lab_next; tlab != NULL; tlab = tlab->lab_next) { if (tlab->lab_flags & PORT_DIR_MASK) - if ((tlab->lab_flags & PORT_NUM_MASK) == idx) + if (tlab->lab_port == idx) if (strcmp(reflab->lab_text, tlab->lab_text)) { TxError("Index %d is used for ports \"%s\" and \"%s\"\n", diff --git a/plow/PlowRandom.c b/plow/PlowRandom.c index 680fcd4d..1c25666b 100644 --- a/plow/PlowRandom.c +++ b/plow/PlowRandom.c @@ -154,7 +154,7 @@ PlowRandomTest(def) #endif /* notdef */ /* Make sure there's always something to undo */ - DBPutLabel(def, &def->cd_bbox, -1, "dummylabel", TT_SPACE, 0); + DBPutLabel(def, &def->cd_bbox, -1, "dummylabel", TT_SPACE, 0, 0); /* Undo */ UndoBackward(1); diff --git a/resis/ResPrint.c b/resis/ResPrint.c index 0983c0cf..9adb9c7a 100644 --- a/resis/ResPrint.c +++ b/resis/ResPrint.c @@ -494,13 +494,11 @@ ResPrintFHNodes(fp, nodelist, nodename, nidx, celldef) if (lab->lab_flags & PORT_DIR_MASK) if (!strcmp(lab->lab_text, nodeptr->rn_name)) { - if ((lab->lab_flags & PORT_NUM_MASK) != ResPortIndex) + if (lab->lab_port != ResPortIndex) { - lab->lab_flags &= (~(PORT_NUM_MASK)); - lab->lab_flags |= ResPortIndex; + lab->lab_port = ResPortIndex; TxPrintf("Port %s reassigned index %d\n", - lab->lab_text, - lab->lab_flags & PORT_NUM_MASK); + lab->lab_text, lab->lab_port); celldef->cd_flags |= (CDMODIFIED | CDGETNEWSTAMP); } ResPortIndex++; diff --git a/resis/ResRex.c b/resis/ResRex.c index b12263f8..f24a8dc6 100644 --- a/resis/ResRex.c +++ b/resis/ResRex.c @@ -1200,8 +1200,7 @@ ResCheckSimNodes(celldef, resisdata) fprintf(ResFHFile, "\n* Order of arguments to SPICE subcircuit call:\n"); for (lab = celldef->cd_labels; lab != NULL; lab = lab->lab_next) if (lab->lab_flags & PORT_DIR_MASK) - fprintf(ResFHFile, "* %d %s\n", lab->lab_flags & PORT_NUM_MASK, - lab->lab_text); + fprintf(ResFHFile, "* %d %s\n", lab->lab_port, lab->lab_text); fprintf(ResFHFile, "\n.end\n"); } diff --git a/select/selOps.c b/select/selOps.c index 1b7089ee..e85fccf7 100644 --- a/select/selOps.c +++ b/select/selOps.c @@ -941,7 +941,8 @@ selTransLabelFunc(label, cellUse, defTransform, transform) (void) DBPutFontLabel(Select2Def, &finalArea, label->lab_font, label->lab_size, finalRotate, &finalOffset, finalJust, - label->lab_text, label->lab_type, label->lab_flags); + label->lab_text, label->lab_type, label->lab_flags, + label->lab_port); return 0; } @@ -1255,7 +1256,8 @@ selArrayLFunc(label, use, transform, arrayInfo) DBEraseLabelsByContent(Select2Def, ¤t, -1, astr); DBPutFontLabel(Select2Def, ¤t, label->lab_font, label->lab_size, rootRotate, &rootOffset, - rootJust, astr, label->lab_type, label->lab_flags); + rootJust, astr, label->lab_type, + label->lab_flags, label->lab_port); current.r_ybot += arrayInfo->ar_ysep; current.r_ytop += arrayInfo->ar_ysep; xi += only1; diff --git a/select/selUnselect.c b/select/selUnselect.c index 823b0827..bcc4ceb1 100644 --- a/select/selUnselect.c +++ b/select/selUnselect.c @@ -217,7 +217,7 @@ selRemoveLabelPaintFunc(tile, label) (void) DBPutFontLabel(Select2Def, &label->lab_rect, label->lab_font, label->lab_size, label->lab_rotate, &label->lab_offset, label->lab_just, label->lab_text, label->lab_type, - label->lab_flags); + label->lab_flags, label->lab_port); return 1; }