Moved the substrate plane/restore further out so that planes are
not restored until after all cells have been processed through extraction. Otherwise, top-down connections can end up with different generated names for the same node, resulting in a disconnect in the netlist.
This commit is contained in:
parent
fca21c8fc0
commit
f84de3676a
|
|
@ -32,6 +32,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header$";
|
||||||
#include "utils/malloc.h"
|
#include "utils/malloc.h"
|
||||||
#include "extflat/extflat.h"
|
#include "extflat/extflat.h"
|
||||||
#include "extflat/EFint.h"
|
#include "extflat/EFint.h"
|
||||||
|
#include "tiles/tile.h"
|
||||||
#include "extract/extract.h" /* for device class list */
|
#include "extract/extract.h" /* for device class list */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
#include "extflat/extflat.h"
|
#include "extflat/extflat.h"
|
||||||
#include "extflat/EFint.h"
|
#include "extflat/EFint.h"
|
||||||
|
#include "tiles/tile.h"
|
||||||
#include "extract/extract.h"
|
#include "extract/extract.h"
|
||||||
|
|
||||||
/* Root of the tree being flattened */
|
/* Root of the tree being flattened */
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ ClientData extUnInit = (ClientData) CLIENTDEFAULT;
|
||||||
int extOutputUsesFunc();
|
int extOutputUsesFunc();
|
||||||
FILE *extFileOpen();
|
FILE *extFileOpen();
|
||||||
|
|
||||||
void extCellFile();
|
Plane* extCellFile();
|
||||||
void extHeader();
|
void extHeader();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -83,7 +83,7 @@ void extHeader();
|
||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
Plane *
|
||||||
ExtCell(def, outName, doLength)
|
ExtCell(def, outName, doLength)
|
||||||
CellDef *def; /* Cell being extracted */
|
CellDef *def; /* Cell being extracted */
|
||||||
char *outName; /* Name of output file; if NULL, derive from def name */
|
char *outName; /* Name of output file; if NULL, derive from def name */
|
||||||
|
|
@ -95,6 +95,7 @@ ExtCell(def, outName, doLength)
|
||||||
{
|
{
|
||||||
char *filename;
|
char *filename;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
Plane *savePlane;
|
||||||
bool doLocal;
|
bool doLocal;
|
||||||
|
|
||||||
doLocal = (ExtOptions & EXT_DOLOCAL) ? TRUE : FALSE;
|
doLocal = (ExtOptions & EXT_DOLOCAL) ? TRUE : FALSE;
|
||||||
|
|
@ -115,7 +116,7 @@ ExtCell(def, outName, doLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
extNumFatal = extNumWarnings = 0;
|
extNumFatal = extNumWarnings = 0;
|
||||||
extCellFile(def, f, doLength);
|
savePlane = extCellFile(def, f, doLength);
|
||||||
(void) fclose(f);
|
(void) fclose(f);
|
||||||
|
|
||||||
if (extNumFatal > 0 || extNumWarnings > 0)
|
if (extNumFatal > 0 || extNumWarnings > 0)
|
||||||
|
|
@ -129,6 +130,7 @@ ExtCell(def, outName, doLength)
|
||||||
extNumWarnings, extNumWarnings != 1 ? "s" : "");
|
extNumWarnings, extNumWarnings != 1 ? "s" : "");
|
||||||
TxPrintf("\n");
|
TxPrintf("\n");
|
||||||
}
|
}
|
||||||
|
return savePlane;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -315,7 +317,7 @@ extPrepSubstrate(def)
|
||||||
/*
|
/*
|
||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* extRevertSubstrate ---
|
* ExtRevertSubstrate ---
|
||||||
*
|
*
|
||||||
* This routine swaps the substrate plane of CellDef "def" with the plane
|
* This routine swaps the substrate plane of CellDef "def" with the plane
|
||||||
* structure provided in the argument "savePlane". It should be called at
|
* structure provided in the argument "savePlane". It should be called at
|
||||||
|
|
@ -336,7 +338,7 @@ extPrepSubstrate(def)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
extRevertSubstrate(def, savePlane)
|
ExtRevertSubstrate(def, savePlane)
|
||||||
CellDef *def;
|
CellDef *def;
|
||||||
Plane *savePlane;
|
Plane *savePlane;
|
||||||
{
|
{
|
||||||
|
|
@ -371,7 +373,7 @@ extRevertSubstrate(def, savePlane)
|
||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
Plane *
|
||||||
extCellFile(def, f, doLength)
|
extCellFile(def, f, doLength)
|
||||||
CellDef *def; /* Def to be extracted */
|
CellDef *def; /* Def to be extracted */
|
||||||
FILE *f; /* Output to this file */
|
FILE *f; /* Output to this file */
|
||||||
|
|
@ -408,10 +410,8 @@ extCellFile(def, f, doLength)
|
||||||
if (!SigInterruptPending && doLength && (ExtOptions & EXT_DOLENGTH))
|
if (!SigInterruptPending && doLength && (ExtOptions & EXT_DOLENGTH))
|
||||||
extLength(extParentUse, f);
|
extLength(extParentUse, f);
|
||||||
|
|
||||||
/* Revert the substrate plane, if it was altered */
|
|
||||||
if (saveSub) extRevertSubstrate(def, saveSub);
|
|
||||||
|
|
||||||
UndoEnable();
|
UndoEnable();
|
||||||
|
return saveSub;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -616,6 +616,16 @@ closeit:
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Linked list structure to use to store the substrate plane from each */
|
||||||
|
/* extracted CellDef so that they can be returned to the original after */
|
||||||
|
/* extraction. */
|
||||||
|
|
||||||
|
struct saveList {
|
||||||
|
Plane *sl_plane;
|
||||||
|
CellDef *sl_def;
|
||||||
|
struct saveList *sl_next;
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
|
|
@ -645,7 +655,9 @@ extExtractStack(stack, doExtract, rootDef)
|
||||||
{
|
{
|
||||||
int fatal = 0, warnings = 0;
|
int fatal = 0, warnings = 0;
|
||||||
bool first = TRUE;
|
bool first = TRUE;
|
||||||
|
Plane *savePlane;
|
||||||
CellDef *def;
|
CellDef *def;
|
||||||
|
struct saveList *newsl, *sl = (struct saveList *)NULL;
|
||||||
|
|
||||||
while (def = (CellDef *) StackPop(stack))
|
while (def = (CellDef *) StackPop(stack))
|
||||||
{
|
{
|
||||||
|
|
@ -654,7 +666,16 @@ extExtractStack(stack, doExtract, rootDef)
|
||||||
{
|
{
|
||||||
if (doExtract)
|
if (doExtract)
|
||||||
{
|
{
|
||||||
ExtCell(def, (char *) NULL, (def == rootDef));
|
savePlane = ExtCell(def, (char *) NULL, (def == rootDef));
|
||||||
|
if (savePlane != NULL)
|
||||||
|
{
|
||||||
|
newsl = (struct saveList *)mallocMagic(sizeof(struct saveList));
|
||||||
|
newsl->sl_plane = savePlane;
|
||||||
|
newsl->sl_def = def;
|
||||||
|
newsl->sl_next = sl;
|
||||||
|
sl = newsl;
|
||||||
|
}
|
||||||
|
|
||||||
fatal += extNumFatal;
|
fatal += extNumFatal;
|
||||||
warnings += extNumWarnings;
|
warnings += extNumWarnings;
|
||||||
}
|
}
|
||||||
|
|
@ -668,6 +689,13 @@ extExtractStack(stack, doExtract, rootDef)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Replace any modified substrate planes */
|
||||||
|
for (; sl; sl = sl->sl_next)
|
||||||
|
{
|
||||||
|
ExtRevertSubstrate(sl->sl_def, sl->sl_plane);
|
||||||
|
freeMagic(sl);
|
||||||
|
}
|
||||||
|
|
||||||
if (!doExtract)
|
if (!doExtract)
|
||||||
{
|
{
|
||||||
TxPrintf("\n");
|
TxPrintf("\n");
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,8 @@ ExtractTest(w, cmd)
|
||||||
|
|
||||||
if (cmd->tx_argc == 1)
|
if (cmd->tx_argc == 1)
|
||||||
{
|
{
|
||||||
|
Plane *savePlane;
|
||||||
|
|
||||||
selectedCell = CmdGetSelectedCell((Transform *) NULL);
|
selectedCell = CmdGetSelectedCell((Transform *) NULL);
|
||||||
if (selectedCell == NULL)
|
if (selectedCell == NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -156,7 +158,8 @@ ExtractTest(w, cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
extDispInit(selectedCell->cu_def, w);
|
extDispInit(selectedCell->cu_def, w);
|
||||||
ExtCell(selectedCell->cu_def, selectedCell->cu_def->cd_name, FALSE);
|
savePlane = ExtCell(selectedCell->cu_def, selectedCell->cu_def->cd_name, FALSE);
|
||||||
|
ExtRevertSubstrate(selectedCell->cu_def, savePlane);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,8 @@ extern void ExtTechInit();
|
||||||
extern void ExtTechFinal();
|
extern void ExtTechFinal();
|
||||||
extern void ExtSetStyle();
|
extern void ExtSetStyle();
|
||||||
extern void ExtPrintStyle();
|
extern void ExtPrintStyle();
|
||||||
extern void ExtCell();
|
extern void ExtRevertSubstrate();
|
||||||
|
extern Plane *ExtCell();
|
||||||
|
|
||||||
extern int ExtGetGateTypesMask();
|
extern int ExtGetGateTypesMask();
|
||||||
extern int ExtGetDiffTypesMask();
|
extern int ExtGetDiffTypesMask();
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,7 @@ PlowRandomTest(def)
|
||||||
static char *dirnames[] = { "up", "down", "right", "left" };
|
static char *dirnames[] = { "up", "down", "right", "left" };
|
||||||
Rect plowRect;
|
Rect plowRect;
|
||||||
int dir, plowDir;
|
int dir, plowDir;
|
||||||
|
Plane *savePlane;
|
||||||
|
|
||||||
#ifdef notdef
|
#ifdef notdef
|
||||||
strcpy(goodName, tempgood);
|
strcpy(goodName, tempgood);
|
||||||
|
|
@ -101,7 +102,8 @@ PlowRandomTest(def)
|
||||||
sprintf(tempExt, "%s.ext", tempName);
|
sprintf(tempExt, "%s.ext", tempName);
|
||||||
|
|
||||||
/* Generate "good" extracted file */
|
/* Generate "good" extracted file */
|
||||||
ExtCell(def, goodName, FALSE);
|
savePlane = ExtCell(def, goodName, FALSE);
|
||||||
|
ExtRevertSubstrate(def, savePlane);
|
||||||
(void) sprintf(command, "sedplow %s", goodExt);
|
(void) sprintf(command, "sedplow %s", goodExt);
|
||||||
system(command);
|
system(command);
|
||||||
#endif /* notdef */
|
#endif /* notdef */
|
||||||
|
|
@ -136,7 +138,8 @@ PlowRandomTest(def)
|
||||||
|
|
||||||
#ifdef notdef
|
#ifdef notdef
|
||||||
/* Extract to the temp file */
|
/* Extract to the temp file */
|
||||||
ExtCell(def, tempName, FALSE);
|
savePlane = ExtCell(def, tempName, FALSE);
|
||||||
|
ExtRevertSubstrate(def, savePlane);
|
||||||
(void) sprintf(command, "sedplow %s", tempExt);
|
(void) sprintf(command, "sedplow %s", tempExt);
|
||||||
system(command);
|
system(command);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue