Added command option "-annotate" for "def read" that allows nets
to be annotated from a DEF file. This is particularly useful if "def read" has been used without the "-labels" option, and the labels are needed at some point.
This commit is contained in:
parent
e675decfc0
commit
cfb81101ec
|
|
@ -1573,11 +1573,12 @@ cmdIdFunc(selUse, use, transform, newId)
|
|||
}
|
||||
|
||||
TileType
|
||||
CmdFindNetProc(nodename, use, rect, warn_not_found)
|
||||
CmdFindNetProc(nodename, use, rect, warn_not_found, isvalid)
|
||||
char *nodename;
|
||||
CellUse *use;
|
||||
Rect *rect;
|
||||
bool warn_not_found;
|
||||
bool *isvalid;
|
||||
{
|
||||
char *s,*s2;
|
||||
SearchContext scx, scx2;
|
||||
|
|
@ -1722,10 +1723,12 @@ checklocal:
|
|||
if (!usefound)
|
||||
TxError("Couldn't find use referenced in hierarchical name\n");
|
||||
}
|
||||
if (isvalid) *isvalid = FALSE;
|
||||
return TT_SPACE;
|
||||
}
|
||||
}
|
||||
GeoTransRect(&trans, &localrect, rect);
|
||||
if (isvalid) *isvalid = TRUE;
|
||||
return ttype;
|
||||
}
|
||||
|
||||
|
|
@ -1770,7 +1773,7 @@ CmdGoto(w, cmd)
|
|||
Rect rect;
|
||||
CellUse *use;
|
||||
int locargc;
|
||||
bool nocomplain = FALSE;
|
||||
bool nocomplain = FALSE, isvalid;
|
||||
TileType ttype;
|
||||
|
||||
windCheckOnlyWindow(&w, DBWclientID);
|
||||
|
|
@ -1797,8 +1800,8 @@ CmdGoto(w, cmd)
|
|||
|
||||
/* CmdFindNetProc() does all the work */
|
||||
use = (CellUse *)w->w_surfaceID;
|
||||
ttype = CmdFindNetProc(nodename, use, &rect, !nocomplain);
|
||||
if (ttype == TT_SPACE) return;
|
||||
ttype = CmdFindNetProc(nodename, use, &rect, !nocomplain, &isvalid);
|
||||
if (isvalid == FALSE) return;
|
||||
|
||||
ToolMoveBox(TOOL_BL, &rect.r_ll, FALSE, use->cu_def);
|
||||
ToolMoveCorner(TOOL_TR, &rect.r_ur, FALSE, use->cu_def);
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ enum def_netspecial_shape_keys {
|
|||
DEF_SPECNET_SHAPE_DRCFILL};
|
||||
|
||||
char *
|
||||
DefAddRoutes(rootDef, f, oscale, special, netname, ruleset, defLayerMap)
|
||||
DefAddRoutes(rootDef, f, oscale, special, netname, ruleset, defLayerMap, annotate)
|
||||
CellDef *rootDef; /* Cell to paint */
|
||||
FILE *f; /* Input file */
|
||||
float oscale; /* Scale factor between LEF and magic units */
|
||||
|
|
@ -82,6 +82,7 @@ DefAddRoutes(rootDef, f, oscale, special, netname, ruleset, defLayerMap)
|
|||
char *netname; /* Name of the net, if net is to be labeled */
|
||||
LefRules *ruleset; /* Non-default rule, or NULL */
|
||||
LefMapping *defLayerMap; /* magic-to-lef layer mapping array */
|
||||
bool annotate; /* If TRUE, do not generate any geometry */
|
||||
{
|
||||
char *token;
|
||||
LinkedRect *routeList, *newRoute = NULL, *routeTop = NULL;
|
||||
|
|
@ -674,7 +675,8 @@ endCoord:
|
|||
while (routeTop != NULL)
|
||||
{
|
||||
/* paint */
|
||||
DBPaint(rootDef, &routeTop->r_r, routeTop->r_type);
|
||||
if (annotate == FALSE)
|
||||
DBPaint(rootDef, &routeTop->r_r, routeTop->r_type);
|
||||
|
||||
/* label */
|
||||
if (labeled == FALSE)
|
||||
|
|
@ -927,13 +929,14 @@ enum def_netprop_keys {
|
|||
};
|
||||
|
||||
void
|
||||
DefReadNets(f, rootDef, sname, oscale, special, dolabels, total)
|
||||
DefReadNets(f, rootDef, sname, oscale, special, dolabels, annotate, total)
|
||||
FILE *f;
|
||||
CellDef *rootDef;
|
||||
char *sname;
|
||||
float oscale;
|
||||
bool special; /* True if this section is SPECIALNETS */
|
||||
bool dolabels; /* If true, create a label for each net */
|
||||
bool annotate; /* If true, create labels, not geometry */
|
||||
int total;
|
||||
{
|
||||
char *token;
|
||||
|
|
@ -1027,7 +1030,7 @@ DefReadNets(f, rootDef, sname, oscale, special, dolabels, total)
|
|||
case DEF_NETPROP_COVER:
|
||||
case DEF_NETPROP_NOSHIELD:
|
||||
token = DefAddRoutes(rootDef, f, oscale, special,
|
||||
netname, ruleset, defLayerMap);
|
||||
netname, ruleset, defLayerMap, annotate);
|
||||
ruleset = NULL;
|
||||
break;
|
||||
|
||||
|
|
@ -2054,7 +2057,7 @@ DefReadComponents(f, rootDef, sname, oscale, total)
|
|||
/* Don't process properties for cells we could not find */
|
||||
|
||||
if ((defMacro == NULL) || ((defUse = DBCellNewUse(defMacro, usename))
|
||||
== NULL))
|
||||
== NULL))
|
||||
{
|
||||
if (defMacro != NULL) LefEndStatement(f);
|
||||
break;
|
||||
|
|
@ -2162,9 +2165,10 @@ enum def_sections {DEF_VERSION = 0, DEF_NAMESCASESENSITIVE,
|
|||
DEF_NONDEFAULTRULES, DEF_END};
|
||||
|
||||
void
|
||||
DefRead(inName, dolabels)
|
||||
DefRead(inName, dolabels, annotate)
|
||||
char *inName;
|
||||
bool dolabels;
|
||||
bool annotate;
|
||||
{
|
||||
CellDef *rootDef;
|
||||
FILE *f;
|
||||
|
|
@ -2206,6 +2210,9 @@ DefRead(inName, dolabels)
|
|||
NULL
|
||||
};
|
||||
|
||||
/* "annotate" implies "dolabels" whether set or not */
|
||||
if (annotate) dolabels = TRUE;
|
||||
|
||||
/* Make sure we have a valid LefInfo hash table, even if it's empty */
|
||||
if (LefInfo.ht_table == (HashEntry **) NULL)
|
||||
LefTechInit();
|
||||
|
|
@ -2321,7 +2328,11 @@ DefRead(inName, dolabels)
|
|||
token = LefNextToken(f, TRUE);
|
||||
if (sscanf(token, "%d", &total) != 1) total = 0;
|
||||
LefEndStatement(f);
|
||||
DefReadComponents(f, rootDef, sections[DEF_COMPONENTS], oscale, total);
|
||||
if (annotate)
|
||||
LefSkipSection(f, sections[DEF_COMPONENTS]);
|
||||
else
|
||||
DefReadComponents(f, rootDef, sections[DEF_COMPONENTS],
|
||||
oscale, total);
|
||||
break;
|
||||
case DEF_VIAS:
|
||||
token = LefNextToken(f, TRUE);
|
||||
|
|
@ -2333,7 +2344,10 @@ DefRead(inName, dolabels)
|
|||
token = LefNextToken(f, TRUE);
|
||||
if (sscanf(token, "%d", &total) != 1) total = 0;
|
||||
LefEndStatement(f);
|
||||
DefReadPins(f, rootDef, sections[DEF_PINS], oscale, total);
|
||||
if (annotate)
|
||||
LefSkipSection(f, sections[DEF_PINS]);
|
||||
else
|
||||
DefReadPins(f, rootDef, sections[DEF_PINS], oscale, total);
|
||||
break;
|
||||
case DEF_PINPROPERTIES:
|
||||
LefSkipSection(f, sections[DEF_PINPROPERTIES]);
|
||||
|
|
@ -2343,14 +2357,14 @@ DefRead(inName, dolabels)
|
|||
if (sscanf(token, "%d", &total) != 1) total = 0;
|
||||
LefEndStatement(f);
|
||||
DefReadNets(f, rootDef, sections[DEF_SPECIALNETS], oscale, TRUE,
|
||||
dolabels, total);
|
||||
dolabels, annotate, total);
|
||||
break;
|
||||
case DEF_NETS:
|
||||
token = LefNextToken(f, TRUE);
|
||||
if (sscanf(token, "%d", &total) != 1) total = 0;
|
||||
LefEndStatement(f);
|
||||
DefReadNets(f, rootDef, sections[DEF_NETS], oscale, FALSE,
|
||||
dolabels, total);
|
||||
dolabels, annotate, total);
|
||||
break;
|
||||
case DEF_NONDEFAULTRULES:
|
||||
token = LefNextToken(f, TRUE);
|
||||
|
|
@ -2378,8 +2392,11 @@ DefRead(inName, dolabels)
|
|||
token = LefNextToken(f, TRUE);
|
||||
if (sscanf(token, "%d", &total) != 1) total = 0;
|
||||
LefEndStatement(f);
|
||||
DefReadBlockages(f, rootDef, sections[DEF_BLOCKAGES],
|
||||
oscale, total);
|
||||
if (annotate)
|
||||
LefSkipSection(f, sections[DEF_BLOCKAGES]);
|
||||
else
|
||||
DefReadBlockages(f, rootDef, sections[DEF_BLOCKAGES],
|
||||
oscale, total);
|
||||
break;
|
||||
case DEF_END:
|
||||
if (!LefParseEndStatement(token, "DESIGN"))
|
||||
|
|
|
|||
20
lef/lefCmd.c
20
lef/lefCmd.c
|
|
@ -119,6 +119,10 @@ CmdLef(w, cmd)
|
|||
* center of the first rectangle
|
||||
* found on that net.
|
||||
*/
|
||||
bool defAnnotate = FALSE; /* Indicates that no geometry should be
|
||||
* created from any DEF files, which
|
||||
* will be used for label annotation only.
|
||||
*/
|
||||
static char *cmdLefOption[] =
|
||||
{
|
||||
"read [filename] read a LEF file filename[.lef]\n"
|
||||
|
|
@ -139,9 +143,10 @@ CmdLef(w, cmd)
|
|||
|
||||
static char *cmdDefOption[] =
|
||||
{
|
||||
"read [filename] read a DEF file filename[.def]",
|
||||
"write [cell] [-allspecial] write DEF for current or indicated cell\n"
|
||||
"write -labels label every net in NETS with the net name",
|
||||
"read [filename] read a DEF file filename[.def]\n"
|
||||
" read [filename] -labels read a DEF file with net labeling\n"
|
||||
" read [filename] -annotate read a DEF file for net annotation only",
|
||||
"write [cell] [-allspecial] write DEF for current or indicated cell",
|
||||
"writeall (use \"flatten -nosubckt\" + \"def"
|
||||
" write\" instead)",
|
||||
"help print this help information",
|
||||
|
|
@ -198,7 +203,12 @@ CmdLef(w, cmd)
|
|||
if (!strncmp(cmd->tx_argv[i], "-import", 7))
|
||||
lefImport = TRUE;
|
||||
else if (!strncmp(cmd->tx_argv[i], "-anno", 5))
|
||||
lefAnnotate = TRUE;
|
||||
{
|
||||
if (is_lef)
|
||||
lefAnnotate = TRUE;
|
||||
else
|
||||
defAnnotate = TRUE;
|
||||
}
|
||||
else if (!strncmp(cmd->tx_argv[i], "-label", 6))
|
||||
{
|
||||
if (is_lef)
|
||||
|
|
@ -216,7 +226,7 @@ CmdLef(w, cmd)
|
|||
if (is_lef)
|
||||
LefRead(namep, lefImport, lefAnnotate, lefDateStamp);
|
||||
else
|
||||
DefRead(namep, defLabelNets);
|
||||
DefRead(namep, defLabelNets, defAnnotate);
|
||||
break;
|
||||
case LEF_WRITEALL:
|
||||
if (!is_lef)
|
||||
|
|
|
|||
Loading…
Reference in New Issue