mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-29 01:24:51 +02:00
Cleaned up an inconsistency with GDS read-in that generates
informational output that references a (non-existing) CIF file.
This commit is contained in:
+49
-20
@@ -557,7 +557,8 @@ cifCopyPaintFunc(tile, cifCopyRec)
|
||||
*/
|
||||
|
||||
int
|
||||
CIFPaintCurrent()
|
||||
CIFPaintCurrent(filetype)
|
||||
bool filetype;
|
||||
{
|
||||
extern int cifMakeBoundaryFunc(); /* Forward declaration. */
|
||||
extern int cifPaintCurrentFunc(); /* Forward declaration. */
|
||||
@@ -658,7 +659,7 @@ CIFPaintCurrent()
|
||||
&DBAllButSpaceBits, cifCheckPaintFunc,
|
||||
(ClientData)NULL) == 1))
|
||||
DBSrPaintArea((Tile *) NULL, plane, &TiPlaneRect,
|
||||
&CIFSolidBits, cifMakeBoundaryFunc, (ClientData)NULL);
|
||||
&CIFSolidBits, cifMakeBoundaryFunc, (ClientData)filetype);
|
||||
}
|
||||
|
||||
/* Swap planes */
|
||||
@@ -692,7 +693,7 @@ CIFPaintCurrent()
|
||||
int
|
||||
cifMakeBoundaryFunc(tile, clientdata)
|
||||
Tile *tile; /* Tile of CIF information. */
|
||||
ClientData clientdata; /* Not used */
|
||||
ClientData clientdata; /* Pass the file type (CIF or CALMA) */
|
||||
{
|
||||
/* It is assumed that there is one rectangle for the boundary. */
|
||||
/* If there are multiple rectangles defined with the boundary */
|
||||
@@ -701,6 +702,7 @@ cifMakeBoundaryFunc(tile, clientdata)
|
||||
Rect area;
|
||||
char propertyvalue[128], *storedvalue;
|
||||
int savescale;
|
||||
bool filetype = (bool)clientdata;
|
||||
|
||||
TiToRect(tile, &area);
|
||||
area.r_xtop = CIFScaleCoord(area.r_xtop, COORD_EXACT);
|
||||
@@ -727,8 +729,35 @@ cifMakeBoundaryFunc(tile, clientdata)
|
||||
}
|
||||
|
||||
if (cifReadCellDef->cd_flags & CDFIXEDBBOX)
|
||||
CIFReadError("Warning: Cell %s boundary was redefined.\n",
|
||||
cifReadCellDef->cd_name);
|
||||
{
|
||||
char *propvalue;
|
||||
bool found;
|
||||
|
||||
/* Only flag a warning if the redefined boundary was */
|
||||
/* different from the original. */
|
||||
|
||||
propvalue = (char *)DBPropGet(cifReadCellDef, "FIXED_BBOX", &found);
|
||||
if (found)
|
||||
{
|
||||
Rect bbox;
|
||||
if (sscanf(propvalue, "%d %d %d %d", &bbox.r_xbot, &bbox.r_ybot,
|
||||
&bbox.r_xtop, &bbox.r_ytop) == 4)
|
||||
{
|
||||
if ((bbox.r_xbot != area.r_xbot) ||
|
||||
(bbox.r_ybot != area.r_ybot) ||
|
||||
(bbox.r_xtop != area.r_xtop) ||
|
||||
(bbox.r_ytop != area.r_ytop))
|
||||
{
|
||||
if (filetype == FILE_CIF)
|
||||
CIFReadError("Warning: Cell %s boundary was redefined.\n",
|
||||
cifReadCellDef->cd_name);
|
||||
else
|
||||
CalmaError("Warning: Cell %s boundary was redefined.\n",
|
||||
cifReadCellDef->cd_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(propertyvalue, "%d %d %d %d",
|
||||
area.r_xbot, area.r_ybot, area.r_xtop, area.r_ytop);
|
||||
@@ -841,7 +870,7 @@ CIFParseFinish()
|
||||
* layer info.
|
||||
*/
|
||||
|
||||
CIFPaintCurrent();
|
||||
CIFPaintCurrent(FILE_CIF);
|
||||
|
||||
DBAdjustLabels(cifReadCellDef, &TiPlaneRect);
|
||||
DBReComputeBbox(cifReadCellDef);
|
||||
@@ -1389,8 +1418,8 @@ CIFParseUser()
|
||||
*/
|
||||
|
||||
void
|
||||
CIFReadCellCleanup(type)
|
||||
int type; // 0 = CIF, 1 = GDS, because routine is used by both
|
||||
CIFReadCellCleanup(filetype)
|
||||
bool filetype;
|
||||
{
|
||||
HashEntry *h;
|
||||
HashSearch hs;
|
||||
@@ -1400,10 +1429,10 @@ CIFReadCellCleanup(type)
|
||||
|
||||
if (cifSubcellBeingRead)
|
||||
{
|
||||
if (type == 0)
|
||||
if (filetype == FILE_CIF)
|
||||
CIFReadError("CIF ended partway through a symbol definition.\n");
|
||||
else
|
||||
calmaReadError("GDS ended partway through a symbol definition.\n");
|
||||
CalmaReadError("GDS ended partway through a symbol definition.\n");
|
||||
(void) CIFParseFinish();
|
||||
}
|
||||
|
||||
@@ -1416,24 +1445,24 @@ CIFReadCellCleanup(type)
|
||||
def = (CellDef *) HashGetValue(h);
|
||||
if (def == NULL)
|
||||
{
|
||||
if (type == 0)
|
||||
if (filetype == FILE_CIF)
|
||||
CIFReadError("cell table has NULL entry (Magic error).\n");
|
||||
else
|
||||
calmaReadError("cell table has NULL entry (Magic error).\n");
|
||||
CalmaReadError("cell table has NULL entry (Magic error).\n");
|
||||
continue;
|
||||
}
|
||||
flags = def->cd_flags;
|
||||
if (!(flags & CDAVAILABLE))
|
||||
{
|
||||
if (type == 0)
|
||||
if (filetype == FILE_CIF)
|
||||
CIFReadError("cell %s was used but not defined.\n", def->cd_name);
|
||||
else
|
||||
calmaReadError("cell %s was used but not defined.\n", def->cd_name);
|
||||
CalmaReadError("cell %s was used but not defined.\n", def->cd_name);
|
||||
}
|
||||
def->cd_flags &= ~CDPROCESSEDGDS;
|
||||
|
||||
if ((type == 0 && CIFNoDRCCheck == FALSE) ||
|
||||
(type == 1 && CalmaNoDRCCheck == FALSE))
|
||||
if ((filetype == FILE_CIF && CIFNoDRCCheck == FALSE) ||
|
||||
(filetype == 1 && CalmaNoDRCCheck == FALSE))
|
||||
DRCCheckThis(def, TT_CHECKPAINT, &def->cd_bbox);
|
||||
DBWAreaChanged(def, &def->cd_bbox, DBW_ALLWINDOWS, &DBAllButSpaceBits);
|
||||
DBCellSetModified(def, TRUE);
|
||||
@@ -1441,7 +1470,7 @@ CIFReadCellCleanup(type)
|
||||
|
||||
/* Do geometrical processing on the top-level cell. */
|
||||
|
||||
CIFPaintCurrent();
|
||||
CIFPaintCurrent(FILE_CIF);
|
||||
DBAdjustLabels(EditCellUse->cu_def, &TiPlaneRect);
|
||||
DBReComputeBbox(EditCellUse->cu_def);
|
||||
DBWAreaChanged(EditCellUse->cu_def, &EditCellUse->cu_def->cd_bbox,
|
||||
@@ -1485,7 +1514,7 @@ CIFReadCellCleanup(type)
|
||||
if (!(def->cd_flags & CDFLATTENED))
|
||||
CIFReadError("%s read error: Unresolved geometry in cell"
|
||||
" %s maps to no magic layers\n",
|
||||
(type == 0) ? "CIF" : "GDS", def->cd_name);
|
||||
(filetype == FILE_CIF) ? "CIF" : "GDS", def->cd_name);
|
||||
|
||||
#if 0
|
||||
/* Remove the cell if it has no parents, no children, and no geometry */
|
||||
@@ -1498,11 +1527,11 @@ CIFReadCellCleanup(type)
|
||||
if (DBCellDeleteDef(def) == FALSE)
|
||||
{
|
||||
CIFReadError("%s read error: Unable to delete cell %s\n",
|
||||
(type == 0) ? "CIF" : "GDS", savename);
|
||||
(filetype == FILE_CIF) ? "CIF" : "GDS", savename);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (type == 0)
|
||||
if (filetype == FILE_CIF)
|
||||
TxPrintf("CIF read: Removed flattened cell %s\n", savename);
|
||||
else
|
||||
TxPrintf("GDS read: Removed flattened cell %s\n", savename);
|
||||
|
||||
+1
-1
@@ -1660,6 +1660,6 @@ CIFReadFile(file)
|
||||
CIFReadError("no \"End\" statement.\n");
|
||||
|
||||
done:
|
||||
CIFReadCellCleanup(0);
|
||||
CIFReadCellCleanup(FILE_CIF);
|
||||
UndoEnable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user