Modified "lef writeall" to only generate output for the set of subcells
that are direct children of the top level cell. The "-all" option was added to enable the previous behavior, although its usefulness is doubtful.
This commit is contained in:
parent
d0f3aaeb59
commit
f15ea2a135
|
|
@ -1024,7 +1024,7 @@ calmaOutFunc(def, f, cliprect)
|
||||||
((lab->lab_flags & PORT_NUM_MASK) == i))
|
((lab->lab_flags & PORT_NUM_MASK) == i))
|
||||||
{
|
{
|
||||||
calmaWriteLabelFunc(lab, type, f);
|
calmaWriteLabelFunc(lab, type, f);
|
||||||
break;
|
/* break; */ /* Do not limit to unique labels! */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
lef/lefCmd.c
12
lef/lefCmd.c
|
|
@ -87,6 +87,11 @@ CmdLef(w, cmd)
|
||||||
* the macro other than pin area
|
* the macro other than pin area
|
||||||
* immediately surrounding labels.
|
* immediately surrounding labels.
|
||||||
*/
|
*/
|
||||||
|
bool recurse = FALSE; /* If TRUE, recurse on all subcells
|
||||||
|
* during "writeall". By default,
|
||||||
|
* only the immediate children of the
|
||||||
|
* top level cell are output.
|
||||||
|
*/
|
||||||
|
|
||||||
static char *cmdLefOption[] =
|
static char *cmdLefOption[] =
|
||||||
{
|
{
|
||||||
|
|
@ -95,7 +100,8 @@ CmdLef(w, cmd)
|
||||||
"write [filename] [-tech] write LEF for current cell\n"
|
"write [filename] [-tech] write LEF for current cell\n"
|
||||||
" write [filename] -hide hide all details other than ports",
|
" write [filename] -hide hide all details other than ports",
|
||||||
"writeall write all cells including the top-level cell\n"
|
"writeall write all cells including the top-level cell\n"
|
||||||
" writeall -notop write all subcells of the top-level cell",
|
" writeall -notop write all children of the top-level cell\n"
|
||||||
|
" writeall -all recurse on all subcells of the top-level cell",
|
||||||
"help print this help information",
|
"help print this help information",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
@ -184,11 +190,13 @@ CmdLef(w, cmd)
|
||||||
lefTopCell = FALSE;
|
lefTopCell = FALSE;
|
||||||
else if (!strncmp(cmd->tx_argv[i], "-tech", 5))
|
else if (!strncmp(cmd->tx_argv[i], "-tech", 5))
|
||||||
lefTech = TRUE;
|
lefTech = TRUE;
|
||||||
|
else if (!strncmp(cmd->tx_argv[i], "-all", 4))
|
||||||
|
recurse = TRUE;
|
||||||
else goto wrongNumArgs;
|
else goto wrongNumArgs;
|
||||||
}
|
}
|
||||||
else goto wrongNumArgs;
|
else goto wrongNumArgs;
|
||||||
}
|
}
|
||||||
LefWriteAll(selectedUse, lefTopCell, lefTech);
|
LefWriteAll(selectedUse, lefTopCell, lefTech, recurse);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LEF_WRITE:
|
case LEF_WRITE:
|
||||||
|
|
|
||||||
|
|
@ -1133,10 +1133,11 @@ lefWriteMacro(def, f, scale, hide)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
LefWriteAll(rootUse, writeTopCell, lefTech)
|
LefWriteAll(rootUse, writeTopCell, lefTech, recurse)
|
||||||
CellUse *rootUse;
|
CellUse *rootUse;
|
||||||
bool writeTopCell;
|
bool writeTopCell;
|
||||||
bool lefTech;
|
bool lefTech;
|
||||||
|
bool recurse;
|
||||||
{
|
{
|
||||||
CellDef *def, *rootdef;
|
CellDef *def, *rootdef;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
@ -1155,8 +1156,12 @@ LefWriteAll(rootUse, writeTopCell, lefTech)
|
||||||
(void) DBCellSrDefs(0, lefDefInitFunc, (ClientData) 0);
|
(void) DBCellSrDefs(0, lefDefInitFunc, (ClientData) 0);
|
||||||
|
|
||||||
/* Recursively visit all defs in the tree and push on stack */
|
/* Recursively visit all defs in the tree and push on stack */
|
||||||
|
/* If "recurse" is false, then only the children of the root use */
|
||||||
|
/* are pushed (this is the default behavior). */
|
||||||
lefDefStack = StackNew(100);
|
lefDefStack = StackNew(100);
|
||||||
(void) lefDefPushFunc(rootUse);
|
if (writeTopCell)
|
||||||
|
lefDefPushFunc(rootUse, (bool *)NULL);
|
||||||
|
DBCellEnum(rootUse->cu_def, lefDefPushFunc, (ClientData)&recurse);
|
||||||
|
|
||||||
/* Open the file for output */
|
/* Open the file for output */
|
||||||
|
|
||||||
|
|
@ -1185,8 +1190,7 @@ LefWriteAll(rootUse, writeTopCell, lefTech)
|
||||||
{
|
{
|
||||||
def->cd_client = (ClientData) 0;
|
def->cd_client = (ClientData) 0;
|
||||||
if (!SigInterruptPending)
|
if (!SigInterruptPending)
|
||||||
if ((writeTopCell == TRUE) || (def != rootdef))
|
lefWriteMacro(def, f, scale);
|
||||||
lefWriteMacro(def, f, scale);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End the LEF file */
|
/* End the LEF file */
|
||||||
|
|
@ -1217,8 +1221,9 @@ lefDefInitFunc(def)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
lefDefPushFunc(use)
|
lefDefPushFunc(use, recurse)
|
||||||
CellUse *use;
|
CellUse *use;
|
||||||
|
bool *recurse;
|
||||||
{
|
{
|
||||||
CellDef *def = use->cu_def;
|
CellDef *def = use->cu_def;
|
||||||
|
|
||||||
|
|
@ -1227,7 +1232,8 @@ lefDefPushFunc(use)
|
||||||
|
|
||||||
def->cd_client = (ClientData) 1;
|
def->cd_client = (ClientData) 1;
|
||||||
StackPush((ClientData) def, lefDefStack);
|
StackPush((ClientData) def, lefDefStack);
|
||||||
(void) DBCellEnum(def, lefDefPushFunc, (ClientData) 0);
|
if (recurse && (*recurse))
|
||||||
|
(void) DBCellEnum(def, lefDefPushFunc, (ClientData)recurse);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue