Corrected the "lef write" routine to more correctly handle port

statements, with all "hard" connections being enumerated in the
same PORT entry, and "soft" connections (same label on unconnected
areas;  e.g., through substrate or resistor device) being
enumerated as separate PORT entries, per the LEF spec.  Also
corrected behavior with respect to the "lef write -toplayer"
option, which was treating each port label independently, and so
generating entries for lower layers of a port if there were ports
on those layers, in contravention to the "-toplayer" option.
Also:  Added the PINS section to the "def write" output;  this had
been left as a "to be completed" item but was never done in spite
of being easy to add.
This commit is contained in:
Tim Edwards
2021-11-12 11:34:16 -05:00
parent 3afc462cac
commit 898783467c
3 changed files with 163 additions and 3 deletions
+28 -1
View File
@@ -1602,10 +1602,37 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster)
lefWriteGeometry, (ClientData) &lc);
lc.lefMode = LEF_MODE_PORT;
}
/* Check if any other ports are already contained in this selection. */
/* If so, mark them as visited. Use lefFindTopmost(), which is just a */
/* routine that stops the search by returning 1 when something is found */
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)
{
TileTypeBitMask lmask;
TTMaskSetOnlyType(&lmask, tlab->lab_type);
pNum = DBPlane(tlab->lab_type);
if (DBSrPaintArea((Tile *)NULL, lc.lefYank->cd_planes[pNum],
&tlab->lab_rect, &lmask,
lefFindTopmost, (ClientData)NULL))
tlab->lab_flags |= PORT_VISITED;
/* For the "toplayer" option, ports on lower layers will not be */
/* in the yank buffer but will still be in the selection. */
else if (toplayer)
if (DBSrPaintArea((Tile *)NULL, SelectDef->cd_planes[pNum],
&tlab->lab_rect, &lmask,
lefFindTopmost, (ClientData)NULL))
tlab->lab_flags |= PORT_VISITED;
}
DBCellClearDef(lc.lefYank);
lab->lab_flags |= PORT_VISITED;
/* Check if any other ports belong to this pin */
/* Check if any other unvisited ports belong to this pin */
for (; lab != NULL; lab = lab->lab_next)
if (lab->lab_flags & PORT_DIR_MASK)