From c12a50b64b8ac88257cbf2cacb62ef9d8e6d42f4 Mon Sep 17 00:00:00 2001
From: Jean-Paul Chaput
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
This appendix contains examples of the Cadence® Design Exchange Format (DEF) reader and writer.
+
+
+
+ ![]() |
+ DEF Reader Example | +
+
+
+ ![]() |
+ DEF Writer Example | +
+ #ifndef WIN32 +
+ + + + + + + + + ++ FILE* fout; +
++ int userData; +
++ int numObjs; +
++ int isSumSet; // to keep track if within SUM +
++ int isProp = 0; // for PROPERTYDEFINITIONS +
++ int begOperand; // to keep track for constraint, to print - as the 1st char +
+ ++ static int setSNetWireCbk = 0; +
+ + + ++ void myLogFunction(const char* errMsg){ +
++ fprintf(fout, "ERROR: found error: %s\n", errMsg); +
++ } +
+ ++ void myWarningLogFunction(const char* errMsg){ +
++ fprintf(fout, "WARNING: found error: %s\n", errMsg); +
++ } +
+ + ++ fprintf(fout, "ERROR: returned user data is not correct!\n"); +
++ } +
+ ++ void checkType(defrCallbackType_e c) { +
++ if (c >= 0 && c <= defrDesignEndCbkType) { +
++ // OK +
++ } else { +
++ fprintf(fout, "ERROR: callback type is out of bounds!\n"); +
++ } +
++ } +
+ + ++ int done(defrCallbackType_e c, void* dummy, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "END DESIGN\n"); +
++ return 0; +
++ } +
+ ++ int endfunc(defrCallbackType_e c, void* dummy, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ return 0; +
++ } +
+ + ++ char* orientStr(int orient) { +
+ ++ case 0: return ((char*)"N"); +
++ case 1: return ((char*)"W"); +
++ case 2: return ((char*)"S"); +
++ case 3: return ((char*)"E"); +
++ case 4: return ((char*)"FN"); +
++ case 5: return ((char*)"FW"); +
++ case 6: return ((char*)"FS"); +
++ case 7: return ((char*)"FE"); +
++ }; +
+ ++ } +
+ + ++ int compf(defrCallbackType_e c, defiComponent* co, defiUserData ud) { +
++ int i; +
+ ++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "- %s %s ", co->defiComponent::id(), +
++ co->defiComponent::name()); +
++ if (co->defiComponent::hasNets()) { +
++ for (i = 0; i < co->defiComponent::numNets(); i++) +
++ fprintf(fout, "%s ", co->defiComponent::net(i)); +
++ } +
++ if (co->defiComponent::isFixed()) +
++ fprintf(fout, "+ FIXED %d %d %s ", +
++ co->defiComponent::placementX(), +
++ co->defiComponent::placementY(), +
++ //orientStr(co->defiComponent::placementOrient())); +
++ co->defiComponent::placementOrientStr()); +
++ if (co->defiComponent::isCover()) +
++ fprintf(fout, "+ COVER %d %d %s ", +
++ co->defiComponent::placementX(), +
++ co->defiComponent::placementY(), +
++ orientStr(co->defiComponent::placementOrient())); +
++ if (co->defiComponent::isPlaced()) +
++ fprintf(fout,"+ PLACED %d %d %s ", +
++ co->defiComponent::placementX(), +
++ co->defiComponent::placementY(), +
++ orientStr(co->defiComponent::placementOrient())); +
++ if (co->defiComponent::isUnplaced()) { +
++ fprintf(fout,"+ UNPLACED "); +
++ if ((co->defiComponent::placementX() != -1) || +
++ (co->defiComponent::placementY() != -1)) +
+ ++ co->defiComponent::placementX(), +
++ co->defiComponent::placementY(), +
++ orientStr(co->defiComponent::placementOrient())); +
++ } +
++ if (co->defiComponent::hasSource()) +
++ fprintf(fout, "+ SOURCE %s ", co->defiComponent::source()); +
++ if (co->defiComponent::hasGenerate()) { +
++ fprintf(fout, "+ GENERATE %s ", co->defiComponent::generateName()); +
++ if (co->defiComponent::macroName() && +
++ *(co->defiComponent::macroName())) +
++ fprintf(fout, "%s ", co->defiComponent::macroName()); +
++ } +
++ if (co->defiComponent::hasWeight()) +
++ fprintf(fout, "+ WEIGHT %d ", co->defiComponent::weight()); +
++ if (co->defiComponent::hasEEQ()) +
++ fprintf(fout, "+ EEQMASTER %s ", co->defiComponent::EEQ()); +
++ if (co->defiComponent::hasRegionName()) +
++ fprintf(fout, "+ REGION %s ", co->defiComponent::regionName()); +
++ if (co->defiComponent::hasRegionBounds()) { +
+ ++ int size; +
++ co->defiComponent::regionBounds(&size, &xl, &yl, &xh, &yh); +
++ for (i = 0; i < size; i++) { +
++ fprintf(fout, "+ REGION %d %d %d %d \n", +
++ xl[i], yl[i], xh[i], yh[i]); +
++ } +
++ } +
++ if (co->defiComponent::hasHalo()) { +
++ int left, bottom, right, top; +
++ (void) co->defiComponent::haloEdges(&left, &bottom, &right, &top); +
+ ++ if (co->defiComponent::hasHaloSoft()) +
+ ++ fprintf(fout, "%d %d %d %d\n", left, bottom, right, top); +
++ } +
++ if (co->defiComponent::hasRouteHalo()) { +
++ fprintf(fout, "+ ROUTEHALO %d %s %s\n", co->defiComponent::haloDist(), +
++ co->defiComponent::minLayer(), co->defiComponent::maxLayer()); +
++ } +
++ if (co->defiComponent::hasForeignName()) { +
++ fprintf(fout, "+ FOREIGN %s %d %d %s %d ", +
++ co->defiComponent::foreignName(), co->defiComponent::foreignX(), +
++ co->defiComponent::foreignY(), co->defiComponent::foreignOri(), +
++ co->defiComponent::foreignOrient()); +
++ } +
++ if (co->defiComponent::numProps()) { +
++ for (i = 0; i < co->defiComponent::numProps(); i++) { +
++ fprintf(fout, "+ PROPERTY %s %s ", co->defiComponent::propName(i), +
++ co->defiComponent::propValue(i)); +
++ switch (co->defiComponent::propType(i)) { +
++ case 'R': fprintf(fout, "REAL "); +
++ break; +
++ case 'I': fprintf(fout, "INTEGER "); +
++ break; +
++ case 'S': fprintf(fout, "STRING "); +
++ break; +
++ case 'Q': fprintf(fout, "QUOTESTRING "); +
++ break; +
++ case 'N': fprintf(fout, "NUMBER "); +
++ break; +
++ } +
++ } +
++ } +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END COMPONENTS\n"); +
++ return 0; +
++ } +
+ + ++ int netpath(defrCallbackType_e c, defiNet* ppath, defiUserData ud) { +
+ + ++ fprintf (fout, "Callback of partial path for net\n"); +
+ ++ return 0; +
++ } +
+ + ++ int netNamef(defrCallbackType_e c, const char* netName, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "- %s ", netName); +
++ return 0; +
++ } +
+ ++ int subnetNamef(defrCallbackType_e c, const char* subnetName, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
+ ++ fprintf(fout, " + SUBNET CBK %s ", subnetName); +
++ return 0; +
++ } +
+ ++ int nondefRulef(defrCallbackType_e c, const char* ruleName, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
+ ++ fprintf(fout, " + NONDEFAULTRULE CBK %s ", ruleName); +
++ return 0; +
++ } +
+ ++ int netf(defrCallbackType_e c, defiNet* net, defiUserData ud) { +
++ // For net and special net. +
++ int i, j, k, x, y, z, count, newLayer; +
++ defiPath* p; +
++ defiSubnet *s; +
++ int path; +
++ defiVpin *vpin; +
+ ++ defiWire *wire; +
+ ++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
+ ++ fprintf(fout, "BOGUS NET TYPE "); +
++ if (net->defiNet::pinIsMustJoin(0)) +
++ fprintf(fout, "- MUSTJOIN "); +
+ + ++ for (i = 0; i < net->defiNet::numConnections(); i++) { +
++ // set the limit of only 5 items per line +
++ count++; +
+ + ++ count = 0; +
++ } +
++ fprintf(fout, "( %s %s ) ", net->defiNet::instance(i), +
+ ++ if (net->defiNet::pinIsSynthesized(i)) +
++ fprintf(fout, "+ SYNTHESIZED "); +
++ } +
+ ++ if (net->hasNonDefaultRule()) +
++ fprintf(fout, "+ NONDEFAULTRULE %s\n", net->nonDefaultRule()); +
+ ++ for (i = 0; i < net->defiNet::numVpins(); i++) { +
++ vpin = net->defiNet::vpin(i); +
++ fprintf(fout, " + %s", vpin->name()); +
+ ++ fprintf(fout, " %s", vpin->layer()); +
++ fprintf(fout, " %d %d %d %d", vpin->xl(), vpin->yl(), vpin->xh(), +
++ vpin->yh()); +
++ if (vpin->status() != ' ') { +
++ fprintf(fout, " %c", vpin->status()); +
++ fprintf(fout, " %d %d", vpin->xLoc(), vpin->yLoc()); +
+ ++ fprintf(fout, " %s", orientStr(vpin->orient())); +
++ } +
+ ++ } +
+ ++ // regularWiring +
++ if (net->defiNet::numWires()) { +
++ for (i = 0; i < net->defiNet::numWires(); i++) { +
++ newLayer = 0; +
++ wire = net->defiNet::wire(i); +
++ fprintf(fout, "\n + %s ", wire->wireType()); +
++ count = 0; +
++ for (j = 0; j < wire->defiWire::numPaths(); j++) { +
++ p = wire->defiWire::path(j); +
+ ++ while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) { +
++ count++; +
++ // Don't want the line to be too long +
+ + ++ count = 0; +
++ } +
++ switch (path) { +
+ + ++ fprintf(fout, "%s ", p->defiPath::getLayer()); +
++ newLayer = 1; +
++ } else +
++ fprintf(fout, "NEW %s ", p->defiPath::getLayer()); +
++ break; +
+ ++ fprintf(fout, "%s ", p->defiPath::getVia()); +
++ break; +
++ case DEFIPATH_VIAROTATION: +
+ ++ orientStr(p->defiPath::getViaRotation())); +
++ break; +
+ ++ fprintf(fout, "%d ", p->defiPath::getWidth()); +
++ break; +
+ ++ p->defiPath::getPoint(&x, &y); +
++ fprintf(fout, "( %d %d ) ", x, y); +
++ break; +
+ ++ p->defiPath::getFlushPoint(&x, &y, &z); +
++ fprintf(fout, "( %d %d %d ) ", x, y, z); +
++ break; +
+ + ++ break; +
+ ++ fprintf(fout, "TAPERRULE %s ",p->defiPath::getTaperRule()); +
++ break; +
+ ++ fprintf(fout, "STYLE %d ",p->defiPath::getStyle()); +
++ break; +
++ } +
++ } +
++ } +
+ ++ count = 0; +
++ } +
++ } +
+ ++ // SHIELDNET +
++ if (net->defiNet::numShieldNets()) { +
++ for (i = 0; i < net->defiNet::numShieldNets(); i++) +
++ fprintf(fout, "\n + SHIELDNET %s", net->defiNet::shieldNet(i)); +
++ } +
+ ++ if (net->defiNet::hasSubnets()) { +
++ for (i = 0; i < net->defiNet::numSubnets(); i++) { +
++ s = net->defiNet::subnet(i); +
+ + ++ if (s->defiSubnet::numConnections()) { +
++ if (s->defiSubnet::pinIsMustJoin(0)) +
++ fprintf(fout, "- MUSTJOIN "); +
++ else +
++ fprintf(fout, " + SUBNET %s ", s->defiSubnet::name()); +
++ for (j = 0; j < s->defiSubnet::numConnections(); j++) +
++ fprintf(fout, " ( %s %s )\n", s->defiSubnet::instance(j), +
+ + ++ // regularWiring +
++ if (s->defiSubnet::numWires()) { +
++ for (k = 0; k < s->defiSubnet::numWires(); k++) { +
++ newLayer = 0; +
++ wire = s->defiSubnet::wire(k); +
++ fprintf(fout, " %s ", wire->wireType()); +
++ count = 0; +
++ for (j = 0; j < wire->defiWire::numPaths(); j++) { +
++ p = wire->defiWire::path(j); +
+ ++ while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) { +
++ count++; +
++ // Don't want the line to be too long +
+ + ++ count = 0; +
++ } +
++ switch (path) { +
+ + ++ fprintf(fout, "%s ", p->defiPath::getLayer()); +
++ newLayer = 1; +
++ } else +
+ + ++ break; +
+ ++ fprintf(fout, "%s ", p->defiPath::getVia()); +
++ break; +
++ case DEFIPATH_VIAROTATION: +
+ ++ p->defiPath::getViaRotationStr()); +
++ break; +
+ ++ fprintf(fout, "%d ", p->defiPath::getWidth()); +
++ break; +
+ ++ p->defiPath::getPoint(&x, &y); +
++ fprintf(fout, "( %d %d ) ", x, y); +
++ break; +
+ ++ p->defiPath::getFlushPoint(&x, &y, &z); +
++ fprintf(fout, "( %d %d %d ) ", x, y, z); +
++ break; +
+ + ++ break; +
+ ++ fprintf(fout, "TAPERRULE %s ", +
++ p->defiPath::getTaperRule()); +
++ break; +
+ ++ fprintf(fout, "STYLE %d ", +
+ ++ break; +
++ } +
++ } +
++ } +
++ } +
++ } +
++ } +
++ } +
++ } +
+ ++ if (net->defiNet::numProps()) { +
++ for (i = 0; i < net->defiNet::numProps(); i++) { +
++ fprintf(fout, " + PROPERTY %s ", net->defiNet::propName(i)); +
++ switch (net->defiNet::propType(i)) { +
++ case 'R': fprintf(fout, "%g REAL ", net->defiNet::propNumber(i)); +
++ break; +
++ case 'I': fprintf(fout, "%g INTEGER ", net->defiNet::propNumber(i)); +
++ break; +
++ case 'S': fprintf(fout, "%s STRING ", net->defiNet::propValue(i)); +
++ break; +
++ case 'Q': fprintf(fout, "%s QUOTESTRING ", net->defiNet::propValue(i)); +
++ break; +
++ case 'N': fprintf(fout, "%g NUMBER ", net->defiNet::propNumber(i)); +
++ break; +
++ } +
+ ++ } +
++ } +
+ ++ if (net->defiNet::hasWeight()) +
++ fprintf(fout, "+ WEIGHT %d ", net->defiNet::weight()); +
++ if (net->defiNet::hasCap()) +
++ fprintf(fout, "+ ESTCAP %g ", net->defiNet::cap()); +
++ if (net->defiNet::hasSource()) +
++ fprintf(fout, "+ SOURCE %s ", net->defiNet::source()); +
++ if (net->defiNet::hasFixedbump()) +
++ fprintf(fout, "+ FIXEDBUMP "); +
++ if (net->defiNet::hasFrequency()) +
++ fprintf(fout, "+ FREQUENCY %g ", net->defiNet::frequency()); +
++ if (net->defiNet::hasPattern()) +
++ fprintf(fout, "+ PATTERN %s ", net->defiNet::pattern()); +
++ if (net->defiNet::hasOriginal()) +
++ fprintf(fout, "+ ORIGINAL %s ", net->defiNet::original()); +
++ if (net->defiNet::hasUse()) +
++ fprintf(fout, "+ USE %s ", net->defiNet::use()); +
+ + ++ --numObjs; +
+ ++ fprintf(fout, "END NETS\n"); +
++ return 0; +
++ } +
+ + ++ int snetpath(defrCallbackType_e c, defiNet* ppath, defiUserData ud) { +
++ int i, j, x, y, z, count, newLayer; +
++ char* layerName; +
+ ++ defiPath* p; +
++ defiSubnet *s; +
++ int path; +
+ ++ defiWire* wire; +
++ int numX, numY, stepX, stepY; +
+ ++ if (c != defrSNetPartialPathCbkType) +
++ return 1; +
++ if ((long)ud != userData) dataError(); +
+ ++ fprintf (fout, "SPECIALNET partial data\n"); +
+ ++ fprintf(fout, "- %s ", ppath->defiNet::name()); +
+ ++ count = 0; +
+ ++ for (i = 0; i < ppath->defiNet::numConnections(); i++) { +
++ // set the limit of only 5 items print out in one line +
++ count++; +
+ + ++ count = 0; +
++ } +
++ fprintf (fout, "( %s %s ) ", ppath->defiNet::instance(i), +
+ ++ if (ppath->defiNet::pinIsSynthesized(i)) +
++ fprintf(fout, "+ SYNTHESIZED "); +
++ } +
+ ++ // specialWiring +
++ // POLYGON +
++ if (ppath->defiNet::numPolygons()) { +
+ ++ for (i = 0; i < ppath->defiNet::numPolygons(); i++) { +
++ fprintf(fout, "\n + POLYGON %s ", ppath->polygonName(i)); +
++ points = ppath->getPolygon(i); +
++ for (j = 0; j < points.numPoints; j++) +
++ fprintf(fout, "%d %d ", points.x[j], points.y[j]); +
++ } +
++ } +
++ // RECT +
++ if (ppath->defiNet::numRectangles()) { +
++ for (i = 0; i < ppath->defiNet::numRectangles(); i++) { +
++ fprintf(fout, "\n + RECT %s %d %d %d %d", ppath->defiNet::rectName(i), +
++ ppath->defiNet::xl(i), ppath->defiNet::yl(i), +
++ ppath->defiNet::xh(i), ppath->defiNet::yh(i)); +
++ } +
++ } +
+ ++ // COVER, FIXED, ROUTED or SHIELD +
++ if (ppath->defiNet::numWires()) { +
++ newLayer = 0; +
++ for (i = 0; i < ppath->defiNet::numWires(); i++) { +
++ newLayer = 0; +
++ wire = ppath->defiNet::wire(i); +
++ fprintf(fout, "\n + %s ", wire->wireType()); +
++ if (strcmp (wire->wireType(), "SHIELD") == 0) +
++ fprintf(fout, "%s ", wire->wireShieldNetName()); +
++ for (j = 0; j < wire->defiWire::numPaths(); j++) { +
++ p = wire->defiWire::path(j); +
+ ++ while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) { +
++ count++; +
++ // Don't want the line to be too long +
+ + ++ count = 0; +
++ } +
++ switch (path) { +
+ + ++ fprintf(fout, "%s ", p->defiPath::getLayer()); +
++ newLayer = 1; +
++ } else +
++ fprintf(fout, "NEW %s ", p->defiPath::getLayer()); +
++ break; +
+ ++ fprintf(fout, "%s ", p->defiPath::getVia()); +
++ break; +
++ case DEFIPATH_VIAROTATION: +
+ ++ orientStr(p->defiPath::getViaRotation())); +
++ break; +
+ ++ p->defiPath::getViaData(&numX, &numY, &stepX, &stepY); +
++ fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY, +
++ stepX, stepY); +
++ break; +
+ ++ fprintf(fout, "%d ", p->defiPath::getWidth()); +
++ break; +
+ ++ p->defiPath::getPoint(&x, &y); +
++ fprintf(fout, "( %d %d ) ", x, y); +
++ break; +
+ ++ p->defiPath::getFlushPoint(&x, &y, &z); +
++ fprintf(fout, "( %d %d %d ) ", x, y, z); +
++ break; +
+ + ++ break; +
+ ++ fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape()); +
++ break; +
+ ++ fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle()); +
++ break; +
++ } +
++ } +
++ } +
+ ++ count = 0; +
++ } +
++ } +
+ ++ if (ppath->defiNet::hasSubnets()) { +
++ for (i = 0; i < ppath->defiNet::numSubnets(); i++) { +
++ s = ppath->defiNet::subnet(i); +
++ if (s->defiSubnet::numConnections()) { +
++ if (s->defiSubnet::pinIsMustJoin(0)) +
++ fprintf(fout, "- MUSTJOIN "); +
++ else +
++ fprintf(fout, "- %s ", s->defiSubnet::name()); +
++ for (j = 0; j < s->defiSubnet::numConnections(); j++) { +
++ fprintf(fout, " ( %s %s )\n", s->defiSubnet::instance(j), +
+ ++ } +
++ } +
+ ++ // regularWiring +
++ if (s->defiSubnet::numWires()) { +
++ for (i = 0; i < s->defiSubnet::numWires(); i++) { +
++ wire = s->defiSubnet::wire(i); +
++ fprintf(fout, " + %s ", wire->wireType()); +
++ for (j = 0; j < wire->defiWire::numPaths(); j++) { +
++ p = wire->defiWire::path(j); +
+ ++ } +
++ } +
++ } +
++ } +
++ } +
+ ++ if (ppath->defiNet::numProps()) { +
++ for (i = 0; i < ppath->defiNet::numProps(); i++) { +
++ if (ppath->defiNet::propIsString(i)) +
++ fprintf(fout, " + PROPERTY %s %s ", ppath->defiNet::propName(i), +
++ ppath->defiNet::propValue(i)); +
++ if (ppath->defiNet::propIsNumber(i)) +
++ fprintf(fout, " + PROPERTY %s %g ", ppath->defiNet::propName(i), +
++ ppath->defiNet::propNumber(i)); +
++ switch (ppath->defiNet::propType(i)) { +
++ case 'R': fprintf(fout, "REAL "); +
++ break; +
++ case 'I': fprintf(fout, "INTEGER "); +
++ break; +
++ case 'S': fprintf(fout, "STRING "); +
++ break; +
++ case 'Q': fprintf(fout, "QUOTESTRING "); +
++ break; +
++ case 'N': fprintf(fout, "NUMBER "); +
++ break; +
++ } +
+ ++ } +
++ } +
+ ++ // SHIELD +
++ count = 0; +
++ // testing the SHIELD for 5.3, obsolete in 5.4 +
++ if (ppath->defiNet::numShields()) { +
++ for (i = 0; i < ppath->defiNet::numShields(); i++) { +
++ shield = ppath->defiNet::shield(i); +
++ fprintf(fout, "\n + SHIELD %s ", shield->defiShield::shieldName()); +
++ newLayer = 0; +
++ for (j = 0; j < shield->defiShield::numPaths(); j++) { +
++ p = shield->defiShield::path(j); +
+ ++ while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) { +
++ count++; +
++ // Don't want the line to be too long +
+ + ++ count = 0; +
++ } +
++ switch (path) { +
+ + ++ fprintf(fout, "%s ", p->defiPath::getLayer()); +
++ newLayer = 1; +
++ } else +
++ fprintf(fout, "NEW %s ", p->defiPath::getLayer()); +
++ break; +
+ ++ fprintf(fout, "%s ", p->defiPath::getVia()); +
++ break; +
++ case DEFIPATH_VIAROTATION: +
++ if (newLayer) +
+ ++ orientStr(p->defiPath::getViaRotation())); +
++ else +
+ ++ p->defiPath::getViaRotationStr()); +
++ break; +
+ ++ fprintf(fout, "%d ", p->defiPath::getWidth()); +
++ break; +
+ ++ p->defiPath::getPoint(&x, &y); +
++ fprintf(fout, "( %d %d ) ", x, y); +
++ break; +
+ ++ p->defiPath::getFlushPoint(&x, &y, &z); +
++ fprintf(fout, "( %d %d %d ) ", x, y, z); +
++ break; +
+ + ++ break; +
+ ++ fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape()); +
++ break; +
+ ++ fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle()); +
++ } +
++ } +
++ } +
++ } +
++ } +
+ + ++ if (ppath->defiNet::hasWidthRules()) { +
++ for (i = 0; i < ppath->defiNet::numWidthRules(); i++) { +
++ ppath->defiNet::widthRule(i, &layerName, &dist); +
++ fprintf (fout, "\n + WIDTH %s %g ", layerName, dist); +
++ } +
++ } +
+ + ++ if (ppath->defiNet::hasSpacingRules()) { +
++ for (i = 0; i < ppath->defiNet::numSpacingRules(); i++) { +
++ ppath->defiNet::spacingRule(i, &layerName, &dist, &left, &right); +
+ ++ fprintf (fout, "\n + SPACING %s %g ", layerName, dist); +
++ else +
++ fprintf (fout, "\n + SPACING %s %g RANGE %g %g ", +
++ layerName, dist, left, right); +
++ } +
++ } +
+ ++ if (ppath->defiNet::hasFixedbump()) +
++ fprintf(fout, "\n + FIXEDBUMP "); +
++ if (ppath->defiNet::hasFrequency()) +
++ fprintf(fout, "\n + FREQUENCY %g ", ppath->defiNet::frequency()); +
++ if (ppath->defiNet::hasVoltage()) +
++ fprintf(fout, "\n + VOLTAGE %g ", ppath->defiNet::voltage()); +
++ if (ppath->defiNet::hasWeight()) +
++ fprintf(fout, "\n + WEIGHT %d ", ppath->defiNet::weight()); +
++ if (ppath->defiNet::hasCap()) +
++ fprintf(fout, "\n + ESTCAP %g ", ppath->defiNet::cap()); +
++ if (ppath->defiNet::hasSource()) +
++ fprintf(fout, "\n + SOURCE %s ", ppath->defiNet::source()); +
++ if (ppath->defiNet::hasPattern()) +
++ fprintf(fout, "\n + PATTERN %s ", ppath->defiNet::pattern()); +
++ if (ppath->defiNet::hasOriginal()) +
++ fprintf(fout, "\n + ORIGINAL %s ", ppath->defiNet::original()); +
++ if (ppath->defiNet::hasUse()) +
++ fprintf(fout, "\n + USE %s ", ppath->defiNet::use()); +
+ + + ++ return 0; +
++ } +
+ + ++ int snetwire(defrCallbackType_e c, defiNet* ppath, defiUserData ud) { +
++ int i, j, x, y, z, count = 0, newLayer; +
++ defiPath* p; +
++ int path; +
++ defiWire* wire; +
+ ++ int numX, numY, stepX, stepY; +
+ ++ if (c != defrSNetWireCbkType) +
++ return 1; +
++ if ((long)ud != userData) dataError(); +
+ ++ fprintf (fout, "SPECIALNET wire data\n"); +
+ ++ fprintf(fout, "- %s ", ppath->defiNet::name()); +
+ ++ // specialWiring +
++ if (ppath->defiNet::numWires()) { +
++ newLayer = 0; +
++ for (i = 0; i < ppath->defiNet::numWires(); i++) { +
++ newLayer = 0; +
++ wire = ppath->defiNet::wire(i); +
++ fprintf(fout, "\n + %s ", wire->wireType()); +
++ if (strcmp (wire->wireType(), "SHIELD") == 0) +
++ fprintf(fout, "%s ", wire->wireShieldNetName()); +
++ for (j = 0; j < wire->defiWire::numPaths(); j++) { +
++ p = wire->defiWire::path(j); +
+ ++ while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) { +
++ count++; +
++ // Don't want the line to be too long +
+ + ++ count = 0; +
++ } +
++ switch (path) { +
+ + ++ fprintf(fout, "%s ", p->defiPath::getLayer()); +
++ newLayer = 1; +
++ } else +
++ fprintf(fout, "NEW %s ", p->defiPath::getLayer()); +
++ break; +
+ ++ fprintf(fout, "%s ", p->defiPath::getVia()); +
++ break; +
++ case DEFIPATH_VIAROTATION: +
+ ++ orientStr(p->defiPath::getViaRotation())); +
++ break; +
+ ++ p->defiPath::getViaData(&numX, &numY, &stepX, &stepY); +
++ fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY, +
++ stepX, stepY); +
++ break; +
+ ++ fprintf(fout, "%d ", p->defiPath::getWidth()); +
++ break; +
+ ++ p->defiPath::getPoint(&x, &y); +
++ fprintf(fout, "( %d %d ) ", x, y); +
++ break; +
+ ++ p->defiPath::getFlushPoint(&x, &y, &z); +
++ fprintf(fout, "( %d %d %d ) ", x, y, z); +
++ break; +
+ + ++ break; +
+ ++ fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape()); +
++ break; +
+ ++ fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle()); +
++ break; +
++ } +
++ } +
++ } +
+ ++ count = 0; +
++ } +
++ } else if (ppath->defiNet::numShields()) { +
++ for (i = 0; i < ppath->defiNet::numShields(); i++) { +
++ shield = ppath->defiNet::shield(i); +
++ fprintf(fout, "\n + SHIELD %s ", shield->defiShield::shieldName()); +
++ newLayer = 0; +
++ for (j = 0; j < shield->defiShield::numPaths(); j++) { +
++ p = shield->defiShield::path(j); +
+ ++ while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) { +
++ count++; +
++ // Don't want the line to be too long +
+ + ++ count = 0; +
++ } +
++ switch (path) { +
+ + ++ fprintf(fout, "%s ", p->defiPath::getLayer()); +
++ newLayer = 1; +
++ } else +
++ fprintf(fout, "NEW %s ", p->defiPath::getLayer()); +
++ break; +
+ ++ fprintf(fout, "%s ", p->defiPath::getVia()); +
++ break; +
++ case DEFIPATH_VIAROTATION: +
+ ++ orientStr(p->defiPath::getViaRotation())); +
++ break; +
+ ++ fprintf(fout, "%d ", p->defiPath::getWidth()); +
++ break; +
+ ++ p->defiPath::getPoint(&x, &y); +
++ fprintf(fout, "( %d %d ) ", x, y); +
++ break; +
+ ++ p->defiPath::getFlushPoint(&x, &y, &z); +
++ fprintf(fout, "( %d %d %d ) ", x, y, z); +
++ break; +
+ + ++ break; +
+ ++ fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape()); +
++ break; +
+ ++ fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle()); +
++ break; +
++ } +
++ } +
++ } +
++ } +
++ } +
+ + + ++ return 0; +
++ } +
+ ++ int snetf(defrCallbackType_e c, defiNet* net, defiUserData ud) { +
++ // For net and special net. +
++ int i, j, x, y, z, count, newLayer; +
++ char* layerName; +
+ ++ defiPath* p; +
++ defiSubnet *s; +
++ int path; +
+ ++ defiWire* wire; +
++ int numX, numY, stepX, stepY; +
+ ++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
+ ++ fprintf(fout, "BOGUS NET TYPE "); +
+ ++ count = 0; +
+ ++ for (i = 0; i < net->defiNet::numConnections(); i++) { +
++ // set the limit of only 5 items print out in one line +
++ count++; +
+ + ++ count = 0; +
++ } +
++ fprintf (fout, "( %s %s ) ", net->defiNet::instance(i), +
+ ++ if (net->defiNet::pinIsSynthesized(i)) +
++ fprintf(fout, "+ SYNTHESIZED "); +
++ } +
+ ++ // specialWiring +
++ if (net->defiNet::numWires()) { +
++ newLayer = 0; +
++ for (i = 0; i < net->defiNet::numWires(); i++) { +
++ newLayer = 0; +
++ wire = net->defiNet::wire(i); +
++ fprintf(fout, "\n + %s ", wire->wireType()); +
++ if (strcmp (wire->wireType(), "SHIELD") == 0) +
++ fprintf(fout, "%s ", wire->wireShieldNetName()); +
++ for (j = 0; j < wire->defiWire::numPaths(); j++) { +
++ p = wire->defiWire::path(j); +
+ ++ while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) { +
++ count++; +
++ // Don't want the line to be too long +
+ + ++ count = 0; +
++ } +
++ switch (path) { +
+ + ++ fprintf(fout, "%s ", p->defiPath::getLayer()); +
++ newLayer = 1; +
++ } else +
++ fprintf(fout, "NEW %s ", p->defiPath::getLayer()); +
++ break; +
+ ++ fprintf(fout, "%s ", p->defiPath::getVia()); +
++ break; +
++ case DEFIPATH_VIAROTATION: +
+ ++ orientStr(p->defiPath::getViaRotation())); +
++ break; +
+ ++ p->defiPath::getViaData(&numX, &numY, &stepX, &stepY); +
++ fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY, +
++ stepX, stepY); +
++ break; +
+ ++ fprintf(fout, "%d ", p->defiPath::getWidth()); +
++ break; +
+ ++ p->defiPath::getPoint(&x, &y); +
++ fprintf(fout, "( %d %d ) ", x, y); +
++ break; +
+ ++ p->defiPath::getFlushPoint(&x, &y, &z); +
++ fprintf(fout, "( %d %d %d ) ", x, y, z); +
++ break; +
+ + ++ break; +
+ ++ fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape()); +
++ break; +
+ ++ fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle()); +
++ break; +
++ } +
++ } +
++ } +
+ ++ count = 0; +
++ } +
++ } +
++ // POLYGON +
++ if (net->defiNet::numPolygons()) { +
+ ++ for (i = 0; i < net->defiNet::numPolygons(); i++) { +
++ fprintf(fout, "\n + POLYGON %s ", net->polygonName(i)); +
++ points = net->getPolygon(i); +
++ for (j = 0; j < points.numPoints; j++) +
++ fprintf(fout, "%d %d ", points.x[j], points.y[j]); +
++ } +
++ } +
++ // RECT +
++ if (net->defiNet::numRectangles()) { +
++ for (i = 0; i < net->defiNet::numRectangles(); i++) { +
++ fprintf(fout, "\n + RECT %s %d %d %d %d", net->defiNet::rectName(i), +
++ net->defiNet::xl(i), net->defiNet::yl(i), net->defiNet::xh(i), +
+ ++ } +
++ } +
+ ++ if (net->defiNet::hasSubnets()) { +
++ for (i = 0; i < net->defiNet::numSubnets(); i++) { +
++ s = net->defiNet::subnet(i); +
++ if (s->defiSubnet::numConnections()) { +
++ if (s->defiSubnet::pinIsMustJoin(0)) +
++ fprintf(fout, "- MUSTJOIN "); +
++ else +
++ fprintf(fout, "- %s ", s->defiSubnet::name()); +
++ for (j = 0; j < s->defiSubnet::numConnections(); j++) { +
++ fprintf(fout, " ( %s %s )\n", s->defiSubnet::instance(j), +
+ ++ } +
++ } +
+ ++ // regularWiring +
++ if (s->defiSubnet::numWires()) { +
++ for (i = 0; i < s->defiSubnet::numWires(); i++) { +
++ wire = s->defiSubnet::wire(i); +
++ fprintf(fout, " + %s ", wire->wireType()); +
++ for (j = 0; j < wire->defiWire::numPaths(); j++) { +
++ p = wire->defiWire::path(j); +
+ ++ } +
++ } +
++ } +
++ } +
++ } +
+ ++ if (net->defiNet::numProps()) { +
++ for (i = 0; i < net->defiNet::numProps(); i++) { +
++ if (net->defiNet::propIsString(i)) +
++ fprintf(fout, " + PROPERTY %s %s ", net->defiNet::propName(i), +
++ net->defiNet::propValue(i)); +
++ if (net->defiNet::propIsNumber(i)) +
++ fprintf(fout, " + PROPERTY %s %g ", net->defiNet::propName(i), +
++ net->defiNet::propNumber(i)); +
++ switch (net->defiNet::propType(i)) { +
++ case 'R': fprintf(fout, "REAL "); +
++ break; +
++ case 'I': fprintf(fout, "INTEGER "); +
++ break; +
++ case 'S': fprintf(fout, "STRING "); +
++ break; +
++ case 'Q': fprintf(fout, "QUOTESTRING "); +
++ break; +
++ case 'N': fprintf(fout, "NUMBER "); +
++ break; +
++ } +
+ ++ } +
++ } +
+ ++ // SHIELD +
++ count = 0; +
++ // testing the SHIELD for 5.3, obsolete in 5.4 +
++ if (net->defiNet::numShields()) { +
++ for (i = 0; i < net->defiNet::numShields(); i++) { +
++ shield = net->defiNet::shield(i); +
++ fprintf(fout, "\n + SHIELD %s ", shield->defiShield::shieldName()); +
++ newLayer = 0; +
++ for (j = 0; j < shield->defiShield::numPaths(); j++) { +
++ p = shield->defiShield::path(j); +
+ ++ while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) { +
++ count++; +
++ // Don't want the line to be too long +
+ + ++ count = 0; +
++ } +
++ switch (path) { +
+ + ++ fprintf(fout, "%s ", p->defiPath::getLayer()); +
++ newLayer = 1; +
++ } else +
++ fprintf(fout, "NEW %s ", p->defiPath::getLayer()); +
++ break; +
+ ++ fprintf(fout, "%s ", p->defiPath::getVia()); +
++ break; +
++ case DEFIPATH_VIAROTATION: +
+ ++ orientStr(p->defiPath::getViaRotation())); +
++ break; +
+ ++ fprintf(fout, "%d ", p->defiPath::getWidth()); +
++ break; +
+ ++ p->defiPath::getPoint(&x, &y); +
++ fprintf(fout, "( %d %d ) ", x, y); +
++ break; +
+ ++ p->defiPath::getFlushPoint(&x, &y, &z); +
++ fprintf(fout, "( %d %d %d ) ", x, y, z); +
++ break; +
+ + ++ break; +
+ ++ fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape()); +
++ break; +
+ ++ fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle()); +
++ break; +
++ } +
++ } +
++ } +
++ } +
++ } +
+ + ++ if (net->defiNet::hasWidthRules()) { +
++ for (i = 0; i < net->defiNet::numWidthRules(); i++) { +
++ net->defiNet::widthRule(i, &layerName, &dist); +
++ fprintf (fout, "\n + WIDTH %s %g ", layerName, dist); +
++ } +
++ } +
+ + ++ if (net->defiNet::hasSpacingRules()) { +
++ for (i = 0; i < net->defiNet::numSpacingRules(); i++) { +
++ net->defiNet::spacingRule(i, &layerName, &dist, &left, &right); +
+ ++ fprintf (fout, "\n + SPACING %s %g ", layerName, dist); +
++ else +
++ fprintf (fout, "\n + SPACING %s %g RANGE %g %g ", +
++ layerName, dist, left, right); +
++ } +
++ } +
+ ++ if (net->defiNet::hasFixedbump()) +
++ fprintf(fout, "\n + FIXEDBUMP "); +
++ if (net->defiNet::hasFrequency()) +
++ fprintf(fout, "\n + FREQUENCY %g ", net->defiNet::frequency()); +
++ if (net->defiNet::hasVoltage()) +
++ fprintf(fout, "\n + VOLTAGE %g ", net->defiNet::voltage()); +
++ if (net->defiNet::hasWeight()) +
++ fprintf(fout, "\n + WEIGHT %d ", net->defiNet::weight()); +
++ if (net->defiNet::hasCap()) +
++ fprintf(fout, "\n + ESTCAP %g ", net->defiNet::cap()); +
++ if (net->defiNet::hasSource()) +
++ fprintf(fout, "\n + SOURCE %s ", net->defiNet::source()); +
++ if (net->defiNet::hasPattern()) +
++ fprintf(fout, "\n + PATTERN %s ", net->defiNet::pattern()); +
++ if (net->defiNet::hasOriginal()) +
++ fprintf(fout, "\n + ORIGINAL %s ", net->defiNet::original()); +
++ if (net->defiNet::hasUse()) +
++ fprintf(fout, "\n + USE %s ", net->defiNet::use()); +
+ + ++ --numObjs; +
+ ++ fprintf(fout, "END SPECIALNETS\n"); +
++ return 0; +
++ } +
+ + ++ int ndr(defrCallbackType_e c, defiNonDefault* nd, defiUserData ud) { +
+ ++ int i; +
+ ++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ if (c != defrNonDefaultCbkType) +
++ fprintf(fout, "BOGUS NONDEFAULTRULE TYPE "); +
++ fprintf(fout, "- %s\n", nd->defiNonDefault::name()); +
++ if (nd->defiNonDefault::hasHardspacing()) +
++ fprintf(fout, " + HARDSPACING\n"); +
++ for (i = 0; i < nd->defiNonDefault::numLayers(); i++) { +
++ fprintf(fout, " + LAYER %s", nd->defiNonDefault::layerName(i)); +
++ fprintf(fout, " WIDTH %d", nd->defiNonDefault::layerWidthVal(i)); +
++ if (nd->defiNonDefault::hasLayerDiagWidth(i)) +
++ fprintf(fout, " DIAGWIDTH %d", +
++ nd->defiNonDefault::layerDiagWidthVal(i)); +
++ if (nd->defiNonDefault::hasLayerSpacing(i)) +
++ fprintf(fout, " SPACING %d", nd->defiNonDefault::layerSpacingVal(i)); +
++ if (nd->defiNonDefault::hasLayerWireExt(i)) +
++ fprintf(fout, " WIREEXT %d", nd->defiNonDefault::layerWireExtVal(i)); +
+ ++ } +
++ for (i = 0; i < nd->defiNonDefault::numVias(); i++) +
++ fprintf(fout, " + VIA %s\n", nd->defiNonDefault::viaName(i)); +
++ for (i = 0; i < nd->defiNonDefault::numViaRules(); i++) +
++ fprintf(fout, " + VIARULE %s\n", nd->defiNonDefault::viaRuleName(i)); +
++ for (i = 0; i < nd->defiNonDefault::numMinCuts(); i++) +
++ fprintf(fout, " + MINCUTS %s %d\n", nd->defiNonDefault::cutLayerName(i), +
++ nd->defiNonDefault::numCuts(i)); +
++ for (i = 0; i < nd->defiNonDefault::numProps(); i++) { +
++ fprintf(fout, " + PROPERTY %s %s ", nd->defiNonDefault::propName(i), +
++ nd->defiNonDefault::propValue(i)); +
++ switch (nd->defiNonDefault::propType(i)) { +
++ case 'R': fprintf(fout, "REAL\n"); +
++ break; +
++ case 'I': fprintf(fout, "INTEGER\n"); +
++ break; +
++ case 'S': fprintf(fout, "STRING\n"); +
++ break; +
++ case 'Q': fprintf(fout, "QUOTESTRING\n"); +
++ break; +
++ case 'N': fprintf(fout, "NUMBER\n"); +
++ break; +
++ } +
++ } +
++ --numObjs; +
+ ++ fprintf(fout, "END NONDEFAULTRULES\n"); +
++ return 0; +
++ } +
+ ++ int tname(defrCallbackType_e c, const char* string, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "TECHNOLOGY %s ;\n", string); +
++ return 0; +
++ } +
+ ++ int dname(defrCallbackType_e c, const char* string, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "DESIGN %s ;\n", string); +
+ ++ // Test changing the user data. +
++ userData = 89; +
++ defrSetUserData((void*)userData); +
+ ++ return 0; +
++ } +
+ + ++ char* address(const char* in) { +
+ ++ } +
+ ++ int cs(defrCallbackType_e c, int num, defiUserData ud) { +
++ char* name; +
+ ++ checkType(c); +
+ ++ if ((long)ud != userData) dataError(); +
+ ++ switch (c) { +
++ case defrComponentStartCbkType : name = address("COMPONENTS"); break; +
++ case defrNetStartCbkType : name = address("NETS"); break; +
++ case defrStartPinsCbkType : name = address("PINS"); break; +
++ case defrViaStartCbkType : name = address("VIAS"); break; +
++ case defrRegionStartCbkType : name = address("REGIONS"); break; +
++ case defrSNetStartCbkType : name = address("SPECIALNETS"); break; +
++ case defrGroupsStartCbkType : name = address("GROUPS"); break; +
++ case defrScanchainsStartCbkType : name = address("SCANCHAINS"); break; +
++ case defrIOTimingsStartCbkType : name = address("IOTIMINGS"); break; +
++ case defrFPCStartCbkType : name = address("FLOORPLANCONSTRAINTS"); break; +
++ case defrTimingDisablesStartCbkType : name = address("TIMING DISABLES"); break; +
++ case defrPartitionsStartCbkType : name = address("PARTITIONS"); break; +
++ case defrPinPropStartCbkType : name = address("PINPROPERTIES"); break; +
++ case defrBlockageStartCbkType : name = address("BLOCKAGES"); break; +
++ case defrSlotStartCbkType : name = address("SLOTS"); break; +
++ case defrFillStartCbkType : name = address("FILLS"); break; +
++ case defrNonDefaultStartCbkType : name = address("NONDEFAULTRULES"); break; +
++ case defrStylesStartCbkType : name = address("STYLES"); break; +
++ default : name = address("BOGUS"); return 1; +
++ } +
++ fprintf(fout, "\n%s %d ;\n", name, num); +
++ numObjs = num; +
++ return 0; +
++ } +
+ ++ int constraintst(defrCallbackType_e c, int num, defiUserData ud) { +
++ // Handles both constraints and assertions +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ if (c == defrConstraintsStartCbkType) +
++ fprintf(fout, "\nCONSTRAINTS %d ;\n\n", num); +
++ else +
++ fprintf(fout, "\nASSERTIONS %d ;\n\n", num); +
++ numObjs = num; +
++ return 0; +
++ } +
+ ++ void operand(defrCallbackType_e c, defiAssertion* a, int ind) { +
+ ++ char* netName; +
++ char* fromInst, * fromPin, * toInst, * toPin; +
+ ++ if (a->defiAssertion::isSum()) { +
++ // Sum in operand, recursively call operand +
++ fprintf(fout, "- SUM ( "); +
++ a->defiAssertion::unsetSum(); +
++ isSumSet = 1; +
++ begOperand = 0; +
+ + ++ } else { +
++ // operand +
++ if (ind >= a->defiAssertion::numItems()) { +
++ fprintf(fout, "ERROR: when writing out SUM in Constraints.\n"); +
++ return; +
++ } +
+ + ++ begOperand = 0; +
++ } +
++ for (i = ind; i < a->defiAssertion::numItems(); i++) { +
++ if (a->defiAssertion::isNet(i)) { +
++ a->defiAssertion::net(i, &netName); +
++ if (!first) +
++ fprintf(fout, ", "); // print , as separator +
++ fprintf(fout, "NET %s ", netName); +
++ } else if (a->defiAssertion::isPath(i)) { +
++ a->defiAssertion::path(i, &fromInst, &fromPin, &toInst, +
++ &toPin); +
++ if (!first) +
+ ++ fprintf(fout, "PATH %s %s %s %s ", fromInst, fromPin, toInst, +
++ toPin); +
+ ++ // SUM within SUM, reset the flag +
++ a->defiAssertion::setSum(); +
+ ++ } +
++ first = 0; +
++ } +
+ ++ } +
++ } +
+ ++ int constraint(defrCallbackType_e c, defiAssertion* a, defiUserData ud) { +
++ // Handles both constraints and assertions +
+ ++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ if (a->defiAssertion::isWiredlogic()) +
++ // Wirelogic +
++ fprintf(fout, "- WIREDLOGIC %s + MAXDIST %g ;\n", +
++ a->defiAssertion::netName(), a->defiAssertion::fallMax()); +
++ else { +
++ // Call the operand function +
++ isSumSet = 0; // reset the global variable +
++ begOperand = 1; +
+ + ++ if (a->defiAssertion::hasRiseMax()) +
++ fprintf(fout, "+ RISEMAX %g ", a->defiAssertion::riseMax()); +
++ if (a->defiAssertion::hasFallMax()) +
++ fprintf(fout, "+ FALLMAX %g ", a->defiAssertion::fallMax()); +
++ if (a->defiAssertion::hasRiseMin()) +
++ fprintf(fout, "+ RISEMIN %g ", a->defiAssertion::riseMin()); +
++ if (a->defiAssertion::hasFallMin()) +
++ fprintf(fout, "+ FALLMIN %g ", a->defiAssertion::fallMin()); +
+ ++ } +
++ --numObjs; +
+ ++ if (c == defrConstraintCbkType) +
++ fprintf(fout, "END CONSTRAINTS\n"); +
++ else +
++ fprintf(fout, "END ASSERTIONS\n"); +
++ } +
++ return 0; +
++ } +
+ + ++ int propstart(defrCallbackType_e c, void* dummy, defiUserData ud) { +
++ checkType(c); +
++ fprintf(fout, "\nPROPERTYDEFINITIONS\n"); +
++ isProp = 1; +
+ ++ return 0; +
++ } +
+ + ++ int prop(defrCallbackType_e c, defiProp* p, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ if (strcmp(p->defiProp::propType(), "design") == 0) +
++ fprintf(fout, "DESIGN %s ", p->defiProp::propName()); +
++ else if (strcmp(p->defiProp::propType(), "net") == 0) +
++ fprintf(fout, "NET %s ", p->defiProp::propName()); +
++ else if (strcmp(p->defiProp::propType(), "component") == 0) +
++ fprintf(fout, "COMPONENT %s ", p->defiProp::propName()); +
++ else if (strcmp(p->defiProp::propType(), "specialnet") == 0) +
++ fprintf(fout, "SPECIALNET %s ", p->defiProp::propName()); +
++ else if (strcmp(p->defiProp::propType(), "group") == 0) +
++ fprintf(fout, "GROUP %s ", p->defiProp::propName()); +
++ else if (strcmp(p->defiProp::propType(), "row") == 0) +
++ fprintf(fout, "ROW %s ", p->defiProp::propName()); +
++ else if (strcmp(p->defiProp::propType(), "componentpin") == 0) +
++ fprintf(fout, "COMPONENTPIN %s ", p->defiProp::propName()); +
++ else if (strcmp(p->defiProp::propType(), "region") == 0) +
++ fprintf(fout, "REGION %s ", p->defiProp::propName()); +
++ else if (strcmp(p->defiProp::propType(), "nondefaultrule") == 0) +
++ fprintf(fout, "NONDEFAULTRULE %s ", p->defiProp::propName()); +
++ if (p->defiProp::dataType() == 'I') +
++ fprintf(fout, "INTEGER "); +
++ if (p->defiProp::dataType() == 'R') +
+ ++ if (p->defiProp::dataType() == 'S') +
+ ++ if (p->defiProp::dataType() == 'Q') +
+ ++ if (p->defiProp::hasRange()) { +
++ fprintf(fout, "RANGE %g %g ", p->defiProp::left(), +
+ ++ } +
++ if (p->defiProp::hasNumber()) +
++ fprintf(fout, "%g ", p->defiProp::number()); +
++ if (p->defiProp::hasString()) +
++ fprintf(fout, "\"%s\" ", p->defiProp::string()); +
+ + ++ return 0; +
++ } +
+ + ++ int propend(defrCallbackType_e c, void* dummy, defiUserData ud) { +
++ checkType(c); +
++ if (isProp) { +
++ fprintf(fout, "END PROPERTYDEFINITIONS\n\n"); +
++ isProp = 0; +
++ } +
+ ++ defrSetCaseSensitivity(1); +
++ return 0; +
++ } +
+ + ++ int hist(defrCallbackType_e c, const char* h, defiUserData ud) { +
++ checkType(c); +
++ defrSetCaseSensitivity(0); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "HISTORY %s ;\n", h); +
++ defrSetCaseSensitivity(1); +
++ return 0; +
++ } +
+ + ++ int an(defrCallbackType_e c, const char* h, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "ARRAY %s ;\n", h); +
++ return 0; +
++ } +
+ + ++ int fn(defrCallbackType_e c, const char* h, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "FLOORPLAN %s ;\n", h); +
++ return 0; +
++ } +
+ + ++ int bbn(defrCallbackType_e c, const char* h, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "BUSBITCHARS \"%s\" ;\n", h); +
++ return 0; +
++ } +
+ + ++ int vers(defrCallbackType_e c, double d, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "VERSION %g ;\n", d); +
++ curVer = d; +
+ ++ defrAddAlias ("alias1", "aliasValue1", 1); +
++ defrAddAlias ("alias2", "aliasValue2", 0); +
++ defiAlias_itr *aliasStore; +
++ aliasStore = (defiAlias_itr*)malloc(sizeof(defiAlias_itr*)); +
+ ++ while (aliasStore->defiAlias_itr::Next()) { +
++ fprintf(fout, "ALIAS %s %s %d ;\n", aliasStore->defiAlias_itr::Key(), +
++ aliasStore->defiAlias_itr::Data(), +
++ aliasStore->defiAlias_itr::Marked()); +
++ } +
+ ++ return 0; +
++ } +
+ + ++ int versStr(defrCallbackType_e c, const char* versionName, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "VERSION %s ;\n", versionName); +
++ return 0; +
++ } +
+ + ++ int units(defrCallbackType_e c, double d, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "UNITS DISTANCE MICRONS %g ;\n", d); +
++ return 0; +
++ } +
+ + ++ int casesens(defrCallbackType_e c, int d, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ if (d == 1) +
++ fprintf(fout, "NAMESCASESENSITIVE ON ;\n", d); +
++ else +
++ fprintf(fout, "NAMESCASESENSITIVE OFF ;\n", d); +
++ return 0; +
++ } +
+ + ++ int cls(defrCallbackType_e c, void* cl, defiUserData ud) { +
++ defiSite* site; // Site and Canplace and CannotOccupy +
++ defiBox* box; // DieArea and +
++ defiPinCap* pc; +
++ defiPin* pin; +
++ int i, j; +
++ defiRow* row; +
+ + ++ defiVia* via; +
++ defiRegion* re; +
+ + + ++ defiFPC* fpc; +
+ + + + ++ defiSlot* slots; +
++ defiFill* fills; +
+ + + ++ char **inst, **inPin, **outPin; +
++ int *bits; +
++ int size; +
++ int corner, typ; +
+ ++ char dir; +
++ defiPinAntennaModel* aModel; +
+ + ++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ switch (c) { +
+ + + ++ fprintf(fout, "SITE %s %g %g %s ", site->defiSite::name(), +
++ site->defiSite::x_orig(), site->defiSite::y_orig(), +
++ orientStr(site->defiSite::orient())); +
++ fprintf(fout, "DO %g BY %g STEP %g %g ;\n", +
++ site->defiSite::x_num(), site->defiSite::y_num(), +
++ site->defiSite::x_step(), site->defiSite::y_step()); +
++ break; +
++ case defrCanplaceCbkType : +
+ ++ fprintf(fout, "CANPLACE %s %g %g %s ", site->defiSite::name(), +
++ site->defiSite::x_orig(), site->defiSite::y_orig(), +
++ orientStr(site->defiSite::orient())); +
++ fprintf(fout, "DO %g BY %g STEP %g %g ;\n", +
++ site->defiSite::x_num(), site->defiSite::y_num(), +
++ site->defiSite::x_step(), site->defiSite::y_step()); +
++ break; +
++ case defrCannotOccupyCbkType : +
+ ++ fprintf(fout, "CANNOTOCCUPY %s %g %g %s ", +
++ site->defiSite::name(), site->defiSite::x_orig(), +
++ site->defiSite::y_orig(), orientStr(site->defiSite::orient())); +
++ fprintf(fout, "DO %g BY %g STEP %g %g ;\n", +
++ site->defiSite::x_num(), site->defiSite::y_num(), +
++ site->defiSite::x_step(), site->defiSite::y_step()); +
++ break; +
+ + ++ fprintf(fout, "DIEAREA %d %d %d %d ;\n", +
++ box->defiBox::xl(), box->defiBox::yl(), box->defiBox::xh(), +
+ ++ fprintf(fout, "DIEAREA "); +
++ points = box->defiBox::getPoint(); +
++ for (i = 0; i < points.numPoints; i++) +
++ fprintf(fout, "%d %d ", points.x[i], points.y[i]); +
+ ++ break; +
+ + ++ fprintf(fout, "MINPINS %d WIRECAP %g ;\n", +
++ pc->defiPinCap::pin(), pc->defiPinCap::cap()); +
++ --numObjs; +
+ ++ fprintf(fout, "END DEFAULTCAP\n"); +
++ break; +
+ + ++ fprintf(fout, "- %s + NET %s ", pin->defiPin::pinName(), +
+ ++ if (pin->defiPin::hasDirection()) +
++ fprintf(fout, "+ DIRECTION %s ", pin->defiPin::direction()); +
++ if (pin->defiPin::hasUse()) +
++ fprintf(fout, "+ USE %s ", pin->defiPin::use()); +
++ if (pin->defiPin::hasNetExpr()) +
++ fprintf(fout, "+ NETEXPR \"%s\" ", pin->defiPin::netExpr()); +
++ if (pin->defiPin::hasSupplySensitivity()) +
++ fprintf(fout, "+ SUPPLYSENSITIVITY %s ", +
++ pin->defiPin::supplySensitivity()); +
++ if (pin->defiPin::hasGroundSensitivity()) +
++ fprintf(fout, "+ GROUNDSENSITIVITY %s ", +
++ pin->defiPin::groundSensitivity()); +
++ if (pin->defiPin::hasLayer()) { +
+ ++ for (i = 0; i < pin->defiPin::numLayer(); i++) { +
++ fprintf(fout, "\n + LAYER %s ", pin->defiPin::layer(i)); +
++ if (pin->defiPin::hasLayerSpacing(i)) +
++ fprintf(fout, "SPACING %d ", +
++ pin->defiPin::layerSpacing(i)); +
++ if (pin->defiPin::hasLayerDesignRuleWidth(i)) +
++ fprintf(fout, "DESIGNRULEWIDTH %d ", +
++ pin->defiPin::layerDesignRuleWidth(i)); +
++ pin->defiPin::bounds(i, &xl, &yl, &xh, &yh); +
++ fprintf(fout, "%d %d %d %d ", xl, yl, xh, yh); +
++ } +
++ for (i = 0; i < pin->defiPin::numPolygons(); i++) { +
++ fprintf(fout, "\n + POLYGON %s ", +
++ pin->defiPin::polygonName(i)); +
++ if (pin->defiPin::hasPolygonSpacing(i)) +
++ fprintf(fout, "SPACING %d ", +
++ pin->defiPin::polygonSpacing(i)); +
++ if (pin->defiPin::hasPolygonDesignRuleWidth(i)) +
++ fprintf(fout, "DESIGNRULEWIDTH %d ", +
++ pin->defiPin::polygonDesignRuleWidth(i)); +
++ points = pin->defiPin::getPolygon(i); +
++ for (j = 0; j < points.numPoints; j++) +
++ fprintf(fout, "%d %d ", points.x[j], points.y[j]); +
++ } +
++ for (i = 0; i < pin->defiPin::numVias(); i++) { +
++ fprintf(fout, "\n + VIA %s %d %d ", pin->defiPin::viaName(i), +
++ pin->defiPin::viaPtX(i), pin->defiPin::viaPtY(i)); +
++ } +
++ } +
++ if (pin->defiPin::hasPort()) { +
+ + ++ for (j = 0; j < pin->defiPin::numPorts(); j++) { +
++ port = pin->defiPin::pinPort(j); +
++ fprintf(fout, "\n + PORT"); +
++ for (i = 0; i < port->defiPinPort::numLayer(); i++) { +
++ fprintf(fout, "\n + LAYER %s ", +
++ port->defiPinPort::layer(i)); +
++ if (port->defiPinPort::hasLayerSpacing(i)) +
++ fprintf(fout, "SPACING %d ", +
++ port->defiPinPort::layerSpacing(i)); +
++ if (port->defiPinPort::hasLayerDesignRuleWidth(i)) +
++ fprintf(fout, "DESIGNRULEWIDTH %d ", +
++ port->defiPinPort::layerDesignRuleWidth(i)); +
++ port->defiPinPort::bounds(i, &xl, &yl, &xh, &yh); +
++ fprintf(fout, "%d %d %d %d ", xl, yl, xh, yh); +
++ } +
++ for (i = 0; i < port->defiPinPort::numPolygons(); i++) { +
++ fprintf(fout, "\n + POLYGON %s ", +
++ port->defiPinPort::polygonName(i)); +
++ if (port->defiPinPort::hasPolygonSpacing(i)) +
++ fprintf(fout, "SPACING %d ", +
++ port->defiPinPort::polygonSpacing(i)); +
++ if (port->defiPinPort::hasPolygonDesignRuleWidth(i)) +
++ fprintf(fout, "DESIGNRULEWIDTH %d ", +
++ port->defiPinPort::polygonDesignRuleWidth(i)); +
++ points = port->defiPinPort::getPolygon(i); +
++ for (j = 0; j < points.numPoints; j++) +
++ fprintf(fout, "%d %d ", points.x[j], points.y[j]); +
++ } +
++ for (i = 0; i < port->defiPinPort::numVias(); i++) { +
++ fprintf(fout, "\n + VIA %s %g %g", +
++ port->defiPinPort::viaName(i), +
++ port->defiPinPort::viaPtX(i), +
++ port->defiPinPort::viaPtY(i)); +
++ } +
++ if (port->defiPinPort::hasPlacement()) { +
++ if (port->defiPinPort::isPlaced()) { +
++ fprintf(fout, "\n + PLACED "); +
++ fprintf(fout, "( %d %d ) %s ", +
++ port->defiPinPort::placementX(), +
++ port->defiPinPort::placementY(), +
++ orientStr(port->defiPinPort::orient())); +
++ } +
++ if (port->defiPinPort::isCover()) { +
++ fprintf(fout, "\n + COVER "); +
++ fprintf(fout, "( %d %d ) %s ", +
++ port->defiPinPort::placementX(), +
++ port->defiPinPort::placementY(), +
++ orientStr(port->defiPinPort::orient())); +
++ } +
++ if (port->defiPinPort::isFixed()) { +
++ fprintf(fout, "\n + FIXED "); +
++ fprintf(fout, "( %d %d ) %s ", +
++ port->defiPinPort::placementX(), +
++ port->defiPinPort::placementY(), +
++ orientStr(port->defiPinPort::orient())); +
++ } +
++ } +
++ } +
++ } +
++ if (pin->defiPin::hasPlacement()) { +
++ if (pin->defiPin::isPlaced()) { +
++ fprintf(fout, "+ PLACED "); +
++ fprintf(fout, "( %d %d ) %s ", pin->defiPin::placementX(), +
++ pin->defiPin::placementY(), +
++ orientStr(pin->defiPin::orient())); +
++ } +
++ if (pin->defiPin::isCover()) { +
++ fprintf(fout, "+ COVER "); +
++ fprintf(fout, "( %d %d ) %s ", pin->defiPin::placementX(), +
++ pin->defiPin::placementY(), +
++ orientStr(pin->defiPin::orient())); +
++ } +
++ if (pin->defiPin::isFixed()) { +
++ fprintf(fout, "+ FIXED "); +
++ fprintf(fout, "( %d %d ) %s ", pin->defiPin::placementX(), +
++ pin->defiPin::placementY(), +
++ orientStr(pin->defiPin::orient())); +
++ } +
++ if (pin->defiPin::isUnplaced()) +
++ fprintf(fout, "+ UNPLACED "); +
++ } +
++ if (pin->defiPin::hasSpecial()) { +
++ fprintf(fout, "+ SPECIAL "); +
++ } +
++ if (pin->hasAPinPartialMetalArea()) { +
++ for (i = 0; i < pin->defiPin::numAPinPartialMetalArea(); i++) { +
++ fprintf(fout, "ANTENNAPINPARTIALMETALAREA %d", +
++ pin->APinPartialMetalArea(i)); +
++ if (*(pin->APinPartialMetalAreaLayer(i))) +
++ fprintf(fout, " LAYER %s", +
++ pin->APinPartialMetalAreaLayer(i)); +
+ ++ } +
++ } +
++ if (pin->hasAPinPartialMetalSideArea()) { +
++ for (i = 0; i < pin->defiPin::numAPinPartialMetalSideArea(); i++) { +
++ fprintf(fout, "ANTENNAPINPARTIALMETALSIDEAREA %d", +
++ pin->APinPartialMetalSideArea(i)); +
++ if (*(pin->APinPartialMetalSideAreaLayer(i))) +
++ fprintf(fout, " LAYER %s", +
++ pin->APinPartialMetalSideAreaLayer(i)); +
+ ++ } +
++ } +
++ if (pin->hasAPinDiffArea()) { +
++ for (i = 0; i < pin->defiPin::numAPinDiffArea(); i++) { +
++ fprintf(fout, "ANTENNAPINDIFFAREA %d", pin->APinDiffArea(i)); +
++ if (*(pin->APinDiffAreaLayer(i))) +
++ fprintf(fout, " LAYER %s", pin->APinDiffAreaLayer(i)); +
+ ++ } +
++ } +
++ if (pin->hasAPinPartialCutArea()) { +
++ for (i = 0; i < pin->defiPin::numAPinPartialCutArea(); i++) { +
++ fprintf(fout, "ANTENNAPINPARTIALCUTAREA %d", +
++ pin->APinPartialCutArea(i)); +
++ if (*(pin->APinPartialCutAreaLayer(i))) +
++ fprintf(fout, " LAYER %s", pin->APinPartialCutAreaLayer(i)); +
+ ++ } +
++ } +
+ ++ for (j = 0; j < pin->numAntennaModel(); j++) { +
++ aModel = pin->antennaModel(j); +
+ ++ fprintf(fout, "ANTENNAMODEL %s\n", +
++ aModel->defiPinAntennaModel::antennaOxide()); +
+ ++ if (aModel->hasAPinGateArea()) { +
++ for (i = 0; i < aModel->defiPinAntennaModel::numAPinGateArea(); +
++ i++) { +
++ fprintf(fout, "ANTENNAPINGATEAREA %d", +
+ ++ if (aModel->hasAPinGateAreaLayer(i)) +
++ fprintf(fout, " LAYER %s", aModel->APinGateAreaLayer(i)); +
+ ++ } +
++ } +
++ if (aModel->hasAPinMaxAreaCar()) { +
++ for (i = 0; +
++ i < aModel->defiPinAntennaModel::numAPinMaxAreaCar(); i++) { +
++ fprintf(fout, "ANTENNAPINMAXAREACAR %d", +
++ aModel->APinMaxAreaCar(i)); +
++ if (aModel->hasAPinMaxAreaCarLayer(i)) +
++ fprintf(fout, +
++ " LAYER %s", aModel->APinMaxAreaCarLayer(i)); +
+ ++ } +
++ } +
++ if (aModel->hasAPinMaxSideAreaCar()) { +
++ for (i = 0; +
++ i < aModel->defiPinAntennaModel::numAPinMaxSideAreaCar(); +
++ i++) { +
++ fprintf(fout, "ANTENNAPINMAXSIDEAREACAR %d", +
++ aModel->APinMaxSideAreaCar(i)); +
++ if (aModel->hasAPinMaxSideAreaCarLayer(i)) +
++ fprintf(fout, +
++ " LAYER %s", aModel->APinMaxSideAreaCarLayer(i)); +
+ ++ } +
++ } +
++ if (aModel->hasAPinMaxCutCar()) { +
++ for (i = 0; i < aModel->defiPinAntennaModel::numAPinMaxCutCar(); +
++ i++) { +
++ fprintf(fout, "ANTENNAPINMAXCUTCAR %d", +
++ aModel->APinMaxCutCar(i)); +
++ if (aModel->hasAPinMaxCutCarLayer(i)) +
++ fprintf(fout, " LAYER %s", +
++ aModel->APinMaxCutCarLayer(i)); +
+ ++ } +
++ } +
++ } +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END PINS\n"); +
++ break; +
++ case defrDefaultCapCbkType : +
++ i = (long)cl; +
++ fprintf(fout, "DEFAULTCAP %d\n", i); +
++ numObjs = i; +
++ break; +
+ + ++ fprintf(fout, "ROW %s %s %g %g %s ", row->defiRow::name(), +
++ row->defiRow::macro(), row->defiRow::x(), row->defiRow::y(), +
++ orientStr(row->defiRow::orient())); +
++ if (row->defiRow::hasDo()) { +
++ fprintf(fout, "DO %g BY %g ", +
++ row->defiRow::xNum(), row->defiRow::yNum()); +
++ if (row->defiRow::hasDoStep()) +
++ fprintf(fout, "STEP %g %g ;\n", +
++ row->defiRow::xStep(), row->defiRow::yStep()); +
++ else +
+ ++ } else +
+ ++ if (row->defiRow::numProps() > 0) { +
++ for (i = 0; i < row->defiRow::numProps(); i++) { +
++ fprintf(fout, " + PROPERTY %s %s ", +
++ row->defiRow::propName(i), +
++ row->defiRow::propValue(i)); +
++ switch (row->defiRow::propType(i)) { +
++ case 'R': fprintf(fout, "REAL "); +
++ break; +
++ case 'I': fprintf(fout, "INTEGER "); +
++ break; +
++ case 'S': fprintf(fout, "STRING "); +
++ break; +
++ case 'Q': fprintf(fout, "QUOTESTRING "); +
++ break; +
++ case 'N': fprintf(fout, "NUMBER "); +
++ break; +
++ } +
++ } +
+ ++ } +
++ break; +
+ + ++ fprintf(fout, "TRACKS %s %g DO %g STEP %g LAYER ", +
++ track->defiTrack::macro(), track->defiTrack::x(), +
++ track->defiTrack::xNum(), track->defiTrack::xStep()); +
++ for (i = 0; i < track->defiTrack::numLayers(); i++) +
++ fprintf(fout, "%s ", track->defiTrack::layer(i)); +
+ ++ break; +
++ case defrGcellGridCbkType : +
+ ++ fprintf(fout, "GCELLGRID %s %d DO %d STEP %g ;\n", +
++ gcg->defiGcellGrid::macro(), gcg->defiGcellGrid::x(), +
++ gcg->defiGcellGrid::xNum(), gcg->defiGcellGrid::xStep()); +
++ break; +
+ + ++ fprintf(fout, "- %s ", via->defiVia::name()); +
++ if (via->defiVia::hasPattern()) +
++ fprintf(fout, "+ PATTERNNAME %s ", via->defiVia::pattern()); +
++ for (i = 0; i < via->defiVia::numLayers(); i++) { +
++ via->defiVia::layer(i, &name, &xl, &yl, &xh, &yh); +
++ fprintf(fout, "+ RECT %s %d %d %d %d \n", +
+ ++ } +
++ // POLYGON +
++ if (via->defiVia::numPolygons()) { +
+ ++ for (i = 0; i < via->defiVia::numPolygons(); i++) { +
++ fprintf(fout, "\n + POLYGON %s ", via->polygonName(i)); +
++ points = via->getPolygon(i); +
++ for (j = 0; j < points.numPoints; j++) +
++ fprintf(fout, "%d %d ", points.x[j], points.y[j]); +
++ } +
++ } +
+ ++ if (via->defiVia::hasViaRule()) { +
+ ++ int xs, ys, xcs, ycs, xbe, ybe, xte, yte; +
++ int cr, cc, xo, yo, xbo, ybo, xto, yto; +
++ (void)via->defiVia::viaRule(&vrn, &xs, &ys, &bl, &cl, &tl, &xcs, +
++ &ycs, &xbe, &ybe, &xte, &yte); +
++ fprintf(fout, "+ VIARULE '%s'\n", vrn); +
++ fprintf(fout, " + CUTSIZE %d %d\n", xs, ys); +
++ fprintf(fout, " + LAYERS %s %s %s\n", bl, cl, tl); +
++ fprintf(fout, " + CUTSPACING %d %d\n", xcs, ycs); +
++ fprintf(fout, " + ENCLOSURE %d %d %d %d\n", xbe, ybe, xte, yte); +
++ if (via->defiVia::hasRowCol()) { +
++ (void)via->defiVia::rowCol(&cr, &cc); +
++ fprintf(fout, " + ROWCOL %d %d\n", cr, cc); +
++ } +
++ if (via->defiVia::hasOrigin()) { +
++ (void)via->defiVia::origin(&xo, &yo); +
++ fprintf(fout, " + ORIGIN %d %d\n", xo, yo); +
++ } +
++ if (via->defiVia::hasOffset()) { +
++ (void)via->defiVia::offset(&xbo, &ybo, &xto, &yto); +
++ fprintf(fout, " + OFFSET %d %d %d %d\n", xbo, ybo, xto, yto); +
++ } +
++ if (via->defiVia::hasCutPattern()) +
++ fprintf(fout, " + PATTERN '%s'\n", via->defiVia::cutPattern()); +
++ } +
++ --numObjs; +
+ ++ fprintf(fout, "END VIAS\n"); +
++ break; +
+ + ++ fprintf(fout, "- %s ", re->defiRegion::name()); +
++ for (i = 0; i < re->defiRegion::numRectangles(); i++) +
++ fprintf(fout, "%d %d %d %d \n", re->defiRegion::xl(i), +
++ re->defiRegion::yl(i), re->defiRegion::xh(i), +
+ ++ if (re->defiRegion::hasType()) +
++ fprintf(fout, "+ TYPE %s\n", re->defiRegion::type()); +
++ if (re->defiRegion::numProps()) { +
++ for (i = 0; i < re->defiRegion::numProps(); i++) { +
++ fprintf(fout, "+ PROPERTY %s %s ", re->defiRegion::propName(i), +
++ re->defiRegion::propValue(i)); +
++ switch (re->defiRegion::propType(i)) { +
++ case 'R': fprintf(fout, "REAL "); +
++ break; +
++ case 'I': fprintf(fout, "INTEGER "); +
++ break; +
++ case 'S': fprintf(fout, "STRING "); +
++ break; +
++ case 'Q': fprintf(fout, "QUOTESTRING "); +
++ break; +
++ case 'N': fprintf(fout, "NUMBER "); +
++ break; +
++ } +
++ } +
++ } +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END REGIONS\n"); +
++ } +
++ break; +
++ case defrGroupNameCbkType : +
++ if ((char*)cl) { +
++ fprintf(fout, "- %s", (char*)cl); +
++ break; +
++ } +
++ case defrGroupMemberCbkType : +
++ if ((char*)cl) { +
++ fprintf(fout, " %s", (char*)cl); +
++ break; +
++ } +
+ + ++ if (group->defiGroup::hasMaxX() | group->defiGroup::hasMaxY() +
++ | group->defiGroup::hasPerim()) { +
++ fprintf(fout, "\n + SOFT "); +
++ if (group->defiGroup::hasPerim()) +
++ fprintf(fout, "MAXHALFPERIMETER %d ", +
++ group->defiGroup::perim()); +
++ if (group->defiGroup::hasMaxX()) +
++ fprintf(fout, "MAXX %d ", group->defiGroup::maxX()); +
++ if (group->defiGroup::hasMaxY()) +
++ fprintf(fout, "MAXY %d ", group->defiGroup::maxY()); +
++ } +
++ if (group->defiGroup::hasRegionName()) +
++ fprintf(fout, "\n + REGION %s ", group->defiGroup::regionName()); +
++ if (group->defiGroup::hasRegionBox()) { +
++ int *gxl, *gyl, *gxh, *gyh; +
++ int size; +
++ group->defiGroup::regionRects(&size, &gxl, &gyl, &gxh, &gyh); +
++ for (i = 0; i < size; i++) +
++ fprintf(fout, "REGION %d %d %d %d ", gxl[i], gyl[i], +
++ gxh[i], gyh[i]); +
++ } +
++ if (group->defiGroup::numProps()) { +
++ for (i = 0; i < group->defiGroup::numProps(); i++) { +
++ fprintf(fout, "\n + PROPERTY %s %s ", +
++ group->defiGroup::propName(i), +
++ group->defiGroup::propValue(i)); +
++ switch (group->defiGroup::propType(i)) { +
++ case 'R': fprintf(fout, "REAL "); +
++ break; +
++ case 'I': fprintf(fout, "INTEGER "); +
++ break; +
++ case 'S': fprintf(fout, "STRING "); +
++ break; +
++ case 'Q': fprintf(fout, "QUOTESTRING "); +
++ break; +
++ case 'N': fprintf(fout, "NUMBER "); +
++ break; +
++ } +
++ } +
++ } +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END GROUPS\n"); +
++ break; +
++ case defrScanchainCbkType : +
+ ++ fprintf(fout, "- %s\n", sc->defiScanchain::name()); +
++ if (sc->defiScanchain::hasStart()) { +
++ sc->defiScanchain::start(&a1, &b1); +
++ fprintf(fout, " + START %s %s\n", a1, b1); +
++ } +
++ if (sc->defiScanchain::hasStop()) { +
++ sc->defiScanchain::stop(&a1, &b1); +
++ fprintf(fout, " + STOP %s %s\n", a1, b1); +
++ } +
++ if (sc->defiScanchain::hasCommonInPin() || +
++ sc->defiScanchain::hasCommonOutPin()) { +
++ fprintf(fout, " + COMMONSCANPINS "); +
++ if (sc->defiScanchain::hasCommonInPin()) +
++ fprintf(fout, " ( IN %s ) ", sc->defiScanchain::commonInPin()); +
++ if (sc->defiScanchain::hasCommonOutPin()) +
++ fprintf(fout, " ( OUT %s ) ",sc->defiScanchain::commonOutPin()); +
+ ++ } +
++ if (sc->defiScanchain::hasFloating()) { +
++ sc->defiScanchain::floating(&size, &inst, &inPin, &outPin, &bits); +
++ if (size > 0) +
++ fprintf(fout, " + FLOATING\n"); +
++ for (i = 0; i < size; i++) { +
++ fprintf(fout, " %s ", inst[i]); +
++ if (inPin[i]) +
++ fprintf(fout, "( IN %s ) ", inPin[i]); +
++ if (outPin[i]) +
++ fprintf(fout, "( OUT %s ) ", outPin[i]); +
+ ++ fprintf(fout, "( BITS %d ) ", bits[i]); +
+ ++ } +
++ } +
+ ++ if (sc->defiScanchain::hasOrdered()) { +
++ for (i = 0; i < sc->defiScanchain::numOrderedLists(); i++) { +
++ sc->defiScanchain::ordered(i, &size, &inst, &inPin, &outPin, +
++ &bits); +
++ if (size > 0) +
++ fprintf(fout, " + ORDERED\n"); +
++ for (j = 0; j < size; j++) { +
++ fprintf(fout, " %s ", inst[j]); +
++ if (inPin[j]) +
++ fprintf(fout, "( IN %s ) ", inPin[j]); +
++ if (outPin[j]) +
++ fprintf(fout, "( OUT %s ) ", outPin[j]); +
+ ++ fprintf(fout, "( BITS %d ) ", bits[j]); +
+ ++ } +
++ } +
++ } +
+ ++ if (sc->defiScanchain::hasPartition()) { +
++ fprintf(fout, " + PARTITION %s ", +
++ sc->defiScanchain::partitionName()); +
++ if (sc->defiScanchain::hasPartitionMaxBits()) +
++ fprintf(fout, "MAXBITS %d ", +
++ sc->defiScanchain::partitionMaxBits()); +
++ } +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END SCANCHAINS\n"); +
++ break; +
++ case defrIOTimingCbkType : +
+ ++ fprintf(fout, "- ( %s %s )\n", iot->defiIOTiming::inst(), +
++ iot->defiIOTiming::pin()); +
++ if (iot->defiIOTiming::hasSlewRise()) +
++ fprintf(fout, " + RISE SLEWRATE %g %g\n", +
++ iot->defiIOTiming::slewRiseMin(), +
++ iot->defiIOTiming::slewRiseMax()); +
++ if (iot->defiIOTiming::hasSlewFall()) +
++ fprintf(fout, " + FALL SLEWRATE %g %g\n", +
++ iot->defiIOTiming::slewFallMin(), +
++ iot->defiIOTiming::slewFallMax()); +
++ if (iot->defiIOTiming::hasVariableRise()) +
++ fprintf(fout, " + RISE VARIABLE %g %g\n", +
++ iot->defiIOTiming::variableRiseMin(), +
++ iot->defiIOTiming::variableRiseMax()); +
++ if (iot->defiIOTiming::hasVariableFall()) +
++ fprintf(fout, " + FALL VARIABLE %g %g\n", +
++ iot->defiIOTiming::variableFallMin(), +
++ iot->defiIOTiming::variableFallMax()); +
++ if (iot->defiIOTiming::hasCapacitance()) +
++ fprintf(fout, " + CAPACITANCE %g\n", +
++ iot->defiIOTiming::capacitance()); +
++ if (iot->defiIOTiming::hasDriveCell()) { +
++ fprintf(fout, " + DRIVECELL %s ", +
++ iot->defiIOTiming::driveCell()); +
++ if (iot->defiIOTiming::hasFrom()) +
++ fprintf(fout, " FROMPIN %s ", +
++ iot->defiIOTiming::from()); +
++ if (iot->defiIOTiming::hasTo()) +
++ fprintf(fout, " TOPIN %s ", +
+ ++ if (iot->defiIOTiming::hasParallel()) +
++ fprintf(fout, "PARALLEL %g", +
++ iot->defiIOTiming::parallel()); +
+ ++ } +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END IOTIMINGS\n"); +
++ break; +
+ + ++ fprintf(fout, "- %s ", fpc->defiFPC::name()); +
++ if (fpc->defiFPC::isVertical()) +
++ fprintf(fout, "VERTICAL "); +
++ if (fpc->defiFPC::isHorizontal()) +
++ fprintf(fout, "HORIZONTAL "); +
++ if (fpc->defiFPC::hasAlign()) +
+ ++ if (fpc->defiFPC::hasMax()) +
++ fprintf(fout, "%g ", fpc->defiFPC::alignMax()); +
++ if (fpc->defiFPC::hasMin()) +
++ fprintf(fout, "%g ", fpc->defiFPC::alignMin()); +
++ if (fpc->defiFPC::hasEqual()) +
++ fprintf(fout, "%g ", fpc->defiFPC::equal()); +
++ for (i = 0; i < fpc->defiFPC::numParts(); i++) { +
++ fpc->defiFPC::getPart(i, &corner, &typ, &name); +
+ ++ fprintf(fout, "BOTTOMLEFT "); +
++ else +
++ fprintf(fout, "TOPRIGHT "); +
++ if (typ == 'R') +
++ fprintf(fout, "ROWS %s ", name); +
++ else +
++ fprintf(fout, "COMPS %s ", name); +
++ } +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END FLOORPLANCONSTRAINTS\n"); +
++ break; +
++ case defrTimingDisableCbkType : +
++ td = (defiTimingDisable*)cl; +
++ if (td->defiTimingDisable::hasFromTo()) +
++ fprintf(fout, "- FROMPIN %s %s ", +
++ td->defiTimingDisable::fromInst(), +
++ td->defiTimingDisable::fromPin(), +
++ td->defiTimingDisable::toInst(), +
++ td->defiTimingDisable::toPin()); +
++ if (td->defiTimingDisable::hasThru()) +
++ fprintf(fout, "- THRUPIN %s %s ", +
++ td->defiTimingDisable::thruInst(), +
++ td->defiTimingDisable::thruPin()); +
++ if (td->defiTimingDisable::hasMacroFromTo()) +
++ fprintf(fout, "- MACRO %s FROMPIN %s %s ", +
++ td->defiTimingDisable::macroName(), +
++ td->defiTimingDisable::fromPin(), +
++ td->defiTimingDisable::toPin()); +
++ if (td->defiTimingDisable::hasMacroThru()) +
++ fprintf(fout, "- MACRO %s THRUPIN %s %s ", +
++ td->defiTimingDisable::macroName(), +
++ td->defiTimingDisable::fromPin()); +
+ ++ break; +
++ case defrPartitionCbkType : +
++ part = (defiPartition*)cl; +
++ fprintf(fout, "- %s ", part->defiPartition::name()); +
++ if (part->defiPartition::isSetupRise() | +
++ part->defiPartition::isSetupFall() | +
++ part->defiPartition::isHoldRise() | +
++ part->defiPartition::isHoldFall()) { +
++ // has turnoff +
++ fprintf(fout, "TURNOFF "); +
++ if (part->defiPartition::isSetupRise()) +
++ fprintf(fout, "SETUPRISE "); +
++ if (part->defiPartition::isSetupFall()) +
++ fprintf(fout, "SETUPFALL "); +
++ if (part->defiPartition::isHoldRise()) +
++ fprintf(fout, "HOLDRISE "); +
++ if (part->defiPartition::isHoldFall()) +
++ fprintf(fout, "HOLDFALL "); +
++ } +
++ itemT = part->defiPartition::itemType(); +
++ dir = part->defiPartition::direction(); +
++ if (strcmp(itemT, "CLOCK") == 0) { +
++ if (dir == 'T') // toclockpin +
++ fprintf(fout, "+ TOCLOCKPIN %s %s ", +
++ part->defiPartition::instName(), +
++ part->defiPartition::pinName()); +
++ if (dir == 'F') // fromclockpin +
++ fprintf(fout, "+ FROMCLOCKPIN %s %s ", +
++ part->defiPartition::instName(), +
++ part->defiPartition::pinName()); +
++ if (part->defiPartition::hasMin()) +
++ fprintf(fout, "MIN %g %g ", +
++ part->defiPartition::partitionMin(), +
++ part->defiPartition::partitionMax()); +
++ if (part->defiPartition::hasMax()) +
++ fprintf(fout, "MAX %g %g ", +
++ part->defiPartition::partitionMin(), +
++ part->defiPartition::partitionMax()); +
+ ++ for (i = 0; i < part->defiPartition::numPins(); i++) +
++ fprintf(fout, "%s ", part->defiPartition::pin(i)); +
++ } else if (strcmp(itemT, "IO") == 0) { +
++ if (dir == 'T') // toiopin +
++ fprintf(fout, "+ TOIOPIN %s %s ", +
++ part->defiPartition::instName(), +
++ part->defiPartition::pinName()); +
++ if (dir == 'F') // fromiopin +
++ fprintf(fout, "+ FROMIOPIN %s %s ", +
++ part->defiPartition::instName(), +
++ part->defiPartition::pinName()); +
++ } else if (strcmp(itemT, "COMP") == 0) { +
++ if (dir == 'T') // tocomppin +
++ fprintf(fout, "+ TOCOMPPIN %s %s ", +
++ part->defiPartition::instName(), +
++ part->defiPartition::pinName()); +
++ if (dir == 'F') // fromcomppin +
++ fprintf(fout, "+ FROMCOMPPIN %s %s ", +
++ part->defiPartition::instName(), +
++ part->defiPartition::pinName()); +
++ } +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END PARTITIONS\n"); +
++ break; +
+ + + ++ if (pprop->defiPinProp::isPin()) +
++ fprintf(fout, "- PIN %s ", pprop->defiPinProp::pinName()); +
++ else +
+ ++ pprop->defiPinProp::instName(), +
++ pprop->defiPinProp::pinName()); +
+ ++ if (pprop->defiPinProp::numProps() > 0) { +
++ for (i = 0; i < pprop->defiPinProp::numProps(); i++) { +
++ fprintf(fout, " + PROPERTY %s %s ", +
++ pprop->defiPinProp::propName(i), +
++ pprop->defiPinProp::propValue(i)); +
++ switch (pprop->defiPinProp::propType(i)) { +
++ case 'R': fprintf(fout, "REAL "); +
++ break; +
++ case 'I': fprintf(fout, "INTEGER "); +
++ break; +
++ case 'S': fprintf(fout, "STRING "); +
++ break; +
++ case 'Q': fprintf(fout, "QUOTESTRING "); +
++ break; +
++ case 'N': fprintf(fout, "NUMBER "); +
++ break; +
++ } +
++ } +
+ ++ } +
++ --numObjs; +
+ ++ fprintf(fout, "END PINPROPERTIES\n"); +
++ break; +
++ case defrBlockageCbkType : +
++ block = (defiBlockage*)cl; +
++ if (block->defiBlockage::hasLayer()) { +
++ fprintf(fout, "- LAYER %s\n", block->defiBlockage::layerName()); +
++ if (block->defiBlockage::hasComponent()) +
++ fprintf(fout, " + COMPONENT %s\n", +
++ block->defiBlockage::layerComponentName()); +
++ if (block->defiBlockage::hasSlots()) +
++ fprintf(fout, " + SLOTS\n"); +
++ if (block->defiBlockage::hasFills()) +
++ fprintf(fout, " + FILLS\n"); +
++ if (block->defiBlockage::hasPushdown()) +
++ fprintf(fout, " + PUSHDOWN\n"); +
++ if (block->defiBlockage::hasExceptpgnet()) +
++ fprintf(fout, " + EXCEPTPGNET\n"); +
++ if (block->defiBlockage::hasSpacing()) +
++ fprintf(fout, " + SPACING %d\n", +
++ block->defiBlockage::minSpacing()); +
++ if (block->defiBlockage::hasDesignRuleWidth()) +
++ fprintf(fout, " + DESIGNRULEWIDTH %d\n", +
++ block->defiBlockage::designRuleWidth()); +
++ } +
++ else if (block->defiBlockage::hasPlacement()) { +
++ fprintf(fout, "- PLACEMENT\n"); +
++ if (block->defiBlockage::hasSoft()) +
++ fprintf(fout, " + SOFT\n"); +
++ if (block->defiBlockage::hasPartial()) +
++ fprintf(fout, " + PARTIAL %g\n", +
++ block->defiBlockage::placementMaxDensity()); +
++ if (block->defiBlockage::hasComponent()) +
++ fprintf(fout, " + COMPONENT %s\n", +
++ block->defiBlockage::placementComponentName()); +
++ if (block->defiBlockage::hasPushdown()) +
++ fprintf(fout, " + PUSHDOWN\n"); +
++ } +
+ ++ for (i = 0; i < block->defiBlockage::numRectangles(); i++) { +
++ fprintf(fout, " RECT %d %d %d %d\n", +
++ block->defiBlockage::xl(i), block->defiBlockage::yl(i), +
++ block->defiBlockage::xh(i), block->defiBlockage::yh(i)); +
++ } +
+ ++ for (i = 0; i < block->defiBlockage::numPolygons(); i++) { +
++ fprintf(fout, " POLYGON "); +
++ points = block->getPolygon(i); +
++ for (j = 0; j < points.numPoints; j++) +
++ fprintf(fout, "%d %d ", points.x[j], points.y[j]); +
+ ++ } +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END BLOCKAGES\n"); +
++ break; +
+ + ++ if (slots->defiSlot::hasLayer()) +
++ fprintf(fout, "- LAYER %s\n", slots->defiSlot::layerName()); +
+ ++ for (i = 0; i < slots->defiSlot::numRectangles(); i++) { +
++ fprintf(fout, " RECT %d %d %d %d\n", +
++ slots->defiSlot::xl(i), slots->defiSlot::yl(i), +
++ slots->defiSlot::xh(i), slots->defiSlot::yh(i)); +
++ } +
++ for (i = 0; i < slots->defiSlot::numPolygons(); i++) { +
++ fprintf(fout, " POLYGON "); +
++ points = slots->getPolygon(i); +
++ for (j = 0; j < points.numPoints; j++) +
++ fprintf(fout, "%d %d ", points.x[j], points.y[j]); +
+ ++ } +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END SLOTS\n"); +
++ break; +
+ + ++ if (fills->defiFill::hasLayer()) { +
++ fprintf(fout, "- LAYER %s", fills->defiFill::layerName()); +
++ if (fills->defiFill::hasLayerOpc()) +
+ + + ++ for (i = 0; i < fills->defiFill::numRectangles(); i++) { +
++ fprintf(fout, " RECT %d %d %d %d\n", +
++ fills->defiFill::xl(i), fills->defiFill::yl(i), +
++ fills->defiFill::xh(i), fills->defiFill::yh(i)); +
++ } +
++ for (i = 0; i < fills->defiFill::numPolygons(); i++) { +
++ fprintf(fout, " POLYGON "); +
++ points = fills->getPolygon(i); +
++ for (j = 0; j < points.numPoints; j++) +
++ fprintf(fout, "%d %d ", points.x[j], points.y[j]); +
+ ++ } +
+ ++ } +
++ --numObjs; +
++ if (fills->defiFill::hasVia()) { +
++ fprintf(fout, "- VIA %s", fills->defiFill::viaName()); +
++ if (fills->defiFill::hasViaOpc()) +
+ + + ++ for (i = 0; i < fills->defiFill::numViaPts(); i++) { +
++ points = fills->getViaPts(i); +
++ for (j = 0; j < points.numPoints; j++) +
++ fprintf(fout, " %d %d", points.x[j], points.y[j]); +
+ ++ } +
+ ++ } +
+ ++ fprintf(fout, "END FILLS\n"); +
++ break; +
+ + + ++ fprintf(fout, "- STYLE %d ", styles->defiStyles::style()); +
++ points = styles->defiStyles::getPolygon(); +
++ for (j = 0; j < points.numPoints; j++) +
++ fprintf(fout, "%d %d ", points.x[j], points.y[j]); +
+ ++ --numObjs; +
+ ++ fprintf(fout, "END STYLES\n"); +
++ break; +
+ ++ default: fprintf(fout, "BOGUS callback to cls.\n"); return 1; +
++ } +
++ return 0; +
++ } +
+ + ++ int dn(defrCallbackType_e c, const char* h, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "DIVIDERCHAR \"%s\" ;\n",h); +
++ return 0; +
++ } +
+ + ++ int ext(defrCallbackType_e t, const char* c, defiUserData ud) { +
++ char* name; +
+ ++ checkType(t); +
++ if ((long)ud != userData) dataError(); +
+ ++ switch (t) { +
++ case defrNetExtCbkType : name = address("net"); break; +
++ case defrComponentExtCbkType : name = address("component"); break; +
++ case defrPinExtCbkType : name = address("pin"); break; +
++ case defrViaExtCbkType : name = address("via"); break; +
++ case defrNetConnectionExtCbkType : name = address("net connection"); break; +
++ case defrGroupExtCbkType : name = address("group"); break; +
++ case defrScanChainExtCbkType : name = address("scanchain"); break; +
++ case defrIoTimingsExtCbkType : name = address("io timing"); break; +
++ case defrPartitionsExtCbkType : name = address("partition"); break; +
++ default: name = address("BOGUS"); return 1; +
++ } +
++ fprintf(fout, " %s extension %s\n", name, c); +
++ return 0; +
++ } +
+ ++ int extension(defrCallbackType_e c, const char* extsn, defiUserData ud) { +
++ checkType(c); +
++ if ((long)ud != userData) dataError(); +
++ fprintf(fout, "BEGINEXT %s\n", extsn); +
++ return 0; +
++ } +
+ ++ void* mallocCB(int size) { +
+ ++ } +
+ ++ void* reallocCB(void* name, int size) { +
++ return realloc(name, size); +
++ } +
+ + ++ free(name); +
++ return; +
++ } +
+ ++ void lineNumberCB(int lineNo) { +
++ fprintf(fout, "Parsed %d number of lines!!\n", lineNo); +
++ return; +
++ } +
+ ++ int main(int argc, char** argv) { +
++ int num = 1734; +
++ char* inFile[6]; +
++ char* outFile; +
++ FILE* f; +
++ int res; +
++ int noCalls = 0; +
++ int retStr = 0; +
+ ++ int fileCt = 0; +
+ ++ strcpy(defaultName, "def.in"); +
++ strcpy(defaultOut, "list"); +
+ + ++ fout = stdout; +
+ + ++ argc--; +
++ argv++; +
++ while (argc--) { +
+ ++ if (strcmp(*argv, "-d") == 0) { +
++ argv++; +
++ argc--; +
++ sscanf(*argv, "%d", &num); +
+ + ++ } else if (strcmp(*argv, "-nc") == 0) { +
++ noCalls = 1; +
+ ++ } else if (strcmp(*argv, "-o") == 0) { +
++ argv++; +
++ argc--; +
++ outFile = *argv; +
++ if ((fout = fopen(outFile, "w")) == 0) { +
++ fprintf(stderr, "ERROR: could not open output file\n"); +
++ return 2; +
++ } +
+ ++ } else if (strcmp(*argv, "-verStr") == 0) { +
++ /* New to set the version callback routine to return a string */ +
+ ++ retStr = 1; +
+ ++ } else if (argv[0][0] != '-') { +
+ ++ fprintf(stderr, "ERROR: too many input files, max = 6.\n"); +
++ return 2; +
++ } +
++ inFile[numInFile++] = *argv; +
++ } else if (strcmp(*argv, "-h") == 0) { +
++ fprintf(stderr, "Usage: defrw [<defFilename>] [-o <outputFilename>]\n"); +
++ return 2; +
++ } else if (strcmp(*argv, "-setSNetWireCbk") == 0) { +
+ ++ } else { +
++ fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv); +
++ return 2; +
++ } +
+ ++ argv++; +
++ } +
+ + ++ defrSetUserData((void*)3); +
+ ++ defrSetTechnologyCbk(tname); +
++ defrSetExtensionCbk(extension); +
++ defrSetDesignEndCbk(done); +
++ defrSetPropDefStartCbk(propstart); +
+ ++ defrSetPropDefEndCbk(propend); +
+ ++ defrSetNetNameCbk(netNamef); +
++ defrSetNetNonDefaultRuleCbk(nondefRulef); +
++ defrSetNetSubnetNameCbk(subnetNamef); +
++ defrSetNetPartialPathCbk(netpath); +
+ ++ defrSetSNetPartialPathCbk(snetpath); +
+ ++ defrSetSNetWireCbk(snetwire); +
++ defrSetComponentCbk(compf); +
+ + ++ defrSetConstraintCbk(constraint); +
++ defrSetAssertionCbk(constraint); +
+ ++ defrSetFloorPlanNameCbk(fn); +
+ + ++ defrSetNonDefaultCbk(ndr); +
+ ++ defrSetAssertionsStartCbk(constraintst); +
++ defrSetConstraintsStartCbk(constraintst); +
++ defrSetComponentStartCbk(cs); +
++ defrSetPinPropStartCbk(cs); +
+ + + ++ defrSetRegionStartCbk(cs); +
+ ++ defrSetGroupsStartCbk(cs); +
++ defrSetScanchainsStartCbk(cs); +
++ defrSetIOTimingsStartCbk(cs); +
+ ++ defrSetTimingDisablesStartCbk(cs); +
++ defrSetPartitionsStartCbk(cs); +
++ defrSetBlockageStartCbk(cs); +
+ + ++ defrSetNonDefaultStartCbk(cs); +
++ defrSetStylesStartCbk(cs); +
+ ++ // All of the extensions point to the same function. +
+ ++ defrSetComponentExtCbk(ext); +
+ + ++ defrSetNetConnectionExtCbk(ext); +
+ ++ defrSetScanChainExtCbk(ext); +
++ defrSetIoTimingsExtCbk(ext); +
++ defrSetPartitionsExtCbk(ext); +
+ + ++ if (!retStr) +
+ ++ else +
++ defrSetVersionStrCbk(versStr); +
++ defrSetCaseSensitiveCbk(casesens); +
+ ++ // The following calls are an example of using one function "cls" +
++ // to be the callback for many DIFFERENT types of constructs. +
++ // We have to cast the function type to meet the requirements +
++ // of each different set function. +
++ defrSetSiteCbk((defrSiteCbkFnType)cls); +
++ defrSetCanplaceCbk((defrSiteCbkFnType)cls); +
++ defrSetCannotOccupyCbk((defrSiteCbkFnType)cls); +
++ defrSetDieAreaCbk((defrBoxCbkFnType)cls); +
++ defrSetPinCapCbk((defrPinCapCbkFnType)cls); +
++ defrSetPinCbk((defrPinCbkFnType)cls); +
++ defrSetPinPropCbk((defrPinPropCbkFnType)cls); +
++ defrSetDefaultCapCbk((defrIntegerCbkFnType)cls); +
++ defrSetRowCbk((defrRowCbkFnType)cls); +
++ defrSetTrackCbk((defrTrackCbkFnType)cls); +
++ defrSetGcellGridCbk((defrGcellGridCbkFnType)cls); +
++ defrSetViaCbk((defrViaCbkFnType)cls); +
++ defrSetRegionCbk((defrRegionCbkFnType)cls); +
++ defrSetGroupNameCbk((defrStringCbkFnType)cls); +
++ defrSetGroupMemberCbk((defrStringCbkFnType)cls); +
++ defrSetGroupCbk((defrGroupCbkFnType)cls); +
++ defrSetScanchainCbk((defrScanchainCbkFnType)cls); +
++ defrSetIOTimingCbk((defrIOTimingCbkFnType)cls); +
++ defrSetFPCCbk((defrFPCCbkFnType)cls); +
++ defrSetTimingDisableCbk((defrTimingDisableCbkFnType)cls); +
++ defrSetPartitionCbk((defrPartitionCbkFnType)cls); +
++ defrSetBlockageCbk((defrBlockageCbkFnType)cls); +
++ defrSetSlotCbk((defrSlotCbkFnType)cls); +
++ defrSetFillCbk((defrFillCbkFnType)cls); +
++ defrSetStylesCbk((defrStylesCbkFnType)cls); +
+ ++ defrSetAssertionsEndCbk(endfunc); +
++ defrSetComponentEndCbk(endfunc); +
++ defrSetConstraintsEndCbk(endfunc); +
++ defrSetNetEndCbk(endfunc); +
++ defrSetFPCEndCbk(endfunc); +
++ defrSetFPCEndCbk(endfunc); +
++ defrSetGroupsEndCbk(endfunc); +
++ defrSetIOTimingsEndCbk(endfunc); +
++ defrSetNetEndCbk(endfunc); +
++ defrSetPartitionsEndCbk(endfunc); +
++ defrSetRegionEndCbk(endfunc); +
++ defrSetSNetEndCbk(endfunc); +
++ defrSetScanchainsEndCbk(endfunc); +
++ defrSetPinEndCbk(endfunc); +
++ defrSetTimingDisablesEndCbk(endfunc); +
++ defrSetViaEndCbk(endfunc); +
++ defrSetPinPropEndCbk(endfunc); +
++ defrSetBlockageEndCbk(endfunc); +
++ defrSetSlotEndCbk(endfunc); +
++ defrSetFillEndCbk(endfunc); +
++ defrSetNonDefaultEndCbk(endfunc); +
++ defrSetStylesEndCbk(endfunc); +
+ ++ defrSetMallocFunction(mallocCB); +
++ defrSetReallocFunction(reallocCB); +
++ defrSetFreeFunction(freeCB); +
+ ++ defrSetLineNumberFunction(lineNumberCB); +
++ defrSetDeltaNumberLines(50); +
+ ++ // Testing to set the number of warnings +
++ defrSetAssertionWarnings(3); +
++ defrSetBlockageWarnings(3); +
++ defrSetCaseSensitiveWarnings(3); +
++ defrSetComponentWarnings(3); +
++ defrSetConstraintWarnings(0); +
++ defrSetDefaultCapWarnings(3); +
++ defrSetGcellGridWarnings(3); +
++ defrSetIOTimingWarnings(3); +
+ ++ defrSetNonDefaultWarnings(3); +
+ + + + ++ defrSetScanchainWarnings(3); +
+ + + + ++ defrSetVersionWarnings(3); +
+ ++ } +
+ ++ defrInit(); +
+ ++ for (fileCt = 0; fileCt < numInFile; fileCt++) { +
++ defrReset(); +
++ if ((f = fopen(inFile[fileCt],"r")) == 0) { +
++ fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]); +
++ return(2); +
++ } +
++ // Set case sensitive to 0 to start with, in History & PropertyDefinition +
+ ++ res = defrRead(f, inFile[fileCt], (void*)userData, 1); +
+ ++ if (res) +
++ fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]); +
+ ++ (void)defrPrintUnusedCallbacks(fout); +
++ (void)defrReleaseNResetMemory(); +
+ ++ } +
++ fclose(fout); +
+ ++ return res; +
++ } +
+ ++ #ifndef WIN32 +
+ + + + + + + ++ FILE* fout; +
+ ++ #define CHECK_STATUS(status) \ +
++ if (status) { \ +
+ + ++ } +
+ ++ int main(int argc, char** argv) { +
++ char* outfile; +
++ int status; // return code, if none 0 means error +
+ + + + ++ int *foreignX, *foreignY, *foreignOrient; +
++ const char** foreignOrientStr; +
++ const char **coorX, **coorY; +
+ + + ++ double *xP, *yP; +
+ + ++ strcpy(defaultOut, "def.in"); +
+ ++ fout = stdout; +
+ ++ argc--; +
++ argv++; +
++ while (argc--) { +
++ if (strcmp(*argv, "-o") == 0) { // output filename +
++ argv++; +
++ argc--; +
++ outfile = *argv; +
++ if ((fout = fopen(outfile, "w")) == 0) { +
++ fprintf(stderr, "ERROR: could not open output file\n"); +
++ return 2; +
++ } +
++ } else if (strncmp(*argv, "-h", 2) == 0) { // compare with -h[elp] +
++ fprintf(stderr, "Usage: defwrite [-o <filename>] [-help]\n"); +
++ return 1; +
++ } else { +
++ fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv); +
++ return 2; +
++ } +
++ argv++; +
++ } +
+ ++ status = defwInitCbk(fout); +
+ ++ status = defwVersion (5, 7); +
+ ++ status = defwDividerChar(":"); +
+ ++ status = defwBusBitChars("[]"); +
+ ++ status = defwDesignName("muk"); +
+ ++ status = defwTechnology("muk"); +
+ ++ status = defwArray("core_array"); +
+ ++ status = defwFloorplan("DEFAULT"); +
+ + + + ++ // initalize +
+ + + ++ // history +
++ status = defwHistory("Corrected STEP for ROW_9 and added ROW_10 of SITE CORE1 (def)"); +
+ ++ status = defwHistory("Removed NONDEFAULTRULE from the net XX100 (def)"); +
+ ++ status = defwHistory("Changed some cell orientations (def)"); +
+ + + + + ++ status = defwStartPropDef(); +
+ ++ defwAddComment("defwPropDef is broken into 3 routines, defwStringPropDef"); +
++ defwAddComment("defwIntPropDef, and defwRealPropDef"); +
++ status = defwStringPropDef("REGION", "scum", 0, 0, 0 ); +
+ ++ status = defwIntPropDef("REGION", "center", 0, 0, 0); +
+ ++ status = defwRealPropDef("REGION", "area", 0, 0, 0); +
+ ++ status = defwStringPropDef("GROUP", "ggrp", 0, 0, 0); +
+ ++ status = defwIntPropDef("GROUP", "site", 0, 25, 0); +
+ ++ status = defwRealPropDef("GROUP", "maxarea", 0, 0, 0); +
+ ++ status = defwStringPropDef("COMPONENT", "cc", 0, 0, 0); +
+ ++ status = defwIntPropDef("COMPONENT", "index", 0, 0, 0); +
+ ++ status = defwRealPropDef("COMPONENT", "size", 0, 0, 0); +
+ ++ status = defwIntPropDef("NET", "alt", 0, 0, 0); +
+ ++ status = defwStringPropDef("NET", "lastName", 0, 0, 0); +
+ ++ status = defwRealPropDef("NET", "length", 0, 0, 0); +
+ ++ status = defwStringPropDef("SPECIALNET", "contype", 0, 0, 0); +
+ ++ status = defwIntPropDef("SPECIALNET", "ind", 0, 0, 0); +
+ ++ status = defwRealPropDef("SPECIALNET", "maxlength", 0, 0, 0); +
+ ++ status = defwStringPropDef("DESIGN", "title", 0, 0, "Buffer"); +
+ ++ status = defwIntPropDef("DESIGN", "priority", 0, 0, 14); +
+ ++ status = defwRealPropDef("DESIGN", "howbig", 0, 0, 15.16); +
+ ++ status = defwRealPropDef("ROW", "minlength", 1.0, 100.0, 0); +
+ ++ status = defwStringPropDef("ROW", "firstName", 0, 0, 0); +
+ ++ status = defwIntPropDef("ROW", "idx", 0, 0, 0); +
+ ++ status = defwIntPropDef("COMPONENTPIN", "dpIgnoreTerm", 0, 0, 0); +
+ ++ status = defwStringPropDef("COMPONENTPIN", "dpBit", 0, 0, 0); +
+ ++ status = defwRealPropDef("COMPONENTPIN", "realProperty", 0, 0, 0); +
+ ++ status = defwStringPropDef("NET", "IGNOREOPTIMIZATION", 0, 0, 0); +
+ ++ status = defwStringPropDef("SPECIALNET", "IGNOREOPTIMIZATION", 0, 0, 0); +
+ ++ status = defwRealPropDef("NET", "FREQUENCY", 0, 0, 0); +
+ ++ status = defwRealPropDef("SPECIALNET", "FREQUENCY", 0, 0, 0); +
+ ++ status = defwStringPropDef("NONDEFAULTRULE", "ndprop1", 0, 0, 0); +
+ ++ status = defwIntPropDef("NONDEFAULTRULE", "ndprop2", 0, 0, 0); +
+ ++ status = defwRealPropDef("NONDEFAULTRULE", "ndprop3", 0, 0, 0.009); +
+ ++ status = defwRealPropDef("NONDEFAULTRULE", "ndprop4", .1, 1.0, 0); +
+ ++ status = defwEndPropDef(); +
+ + ++ // DIEAREA +
++ xPoints = (int*)malloc(sizeof(int)*6); +
++ yPoints = (int*)malloc(sizeof(int)*6); +
+ + + + + + + + + + + + ++ status = defwDieAreaList(6, xPoints, yPoints); +
+ + + + + + + ++ // ROW +
++ status = defwRow("ROW_9", "CORE", -177320, -111250, 6, 911, 1, 360, 0); +
+ ++ status = defwRealProperty("minlength", 50.5); +
+ ++ status = defwStringProperty("firstName", "Only"); +
+ ++ status = defwIntProperty("idx", 1); +
+ ++ status = defwRowStr("ROW_10", "CORE1", -19000, -11000, "FN", 1, 100, 0, 600); +
+ ++ status = defwRowStr("ROW_11", "CORE1", -19000, -11000, "FN", 1, 100, 0, 0); +
+ ++ status = defwRow("ROW_12", "CORE1", -19000, -11000, 3, 0, 0, 0, 0); +
+ ++ status = defwRowStr("ROW_13", "CORE1", -19000, -11000, "FN", 0, 0, 0, 0); +
+ + ++ // TRACKS +
++ layers = (const char**)malloc(sizeof(char*)*1); +
+ ++ status = defwTracks("X", 3000, 40, 120, 1, layers); +
+ + + ++ status = defwTracks("Y", 5000, 10, 20, 1,layers); +
+ + + + + + ++ // GCELLGRID +
++ status = defwGcellGrid("X", 0, 100, 600); +
+ ++ status = defwGcellGrid("Y", 10, 120, 400); +
+ + + + ++ // CANPLACE +
++ status = defwCanPlaceStr("dp", 45, 64, "N", 35, 1, 39, 1); +
+ + ++ status = defwCanPlace("dp", 45, 64, 1, 35, 1, 39, 1); +
+ + ++ // CANNOTOCCUPY +
++ status = defwCannotOccupyStr("dp", 54, 44, "S", 55, 2, 45, 3); +
+ + ++ // VIAS +
++ status = defwStartVias(7); +
+ ++ status = defwViaName("VIA_ARRAY"); +
+ ++ status = defwViaPattern("P1-435-543-IJ1FS"); +
+ ++ status = defwViaRect("M1", -40, -40, 40, 40); +
+ ++ status = defwViaRect("V1", -40, -40, 40, 40); +
+ ++ status = defwViaRect("M2", -50, -50, 50, 50); +
+ + + ++ status = defwViaName("VIA_ARRAY1"); +
+ ++ status = defwViaRect("M1", -40, -40, 40, 40); +
+ ++ status = defwViaRect("V1", -40, -40, 40, 40); +
+ ++ status = defwViaRect("M2", -50, -50, 50, 50); +
+ + + ++ status = defwViaName("myUnshiftedVia"); +
+ ++ status = defwViaViarule("myViaRule", 20, 20, "metal1", "cut12", "metal2", +
+ + ++ status = defwViaViaruleRowCol(2, 3); +
+ + + ++ status = defwViaName("via2"); +
+ ++ status = defwViaViarule("viaRule2", 5, 6, "botLayer2", "cutLayer2", +
++ "topLayer2", 6, 6, 1, 4, 1, 4); +
+ ++ status = defwViaViaruleOrigin(10, -10); +
+ ++ status = defwViaViaruleOffset(0, 0, 20, -20); +
+ ++ status = defwViaViarulePattern("2_F0_2_F8_1_78"); +
+ + + + ++ status = defwViaName("via3"); +
+ ++ status = defwViaPattern("P2-435-543-IJ1FS"); +
+ ++ status = defwViaRect("M2", -40, -40, 40, 40); +
+ + + + ++ xP = (double*)malloc(sizeof(double)*6); +
++ yP = (double*)malloc(sizeof(double)*6); +
++ xP[0] = -2.1; +
++ yP[0] = -1.0; +
++ xP[1] = -2; +
++ yP[1] = 1; +
++ xP[2] = 2.1; +
++ yP[2] = 1.0; +
++ xP[3] = 2.0; +
++ yP[3] = -1.0; +
++ status = defwViaName("via4"); +
+ ++ status = defwViaPolygon("M3", 4, xP, yP); +
+ ++ status = defwViaRect("M4", -40, -40, 40, 40); +
+ ++ xP[0] = 100; +
++ yP[0] = 100; +
++ xP[1] = 200; +
++ yP[1] = 200; +
++ xP[2] = 300; +
++ yP[2] = 300; +
++ xP[3] = 400; +
++ yP[3] = 400; +
++ xP[4] = 500; +
++ yP[4] = 500; +
++ xP[5] = 600; +
++ yP[5] = 600; +
++ status = defwViaPolygon("M5", 6, xP, yP); +
+ + + + ++ xP[0] = 200; +
++ yP[0] = 200; +
++ xP[1] = 300; +
++ yP[1] = 300; +
++ xP[2] = 400; +
++ yP[2] = 500; +
++ xP[3] = 100; +
++ yP[3] = 300; +
++ xP[4] = 300; +
++ yP[4] = 200; +
++ status = defwViaName("via5"); +
+ ++ status = defwViaPolygon("M6", 5, xP, yP); +
+ + + ++ free((char*)xP); +
++ free((char*)yP); +
+ + + ++ // REGIONS +
++ status = defwStartRegions(2); +
+ ++ status = defwRegionName("region1"); +
+ ++ status = defwRegionPoints(-500, -500, 300, 100); +
+ ++ status = defwRegionPoints(500, 500, 1000, 1000); +
+ ++ status = defwRegionType("FENCE"); +
+ ++ status = defwStringProperty("scum", "on top"); +
+ ++ status = defwIntProperty("center", 250); +
+ ++ status = defwIntProperty("area", 730000); +
+ ++ status = defwRegionName("region2"); +
+ ++ status = defwRegionPoints(4000, 0, 5000, 1000); +
+ ++ status = defwStringProperty("scum", "on bottom"); +
+ ++ status = defwEndRegions(); +
+ + ++ // COMPONENTS +
++ foreigns = (const char**)malloc(sizeof(char*)*2); +
++ foreignX = (int*)malloc(sizeof(int)*2); +
++ foreignY = (int*)malloc(sizeof(int)*2); +
++ foreignOrient = (int*)malloc(sizeof(int)*2); +
++ foreignOrientStr = (const char**)malloc(sizeof(char*)*2); +
++ status = defwStartComponents(11); +
+ ++ status = defwComponent("Z38A01", "DFF3", 0, NULL, NULL, NULL, NULL, NULL, +
++ 0, NULL, NULL, NULL, NULL, "PLACED", 18592, 5400, 6, 0, +
+ + ++ status = defwComponentHalo(100, 0, 50, 200); +
+ ++ status = defwComponentStr("Z38A03", "DFF3", 0, NULL, NULL, NULL, NULL, NULL, +
++ 0, NULL, NULL, NULL, NULL, "PLACED", 16576, 45600, +
++ "FS", 0, NULL, 0, 0, 0, 0); +
+ ++ status = defwComponentHalo(200, 2, 60, 300); +
+ ++ status = defwComponent("Z38A05", "DFF3", 0, NULL, NULL, NULL, NULL, NULL, +
++ 0, NULL, NULL, NULL, NULL, "PLACED", 51520, 9600, 6, 0, +
+ + ++ status = defwComponent("|i0", "INV_B", 0, NULL, "INV", NULL, NULL, NULL, +
++ 0, NULL, NULL, NULL, NULL, NULL, 0, 0, -1, 0, +
+ + ++ status = defwComponentHaloSoft(100, 0, 50, 200); +
+ ++ status = defwComponent("|i1", "INV_B", 0, NULL, "INV", NULL, NULL, NULL, +
++ 0, NULL, NULL, NULL, NULL, "UNPLACED", 1000, 1000, 0, +
+ + ++ status = defwComponent("cell1", "CHM6A", 0, NULL, NULL, "generator", NULL, +
++ "USER", 0, NULL, NULL, NULL, NULL, "FIXED", 0, 10, 0, +
++ 100.4534535, NULL, 0, 0, 0, 0); +
+ ++ status = defwComponent("cell2", "CHM6A", 0, NULL, NULL, NULL, NULL, +
++ "NETLIST", 0, NULL, NULL, NULL, NULL, "COVER", 120, +
++ 10, 4, 2, NULL, 0, 0, 0, 0); +
+ ++ foreigns[0] = strdup("gds2name"); +
+ + + ++ status = defwComponent("cell3", "CHM6A", 0, NULL, NULL, NULL, NULL, +
++ "TIMING", 1, foreigns, foreignX, foreignY, +
++ foreignOrient, "PLACED", 240, +
++ 10, 0, 0, "region1", 0, 0, 0, 0); +
+ ++ status = defwComponentRouteHalo(100, "metal1", "metal3"); +
+ + ++ foreigns[0] = strdup("gds3name"); +
+ + ++ foreignOrientStr[0] = strdup("FW"); +
++ foreigns[1] = strdup("gds4name"); +
+ + ++ foreignOrientStr[1] = strdup("FS"); +
++ status = defwComponentStr("cell4", "CHM3A", 0, NULL, "CHM6A", NULL, NULL, +
++ "DIST", 2, foreigns, foreignX, foreignY, +
++ foreignOrientStr, "PLACED", 360, +
++ 10, "W", 0, "region2", 0, 0, 0, 0); +
+ ++ status = defwComponentHaloSoft(100, 0, 50, 200); +
+ ++ status = defwStringProperty("cc", "This is the copy list"); +
+ ++ status = defwIntProperty("index", 9); +
+ ++ status = defwRealProperty("size", 7.8); +
+ ++ status = defwComponent("scancell1", "CHK3A", 0, NULL, NULL, NULL, NULL, +
++ NULL, 0, NULL, NULL, NULL, NULL, "PLACED", 500, +
++ 10, 7, 0, NULL, 0, 0, 0, 0); +
+ ++ status = defwComponent("scancell2", "CHK3A", 0, NULL, NULL, NULL, NULL, +
++ NULL, 0, NULL, NULL, NULL, NULL, "PLACED", 700, +
++ 10, 6, 0, NULL, 0, 0, 0, 0); +
+ ++ status = defwEndComponents(); +
+ + + + + + ++ free((char*)foreignOrient); +
++ free((char*)foreignOrientStr[0]); +
++ free((char*)foreignOrientStr[1]); +
++ free((char*)foreignOrientStr); +
+ ++ xP = (double*)malloc(sizeof(double)*6); +
++ yP = (double*)malloc(sizeof(double)*6); +
++ xP[0] = 2.1; +
++ yP[0] = 2.1; +
++ xP[1] = 3.1; +
++ yP[1] = 3.1; +
++ xP[2] = 4.1; +
++ yP[2] = 4.1; +
++ xP[3] = 5.1; +
++ yP[3] = 5.1; +
++ xP[4] = 6.1; +
++ yP[4] = 6.1; +
++ xP[5] = 7.1; +
++ yP[5] = 7.1; +
+ ++ // PINS +
++ status = defwStartPins(11); +
+ ++ status = defwPin("scanpin", "net1", 0, "INPUT", NULL, NULL, 0, 0, -1, NULL, +
++ 0, 0, 0, 0); +
+ ++ status = defwPinPolygon("metal1", 0, 1000, 6, xP, yP); +
+ ++ status = defwPinNetExpr("power1 VDD1"); +
+ ++ status = defwPin("pin0", "net1", 0, "INPUT", "SCAN", NULL, 0, 0, -1, NULL, +
++ 0, 0, 0, 0); +
+ ++ status = defwPinStr("pin0.5", "net1", 0, "INPUT", "RESET", "FIXED", 0, 0, "S", +
+ + ++ status = defwPinPolygon("metal2", 0, 0, 4, xP, yP); +
+ ++ status = defwPinLayer("metal3", 500, 0, -5000, -100, -4950, -90); +
+ ++ status = defwPin("pin1", "net1", 1, NULL, "POWER", NULL, 0, 0, -1, "M1", +
+ + ++ status = defwPinAntennaPinPartialMetalArea(4580, "M1"); +
+ ++ status = defwPinAntennaPinPartialMetalArea(4580, "M11"); +
+ ++ status = defwPinAntennaPinPartialMetalArea(4580, "M12"); +
+ ++ status = defwPinAntennaPinGateArea(4580, "M2"); +
+ ++ status = defwPinAntennaPinDiffArea(4580, "M3"); +
+ ++ status = defwPinAntennaPinDiffArea(4580, "M31"); +
+ ++ status = defwPinAntennaPinMaxAreaCar(5000, "L1"); +
+ ++ status = defwPinAntennaPinMaxSideAreaCar(5000, "M4"); +
+ ++ status = defwPinAntennaPinPartialCutArea(4580, "M4"); +
+ ++ status = defwPinAntennaPinMaxCutCar(5000, "L1"); +
+ ++ status = defwPin("pin2", "net2", 0, "INPUT", "SIGNAL", NULL, 0, 0, -1, "M1", +
+ + ++ status = defwPinLayer("M1", 500, 0, -5000, 0, -4950, 10); +
+ ++ status = defwPinPolygon("M2", 0, 0, 4, xP, yP); +
+ ++ status = defwPinPolygon("M3", 0, 0, 3, xP, yP); +
+ ++ status = defwPinLayer("M4", 0, 500, 0, 100, -400, 100); +
+ ++ status = defwPinSupplySensitivity("vddpin1"); +
+ ++ status = defwPinGroundSensitivity("gndpin1"); +
+ ++ status = defwPinAntennaPinPartialMetalArea(5000, NULL); +
+ ++ status = defwPinAntennaPinPartialMetalSideArea(4580, "M2"); +
+ ++ status = defwPinAntennaPinGateArea(5000, NULL); +
+ ++ status = defwPinAntennaPinPartialCutArea(5000, NULL); +
+ ++ status = defwPin("INBUS[1]", "|INBUS[1]", 0, "INPUT", "SIGNAL", "FIXED", +
++ 45, -2160, 0, "M2", 0, 0, 30, 135); +
+ ++ status = defwPinLayer("M2", 0, 0, 0, 0, 30, 135); +
+ ++ status = defwPinAntennaPinPartialMetalArea(1, "M1"); +
+ ++ status = defwPinAntennaPinPartialMetalSideArea(2, "M1"); +
+ ++ status = defwPinAntennaPinDiffArea(4, "M2"); +
+ ++ status = defwPinAntennaPinPartialCutArea(5, "V1"); +
+ ++ status = defwPinAntennaModel("OXIDE1"); +
+ ++ status = defwPinAntennaPinGateArea(3, "M1"); +
+ ++ status = defwPinAntennaPinMaxAreaCar(6, "M2"); +
+ ++ status = defwPinAntennaPinMaxSideAreaCar(7, "M2"); +
+ ++ status = defwPinAntennaPinMaxCutCar(8, "V1"); +
+ ++ status = defwPinAntennaModel("OXIDE2"); +
+ ++ status = defwPinAntennaPinGateArea(30, "M1"); +
+ ++ status = defwPinAntennaPinMaxAreaCar(60, "M2"); +
+ ++ status = defwPinAntennaPinMaxSideAreaCar(70, "M2"); +
+ ++ status = defwPinAntennaPinMaxCutCar(80, "V1"); +
+ ++ status = defwPin("INBUS<0>", "|INBUS<0>", 0, "INPUT", "SIGNAL", "PLACED", +
++ -45, 2160, 1, "M2", 0, 0, 30, 134); +
+ ++ status = defwPinLayer("M2", 0, 1000, 0, 0, 30, 134); +
+ ++ status = defwPin("OUTBUS<1>", "|OUTBUS<1>", 0, "OUTPUT", "SIGNAL", "COVER", +
++ 2160, 645, 2, "M1", 0, 0, 30, 135); +
+ ++ status = defwPinLayer("M1", 0, 0, 0, 0, 30, 134); +
+ ++ status = defwPinNetExpr("gnd1 GND"); +
+ ++ status = defwPin("VDD", "VDD", 1, "INOUT", "POWER", NULL, 0, 0, -1, NULL, +
++ 0, 0, 0, 0); +
+ ++ status = defwPin("BUSA[0]", "BUSA[0]", 0, "INPUT", "SIGNAL", "PLACED", +
++ 0, 2500, 1, NULL, 0, 0, 0, 0); +
+ ++ status = defwPinLayer("M1", 0, 0, -25, 0, 25, 50); +
+ ++ status = defwPinLayer("M2", 0, 0, -10, 0, 10, 75); +
+ ++ status = defwPinVia("via12", 0, 25); +
+ ++ status = defwPin("VDD", "VDD", 1, "INOUT", "POWER", NULL, +
++ 0, 0, -1, NULL, 0, 0, 0, 0); +
+ + + ++ status = defwPinPortLayer("M2", 0, 0, -25, 0, 25, 50); +
+ ++ status = defwPinPortLocation("PLACED", 0, 2500, "S"); +
+ + + ++ status = defwPinPortLayer("M1", 0, 0, -25, 0, 25, 50); +
+ ++ status = defwPinPortLocation("COVER", 0, 2500, "S"); +
+ + + ++ status = defwPinPortLayer("M1", 0, 0, -25, 0, 25, 50); +
+ ++ status = defwPinPortLocation("FIXED", 0, 2500, "S"); +
+ + + + + ++ free((char*)xP); +
++ free((char*)yP); +
+ ++ // PINPROPERTIES +
++ status = defwStartPinProperties(2); +
+ ++ status = defwPinProperty("cell1", "PB1"); +
+ ++ status = defwStringProperty("dpBit", "1"); +
+ ++ status = defwRealProperty("realProperty", 3.4); +
+ ++ status = defwPinProperty("cell2", "vdd"); +
+ ++ status = defwIntProperty("dpIgnoreTerm", 2); +
+ ++ status = defwEndPinProperties(); +
+ + ++ // SPECIALNETS +
++ status = defwStartSpecialNets(7); +
+ ++ status = defwSpecialNet("net1"); +
+ ++ status = defwSpecialNetConnection("cell1", "VDD", 0); +
+ ++ status = defwSpecialNetConnection("cell2", "VDD", 0); +
+ ++ status = defwSpecialNetConnection("cell3", "VDD", 0); +
+ ++ status = defwSpecialNetConnection("cell4", "VDD", 0); +
+ ++ status = defwSpecialNetWidth("M1", 200); +
+ ++ status = defwSpecialNetWidth("M2", 300); +
+ ++ status = defwSpecialNetVoltage(3.2); +
+ ++ status = defwSpecialNetSpacing("M1", 200, 190, 210); +
+ ++ status = defwSpecialNetSource("TIMING"); +
+ ++ status = defwSpecialNetOriginal("VDD"); +
+ ++ status = defwSpecialNetUse("POWER"); +
+ ++ status = defwSpecialNetWeight(30); +
+ ++ status = defwStringProperty("contype", "star"); +
+ ++ status = defwIntProperty("ind", 1); +
+ ++ status = defwRealProperty("maxlength", 12.13); +
+ ++ status = defwSpecialNetEndOneNet(); +
+ ++ status = defwSpecialNet("VSS"); +
+ ++ status = defwSpecialNetConnection("cell1", "GND", 1); +
+ ++ status = defwSpecialNetConnection("cell2", "GND", 0); +
+ ++ status = defwSpecialNetConnection("cell3", "GND", 1); +
+ ++ status = defwSpecialNetConnection("cell4", "GND", 0); +
+ ++ status = defwSpecialNetUse("SCAN"); +
+ ++ status = defwSpecialNetPathStart("ROUTED"); +
+ ++ status = defwSpecialNetPathLayer("M1"); +
+ ++ status = defwSpecialNetPathWidth(250); +
+ ++ status = defwSpecialNetPathShape("IOWIRE"); +
+ ++ coorX = (const char**)malloc(sizeof(char*)*3); +
++ coorY = (const char**)malloc(sizeof(char*)*3); +
++ coorValue = (const char**)malloc(sizeof(char*)*3); +
+ + + + + ++ coorValue[1] = strdup("235"); +
+ + ++ coorValue[2] = strdup("255"); +
++ status = defwSpecialNetPathPointWithWireExt(3, coorX, coorY, coorValue); +
+ ++ status = defwSpecialNetPathEnd(); +
+ + + + + ++ free((char*)coorValue[0]); +
++ free((char*)coorValue[1]); +
++ free((char*)coorValue[2]); +
+ ++ status = defwSpecialNetShieldStart("my_net"); +
+ ++ status = defwSpecialNetShieldLayer("M2"); +
+ ++ status = defwSpecialNetShieldWidth(90); +
+ ++ status = defwSpecialNetShieldShape("STRIPE"); +
+ ++ coorX[0] = strdup("14100"); +
++ coorY[0] = strdup("342440"); +
++ coorX[1] = strdup("13920"); +
+ ++ status = defwSpecialNetShieldPoint(2, coorX, coorY); +
+ ++ status = defwSpecialNetShieldVia("M2_TURN"); +
+ + + + ++ coorY[0] = strdup("263200"); +
++ status = defwSpecialNetShieldPoint(1, coorX, coorY); +
+ ++ status = defwSpecialNetShieldVia("M1_M2"); +
+ ++ status = defwSpecialNetShieldViaData(10, 20, 1000, 2000); +
+ + + ++ coorX[0] = strdup("2400"); +
+ ++ status = defwSpecialNetShieldPoint(1, coorX, coorY); +
+ ++ status = defwSpecialNetShieldEnd(); +
+ ++ status = defwSpecialNetShieldStart("my_net1"); +
+ ++ status = defwSpecialNetShieldLayer("M2"); +
+ ++ status = defwSpecialNetShieldWidth(90); +
+ + + + + ++ coorX[0] = strdup("14100"); +
++ coorY[0] = strdup("342440"); +
++ coorX[1] = strdup("13920"); +
+ ++ status = defwSpecialNetShieldPoint(2, coorX, coorY); +
+ ++ status = defwSpecialNetShieldVia("M2_TURN"); +
+ + + + ++ coorY[0] = strdup("263200"); +
++ status = defwSpecialNetShieldPoint(1, coorX, coorY); +
+ ++ status = defwSpecialNetShieldVia("M1_M2"); +
+ + + ++ coorX[0] = strdup("2400"); +
+ ++ status = defwSpecialNetShieldPoint(1, coorX, coorY); +
+ ++ status = defwSpecialNetShieldEnd(); +
+ ++ status = defwSpecialNetPattern("STEINER"); +
+ ++ status = defwSpecialNetEstCap(100); +
+ ++ status = defwSpecialNetEndOneNet(); +
+ + + + + + + ++ status = defwSpecialNet("VDD"); +
+ ++ status = defwSpecialNetConnection("*", "VDD", 0); +
+ ++ status = defwSpecialNetPathStart("ROUTED"); +
+ ++ status = defwSpecialNetPathLayer("metal2"); +
+ ++ status = defwSpecialNetPathWidth(100); +
+ ++ status = defwSpecialNetPathShape("RING"); +
+ ++ status = defwSpecialNetPathStyle(1); +
+ + + + + + + ++ status = defwSpecialNetPathPoint(3, coorX, coorY); +
+ + + + + + + ++ status = defwSpecialNetPathStart("NEW"); +
+ ++ status = defwSpecialNetPathLayer("M2"); +
+ ++ status = defwSpecialNetPathWidth(270); +
+ ++ status = defwSpecialNetPathShape("PADRING"); +
+ + ++ coorY[0] = strdup("1350"); +
++ coorX[1] = strdup("44865"); +
+ ++ status = defwSpecialNetPathPoint(2, coorX, coorY); +
+ + + + + ++ status = defwSpecialNetPathStart("NEW"); +
+ ++ status = defwSpecialNetPathLayer("M2"); +
+ ++ status = defwSpecialNetPathWidth(270); +
+ + ++ coorY[0] = strdup("1350"); +
++ coorX[1] = strdup("44865"); +
+ ++ status = defwSpecialNetPathPoint(2, coorX, coorY); +
+ ++ status = defwSpecialNetPathEnd(); +
+ ++ status = defwSpecialNetEndOneNet(); +
+ ++ status = defwSpecialNet("CLOCK"); +
+ ++ status = defwSpecialNetPathStart("ROUTED"); +
+ ++ status = defwSpecialNetPathLayer("M2"); +
+ ++ status = defwSpecialNetPathWidth(200); +
+ ++ status = defwSpecialNetPathShape("BLOCKRING"); +
+ + + + + + ++ coorY[0] = strdup("1350"); +
++ coorX[1] = strdup("44865"); +
+ ++ status = defwSpecialNetPathPoint(2, coorX, coorY); +
+ + + + + ++ status = defwSpecialNetPathStart("NEW"); +
+ ++ status = defwSpecialNetPathLayer("M2"); +
+ ++ status = defwSpecialNetPathWidth(270); +
+ + ++ coorY[0] = strdup("1350"); +
++ coorX[1] = strdup("44865"); +
+ ++ status = defwSpecialNetPathPoint(2, coorX, coorY); +
+ ++ status = defwSpecialNetPathEnd(); +
+ ++ status = defwSpecialNetEndOneNet(); +
+ + + + + ++ status = defwSpecialNet("VCC"); +
+ ++ status = defwSpecialNetPathStart("ROUTED"); +
+ ++ status = defwSpecialNetPathLayer("M2"); +
+ ++ status = defwSpecialNetPathWidth(200); +
+ ++ status = defwSpecialNetPathShape("DRCFILL"); +
+ + ++ coorY[0] = strdup("1350"); +
++ coorX[1] = strdup("44865"); +
+ ++ status = defwSpecialNetPathPoint(2, coorX, coorY); +
+ + + + + ++ status = defwSpecialNetPathStart("NEW"); +
+ ++ status = defwSpecialNetPathLayer("M2"); +
+ ++ status = defwSpecialNetPathWidth(270); +
+ ++ status = defwSpecialNetPathShape("STRIPE"); +
+ + ++ coorY[0] = strdup("1350"); +
++ coorX[1] = strdup("44865"); +
+ ++ status = defwSpecialNetPathPoint(2, coorX, coorY); +
+ ++ status = defwSpecialNetPathEnd(); +
+ ++ status = defwSpecialNetEndOneNet(); +
+ + + + + ++ status = defwSpecialNet("n1"); +
+ ++ status = defwSpecialNetConnection("PIN", "n1", 0); +
+ ++ status = defwSpecialNetConnection("driver1", "in", 0); +
+ ++ status = defwSpecialNetConnection("bumpa1", "bumppin", 0); +
+ ++ status = defwSpecialNetFixedbump(); +
+ ++ status = defwSpecialNetPathStart("ROUTED"); +
+ ++ status = defwSpecialNetPathLayer("M2"); +
+ ++ status = defwSpecialNetPathWidth(200); +
+ ++ status = defwSpecialNetPathShape("FILLWIREOPC"); +
+ + ++ coorY[0] = strdup("1350"); +
++ coorX[1] = strdup("44865"); +
+ ++ status = defwSpecialNetPathPoint(2, coorX, coorY); +
+ ++ status = defwSpecialNetPathEnd(); +
+ ++ status = defwSpecialNetEndOneNet(); +
+ + + + + + + + ++ status = defwSpecialNet("VSS1"); +
+ ++ status = defwSpecialNetUse("POWER"); +
+ ++ xP = (double*)malloc(sizeof(double)*6); +
++ yP = (double*)malloc(sizeof(double)*6); +
++ xP[0] = 2.1; +
++ yP[0] = 2.1; +
++ xP[1] = 3.1; +
++ yP[1] = 3.1; +
++ xP[2] = 4.1; +
++ yP[2] = 4.1; +
++ xP[3] = 5.1; +
++ yP[3] = 5.1; +
++ xP[4] = 6.1; +
++ yP[4] = 6.1; +
++ xP[5] = 7.1; +
++ yP[5] = 7.1; +
++ status = defwSpecialNetPolygon("metal1", 4, xP, yP); +
+ ++ status = defwSpecialNetPolygon("metal1", 6, xP, yP); +
+ ++ status = defwSpecialNetRect("metal1", 0, 0, 100, 200); +
+ ++ status = defwSpecialNetRect("metal2", 1, 1, 100, 200); +
+ ++ status = defwSpecialNetEndOneNet(); +
+ ++ free((char*)xP); +
++ free((char*)yP); +
++ status = defwEndSpecialNets(); +
+ + ++ // NETS +
++ status = defwStartNets(12); +
+ + + ++ status = defwNetConnection("Z38A01", "Q", 0); +
+ ++ status = defwNetConnection("Z38A03", "Q", 0); +
+ ++ status = defwNetConnection("Z38A05", "Q", 0); +
+ ++ status = defwNetEndOneNet(); +
+ + + + ++ status = defwNetConnection("cell1", "PB1", 0); +
+ ++ status = defwNetConnection("cell2", "PB1", 0); +
+ ++ status = defwNetConnection("cell3", "PB1", 0); +
+ ++ status = defwNetEstCap(200); +
+ ++ status = defwNetWeight(2); +
+ ++ status = defwNetVpin("P1", NULL, 0, 0, 0, 0, "PLACED", 54, 64, 3); +
+ ++ status = defwNetEndOneNet(); +
+ + + + ++ status = defwNetConnection("cell4", "PA3", 0); +
+ ++ status = defwNetConnection("cell2", "P10", 0); +
+ ++ status = defwNetXtalk(30); +
+ ++ status = defwNetOriginal("extra_crispy"); +
+ ++ status = defwNetSource("USER"); +
+ ++ status = defwNetUse("SIGNAL"); +
+ ++ status = defwNetFrequency(100); +
+ ++ status = defwIntProperty("alt", 37); +
+ ++ status = defwStringProperty("lastName", "Unknown"); +
+ ++ status = defwRealProperty("length", 10.11); +
+ ++ status = defwNetPattern("BALANCED"); +
+ ++ status = defwNetVpinStr("P2", "L1", 45, 54, 3, 46, "FIXED", 23, 12, "FN"); +
+ ++ status = defwNetEndOneNet(); +
+ + ++ coorX = (const char**)malloc(sizeof(char*)*5); +
++ coorY = (const char**)malloc(sizeof(char*)*5); +
++ coorValue = (const char**)malloc(sizeof(char*)*5); +
++ status = defwNet("my_net"); +
+ ++ status = defwNetConnection("I1", "A", 0); +
+ ++ status = defwNetConnection("BUF", "Z", 0); +
+ ++ status = defwNetNondefaultRule("RULE1"); +
+ ++ status = defwNetUse("RESET"); +
+ ++ status = defwNetShieldnet("VSS"); +
+ ++ status = defwNetShieldnet("VDD"); +
+ ++ status = defwNetPathStart("ROUTED"); +
+ ++ status = defwNetPathLayer("M2", 0, NULL); +
+ ++ status = defwNetPathStyle(2); +
+ ++ coorX[0] = strdup("14000"); +
++ coorY[0] = strdup("341440"); +
+ ++ coorX[1] = strdup("9600"); +
+ + + ++ coorY[2] = strdup("282400"); +
+ ++ status = defwNetPathPoint(3, coorX, coorY, coorValue); +
+ + + ++ status = defwNetPathVia("nd1VIA12"); +
+ ++ coorX[0] = strdup("2400"); +
+ + ++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + + + ++ status = defwNetPathStart("NEW"); +
+ ++ status = defwNetPathLayer("M1", 1, NULL); +
+ ++ status = defwNetPathStyle(4); +
+ ++ coorX[0] = strdup("2400"); +
++ coorY[0] = strdup("282400"); +
+ + + + ++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + + + + + ++ status = defwNetPathEnd(); +
+ ++ status = defwNetNoshieldStart("M2"); +
+ ++ coorX[0] = strdup("14100"); +
++ coorY[0] = strdup("341440"); +
++ coorX[1] = strdup("14000"); +
+ ++ status = defwNetNoshieldPoint(2, coorX, coorY); +
+ ++ status = defwNetNoshieldEnd(); +
+ ++ status = defwNetEndOneNet(); +
+ + ++ status = defwNet("|INBUS[1]"); +
+ ++ status = defwNetConnection("|i1", "A", 0); +
+ ++ status = defwNetEndOneNet(); +
+ + ++ status = defwNet("|INBUS<0>"); +
+ ++ status = defwNetConnection("|i0", "A", 0); +
+ ++ status = defwNetEndOneNet(); +
+ + ++ status = defwNet("|OUTBUS<1>"); +
+ ++ status = defwNetConnection("|i0", "Z", 0); +
+ ++ status = defwNetEndOneNet(); +
+ + ++ status = defwNet("MUSTJOIN"); +
+ ++ status = defwNetConnection("cell4", "PA1", 0); +
+ ++ status = defwNetEndOneNet(); +
+ + ++ status = defwNet("XX100"); +
+ ++ status = defwNetConnection("Z38A05", "G", 0); +
+ ++ status = defwNetConnection("Z38A03", "G", 0); +
+ ++ status = defwNetConnection("Z38A01", "G", 0); +
+ ++ status = defwNetVpin("V_SUB3_XX100", NULL, -333, -333, 333, 333, "PLACED", +
+ + ++ status = defwNetVpin("V_SUB2_XX100", NULL, -333, -333, 333, 333, "PLACED", +
+ + ++ status = defwNetVpin("V_SUB1_XX100", NULL, -333, -333, 333, 333, "PLACED", +
+ + ++ status = defwNetSubnetStart("SUB1_XX100"); +
+ ++ status = defwNetSubnetPin("Z38A05", "G"); +
+ ++ status = defwNetSubnetPin("VPIN", "V_SUB1_XX100"); +
+ ++ status = defwNetPathStart("ROUTED"); +
+ ++ status = defwNetPathLayer("M1", 0, "RULE1"); +
+ + + + + ++ coorX[0] = strdup("54040"); +
++ coorY[0] = strdup("30300"); +
++ coorValue[0] = strdup("0"); +
+ ++ coorY[1] = strdup("30900"); +
+ ++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
+ + ++ status = defwNetPathVia("nd1VIA12"); +
+ + + ++ coorValue[0] = strdup("0"); +
++ coorX[1] = strdup("56280"); +
+ + ++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
+ + ++ status = defwNetPathViaWithOrient("nd1VIA23", 6); +
+ + ++ coorY[0] = strdup("31500"); +
+ ++ coorX[1] = strdup("55160"); +
+ + ++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + + + ++ status = defwNetPathEnd(); +
+ ++ status = defwNetSubnetEnd(); +
+ ++ status = defwNetSubnetStart("SUB2_XX100"); +
+ ++ status = defwNetSubnetPin("Z38A03", "G"); +
+ ++ status = defwNetSubnetPin("VPIN", "V_SUB2_XX100"); +
+ ++ status = defwNetPathStart("ROUTED"); +
+ ++ status = defwNetPathLayer("M1", 0, NULL); +
+ ++ coorX[0] = strdup("168280"); +
++ coorY[0] = strdup("63300"); +
++ coorValue[0] = strdup("7"); +
+ ++ coorY[1] = strdup("64500"); +
+ ++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
+ + ++ status = defwNetPathVia("M1_M2"); +
+ ++ coorX[0] = strdup("169400"); +
+ ++ coorValue[0] = strdup("8"); +
++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ ++ status = defwNetPathViaWithOrientStr("M2_M3", "SE"); +
+ + + ++ free((char*)coorValue[0]); +
++ status = defwNetPathEnd(); +
+ ++ status = defwNetSubnetEnd(); +
+ ++ status = defwNetSubnetStart("SUB3_XX100"); +
+ ++ status = defwNetSubnetPin("Z38A01", "G"); +
+ ++ status = defwNetSubnetPin("VPIN", "V_SUB3_XX100"); +
+ ++ status = defwNetPathStart("ROUTED"); +
+ ++ status = defwNetPathLayer("M1", 0, NULL); +
+ ++ coorX[0] = strdup("188400"); +
++ coorY[0] = strdup("26100"); +
++ coorValue[0] = strdup("0"); +
+ ++ coorY[1] = strdup("27300"); +
++ coorValue[1] = strdup("0"); +
++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
+ + ++ free((char*)coorValue[1]); +
++ status = defwNetPathVia("M1_M2"); +
+ ++ coorX[0] = strdup("189560"); +
+ ++ coorValue[0] = strdup("0"); +
++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
++ status = defwNetPathVia("M1_M2"); +
+ ++ status = defwNetPathEnd(); +
+ ++ status = defwNetSubnetEnd(); +
+ ++ status = defwNetSubnetStart("SUB0_XX100"); +
+ ++ status = defwNetSubnetPin("VPIN", "V_SUB1_XX100"); +
+ ++ status = defwNetSubnetPin("VPIN", "V_SUB2_XX100"); +
+ ++ status = defwNetSubnetPin("VPIN", "V_SUB3_XX100"); +
+ ++ status = defwNetNondefaultRule("RULE1"); +
+ ++ status = defwNetPathStart("ROUTED"); +
+ ++ status = defwNetPathLayer("M3", 0, NULL); +
+ ++ coorX[0] = strdup("269400"); +
++ coorY[0] = strdup("64500"); +
++ coorValue[0] = strdup("0"); +
+ ++ coorY[1] = strdup("54900"); +
+ ++ coorX[2] = strdup("170520"); +
+ + + ++ coorY[3] = strdup("37500"); +
+ + ++ coorY[4] = strdup("30300"); +
+ ++ status = defwNetPathPoint(5, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
+ + + + + + + + ++ status = defwNetPathVia("nd1VIA23"); +
+ ++ coorX[0] = strdup("171080"); +
+ + ++ coorX[1] = strdup("17440"); +
+ ++ coorValue[1] = strdup("0"); +
++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + + + ++ free((char*)coorValue[1]); +
++ status = defwNetPathVia("nd1VIA23"); +
+ + + + + ++ coorY[1] = strdup("26700"); +
++ coorValue[1] = strdup("8"); +
++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + + + ++ free((char*)coorValue[1]); +
++ status = defwNetPathVia("nd1VIA23"); +
+ ++ coorX[0] = strdup("177800"); +
+ + ++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ status = defwNetPathVia("nd1VIA23"); +
+ + + ++ coorValue[0] = strdup("8"); +
+ ++ coorY[1] = strdup("30300"); +
++ coorValue[1] = strdup("8"); +
++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ ++ status = defwNetPathVia("nd1VIA23"); +
+ + + ++ free((char*)coorValue[0]); +
+ + ++ free((char*)coorValue[1]); +
++ status = defwNetPathVia("nd1VIA23"); +
+ ++ coorX[0] = strdup("189560"); +
+ ++ coorValue[0] = strdup("8"); +
++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
++ status = defwNetPathVia("nd1VIA12"); +
+ + ++ coorY[0] = strdup("27300"); +
++ coorValue[0] = strdup("0"); +
++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
++ status = defwNetPathStart("NEW"); +
+ ++ status = defwNetPathLayer("M3", 1, NULL); +
+ ++ coorX[0] = strdup("55160"); +
++ coorY[0] = strdup("31500"); +
++ coorValue[0] = strdup("8"); +
+ ++ coorY[1] = strdup("34500"); +
++ coorValue[1] = strdup("0"); +
++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
+ + ++ free((char*)coorValue[1]); +
++ status = defwNetPathVia("M2_M3"); +
+ ++ coorX[0] = strdup("149800"); +
+ ++ coorValue[0] = strdup("8"); +
++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
++ status = defwNetPathVia("M2_M3"); +
+ + ++ coorY[0] = strdup("35700"); +
+ + ++ coorY[1] = strdup("37500"); +
+ ++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + + + ++ status = defwNetPathVia("M2_M3"); +
+ + + ++ coorValue[0] = strdup("8");; +
++ coorX[1] = strdup("170520"); +
+ ++ coorValue[1] = strdup("0"); +
++ status = defwNetPathPoint(2, coorX, coorY, coorValue); +
+ + + ++ free((char*)coorValue[0]); +
+ + ++ free((char*)coorValue[1]); +
++ status = defwNetPathVia("M2_M3"); +
+ ++ status = defwNetPathEnd(); +
+ ++ status = defwNetEndOneNet(); +
+ + + + ++ status = defwNetConnection("scancell1", "P10", 1); +
+ ++ status = defwNetConnection("scancell2", "PA0", 1); +
+ ++ status = defwNetSource("TEST"); +
+ ++ status = defwNetEndOneNet(); +
+ + ++ status = defwNet("testBug"); +
+ ++ status = defwNetConnection("Z38A05", "G", 0); +
+ ++ status = defwNetConnection("Z38A03", "G", 0); +
+ ++ status = defwNetConnection("Z38A01", "G", 0); +
+ ++ status = defwNetPathStart("ROUTED"); +
+ ++ status = defwNetPathLayer("M1", 0, NULL); +
+ ++ coorX[0] = strdup("1288210"); +
++ coorY[0] = strdup("580930"); +
+ ++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ status = defwNetPathVia("GETH1W1W1"); +
+ + ++ coorY[0] = strdup("582820"); +
++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ status = defwNetPathVia("GETH2W1W1"); +
+ ++ status = defwNetPathStart("NEW"); +
+ ++ status = defwNetPathLayer("M3", 0, NULL); +
+ ++ coorX[0] = strdup("1141350"); +
++ coorY[0] = strdup("582820"); +
+ ++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ status = defwNetPathVia("GETH2W1W1"); +
+ + ++ coorY[0] = strdup("580930"); +
++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ status = defwNetPathVia("GETH1W1W1"); +
+ ++ status = defwNetPathStart("NEW"); +
+ ++ status = defwNetPathLayer("M1", 0, NULL); +
+ ++ coorX[0] = strdup("1278410"); +
++ coorY[0] = strdup("275170"); +
+ ++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ status = defwNetPathStart("NEW"); +
+ ++ status = defwNetPathLayer("M1", 0, NULL); +
+ ++ coorX[0] = strdup("1141210"); +
++ coorY[0] = strdup("271250"); +
+ ++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ status = defwNetPathVia("GETH1W1W1"); +
+ + ++ coorY[0] = strdup("271460"); +
+ ++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ status = defwNetPathVia("GETH2W1W1"); +
+ ++ coorX[0] = strdup("1142820"); +
+ + ++ status = defwNetPathPoint(1, coorX, coorY, coorValue); +
+ + + ++ status = defwNetPathVia("GETH3W1W1"); +
+ ++ status = defwNetPathEnd(); +
+ ++ status = defwNetEndOneNet(); +
+ + + + + + + ++ status = defwNetConnection("PIN", "n1", 0); +
+ ++ status = defwNetConnection("driver1", "in", 0); +
+ ++ status = defwNetConnection("bumpa1", "bumppin", 0); +
+ ++ status = defwNetFixedbump(); +
+ ++ status = defwNetEndOneNet(); +
+ + + + + ++ // SCANCHAIN +
++ status = defwStartScanchains(4); +
+ ++ status = defwScanchain("the_chain"); +
+ ++ status = defwScanchainCommonscanpins("IN", "PA1", "OUT", "PA2"); +
+ ++ status = defwScanchainStart("PIN", "scanpin"); +
+ ++ status = defwScanchainStop("cell4", "PA2"); +
+ ++ status = defwScanchainOrdered("cell2", "IN", "PA0", NULL, NULL, +
++ "cell1", "OUT", "P10", NULL, NULL); +
+ ++ status = defwScanchainFloating("scancell1", "IN", "PA0", NULL, NULL); +
+ ++ status = defwScanchainFloating("scancell2", "OUT", "P10", NULL, NULL); +
+ ++ status = defwScanchain("chain1_clock1"); +
+ ++ status = defwScanchainPartition("clock1", -1); +
+ ++ status = defwScanchainStart("block1/current_state_reg_0_QZ", NULL); +
+ ++ status = defwScanchainFloating("block1/pgm_cgm_en_reg", "IN", "SD", "OUT", "QZ"); +
+ ++ status = defwScanchainFloating("block1/start_reset_dd_reg", "IN", "SD", "OUT", "QZ"); +
+ ++ status = defwScanchainStop("block1/start_reset_d_reg", NULL); +
+ ++ status = defwScanchain("chain2_clock2"); +
+ ++ status = defwScanchainPartition("clock2", 1000); +
+ ++ status = defwScanchainStart("block1/current_state_reg_0_QZ", NULL); +
+ ++ status = defwScanchainFloating("block1/port2_phy_addr_reg_0_", "IN", "SD", "OUT", "QZ "); +
+ ++ status = defwScanchainFloating("block1/port2_phy_addr_reg_4_", "IN", "SD", "OUT", "QZ"); +
+ ++ status = defwScanchainFloatingBits("block1/port3_intfc", "IN", "SD", "OUT", "QZ", 4); +
+ ++ status = defwScanchainOrderedBits("block1/mux1", "IN", "A", "OUT", "X", 0, +
++ "block1/ff2", "IN", "SD", "OUT", "Q", -1); +
+ ++ status = defwScanchain("chain4_clock3"); +
+ ++ status = defwScanchainPartition("clock3", -1); +
+ ++ status = defwScanchainStart("block1/prescaler_IO/lfsr_reg1", NULL); +
+ ++ status = defwScanchainFloating("block1/dp1_timers", NULL, NULL, NULL, NULL); +
+ ++ status = defwScanchainFloatingBits("block1/bus8", NULL, NULL, NULL, NULL, 8); +
+ ++ status = defwScanchainOrderedBits("block1/dsl/ffl", "IN", "SD", "OUT", "Q", +
++ -1, "block1/dsl/mux1", "IN", "B", "OUT", "Y", 0); +
+ ++ status = defwScanchainOrderedBits("block1/dsl/ff2", "IN", "SD", "OUT", "Q", +
++ -1, "block1/dsl/mux2", "IN", "B", "OUT", "Y", 0); +
+ ++ status = defwScanchainStop("block1/start_reset_d_reg", NULL); +
+ + ++ status = defwEndScanchain(); +
+ + ++ // GROUPS +
++ groupExpr = (const char**)malloc(sizeof(char*)*2); +
++ status = defwStartGroups(2); +
+ ++ groupExpr[0] = strdup("cell2"); +
++ groupExpr[1] = strdup("cell3"); +
++ status = defwGroup("group1", 2, groupExpr); +
+ ++ free((char*)groupExpr[0]); +
++ free((char*)groupExpr[1]); +
++ status = defwGroupRegion(0, 0, 0, 0, "region1"); +
+ ++ status = defwStringProperty("ggrp", "xx"); +
+ ++ status = defwIntProperty("side", 2); +
+ ++ status = defwRealProperty("maxarea", 5.6); +
+ ++ groupExpr[0] = strdup("cell1"); +
++ status = defwGroup("group2", 1, groupExpr); +
+ ++ free((char*)groupExpr[0]); +
++ status = defwGroupRegion(0, 10, 1000, 1010, NULL); +
+ ++ status = defwStringProperty("ggrp", "after the fall"); +
+ ++ status = defwGroupSoft("MAXHALFPERIMETER", 4000, "MAXX", 10000, 0, 0); +
+ + + + + + + ++ // BLOCKAGES +
++ xP = (double*)malloc(sizeof(double)*7); +
++ yP = (double*)malloc(sizeof(double)*7); +
++ xP[0] = 2.1; +
++ yP[0] = 2.1; +
++ xP[1] = 3.1; +
++ yP[1] = 3.1; +
++ xP[2] = 4.1; +
++ yP[2] = 4.1; +
++ xP[3] = 5.1; +
++ yP[3] = 5.1; +
++ xP[4] = 6.1; +
++ yP[4] = 6.1; +
++ xP[5] = 7.1; +
++ yP[5] = 7.1; +
++ xP[6] = 8.1; +
++ yP[6] = 8.1; +
+ ++ status = defwStartBlockages(12); +
+ ++ status = defwBlockageLayer("m1", "comp1"); +
+ ++ status = defwBlockageRect(3456, 4535, 3000, 4000); +
+ ++ status = defwBlockageRect(4500, 6500, 5500, 6000); +
+ ++ status = defwBlockagePolygon(7, xP, yP); +
+ ++ status = defwBlockagePolygon(6, xP, yP); +
+ ++ status = defwBlockageRect(5000, 6000, 4000, 5000); +
+ ++ status = defwBlockagePlacementComponent("m2"); +
+ ++ status = defwBlockageRect(4000, 6000, 8000, 4000); +
+ ++ status = defwBlockageRect(8000, 400, 600, 800); +
+ ++ status = defwBlockageLayer("m3", 0); +
+ ++ status = defwBlockageSpacing(1000); +
+ ++ status = defwBlockageRect(3000, 4000, 6000, 5000); +
+ ++ status = defwBlockageLayerSlots("m4"); +
+ ++ status = defwBlockageDesignRuleWidth(1000); +
+ ++ status = defwBlockageRect(3000, 4000, 6000, 5000); +
+ ++ status = defwBlockageLayerFills("m5"); +
+ ++ status = defwBlockageRect(3000, 4000, 6000, 5000); +
+ ++ status = defwBlockageLayerPushdown("m6"); +
+ ++ status = defwBlockageRect(3000, 4000, 6000, 5000); +
+ ++ status = defwBlockagePolygon(7, xP, yP); +
+ ++ status = defwBlockagePlacementComponent("m7"); +
+ ++ status = defwBlockageRect(3000, 4000, 6000, 5000); +
+ ++ status = defwBlockagePlacementPushdown(); +
+ ++ status = defwBlockageRect(3000, 4000, 6000, 5000); +
+ ++ status = defwBlockagePlacement(); +
+ ++ status = defwBlockageRect(3000, 4000, 6000, 5000); +
+ ++ status = defwBlockagePlacementSoft(); +
+ ++ status = defwBlockageRect(4000, 6000, 8000, 4000); +
+ ++ status = defwBlockagePlacementPartial (1.1); +
+ ++ status = defwBlockageRect(4000, 6000, 8000, 4000); +
+ ++ status = defwBlockageLayerExceptpgnet("metal1"); +
+ ++ status = defwBlockageSpacing(4); +
+ ++ status = defwBlockagePolygon(3, xP, yP); +
+ ++ status = defwEndBlockages(); +
+ + + ++ free((char*)xP); +
++ free((char*)yP); +
+ ++ // SLOTS +
++ xP = (double*)malloc(sizeof(double)*7); +
++ yP = (double*)malloc(sizeof(double)*7); +
++ xP[0] = 2.1; +
++ yP[0] = 2.1; +
++ xP[1] = 3.1; +
++ yP[1] = 3.1; +
++ xP[2] = 4.1; +
++ yP[2] = 4.1; +
++ xP[3] = 5.1; +
++ yP[3] = 5.1; +
++ xP[4] = 6.1; +
++ yP[4] = 6.1; +
++ xP[5] = 7.1; +
++ yP[5] = 7.1; +
++ xP[6] = 8.1; +
++ yP[6] = 8.1; +
++ status = defwStartSlots(2); +
+ ++ status = defwSlotLayer("MET1"); +
+ ++ status = defwSlotPolygon(7, xP, yP); +
+ ++ status = defwSlotPolygon(3, xP, yP); +
+ ++ status = defwSlotRect(1000, 2000, 1500, 4000); +
+ ++ status = defwSlotRect(2000, 2000, 2500, 4000); +
+ ++ status = defwSlotRect(3000, 2000, 3500, 4000); +
+ ++ status = defwSlotLayer("MET2"); +
+ ++ status = defwSlotRect(1000, 2000, 1500, 4000); +
+ ++ status = defwSlotPolygon(6, xP, yP); +
+ + + + + ++ free((char*)xP); +
++ free((char*)yP); +
+ ++ // FILLS +
++ xP = (double*)malloc(sizeof(double)*7); +
++ yP = (double*)malloc(sizeof(double)*7); +
++ xP[0] = 2.1; +
++ yP[0] = 2.1; +
++ xP[1] = 3.1; +
++ yP[1] = 3.1; +
++ xP[2] = 4.1; +
++ yP[2] = 4.1; +
++ xP[3] = 5.1; +
++ yP[3] = 5.1; +
++ xP[4] = 6.1; +
++ yP[4] = 6.1; +
++ xP[5] = 7.1; +
++ yP[5] = 7.1; +
++ xP[6] = 8.1; +
++ yP[6] = 8.1; +
++ status = defwStartFills(5); +
+ ++ status = defwFillLayer("MET1"); +
+ ++ status = defwFillRect(1000, 2000, 1500, 4000); +
+ ++ status = defwFillPolygon(5, xP, yP); +
+ ++ status = defwFillRect(2000, 2000, 2500, 4000); +
+ ++ status = defwFillPolygon(7, xP, yP); +
+ ++ status = defwFillRect(3000, 2000, 3500, 4000); +
+ ++ status = defwFillLayer("MET2"); +
+ ++ status = defwFillRect(1000, 2000, 1500, 4000); +
+ ++ status = defwFillRect(1000, 4500, 1500, 6500); +
+ ++ status = defwFillRect(1000, 7000, 1500, 9000); +
+ ++ status = defwFillRect(1000, 9500, 1500, 11500); +
+ ++ status = defwFillPolygon(7, xP, yP); +
+ ++ status = defwFillPolygon(6, xP, yP); +
+ ++ status = defwFillLayer("metal1"); +
+ ++ status = defwFillLayerOPC(); +
+ ++ status = defwFillRect(100, 200, 150, 400); +
+ ++ status = defwFillRect(300, 200, 350, 400); +
+ ++ status = defwFillVia("via28"); +
+ ++ status = defwFillViaOPC(); +
+ ++ status = defwFillPoints(1, xP, yP); +
+ ++ status = defwFillVia("via26"); +
+ ++ status = defwFillPoints(3, xP, yP); +
+ + + + + ++ free((char*)xP); +
++ free((char*)yP); +
+ ++ // SLOTS +
++ xP = (double*)malloc(sizeof(double)*7); +
++ yP = (double*)malloc(sizeof(double)*7); +
++ xP[0] = 2.1; +
++ yP[0] = 2.1; +
++ xP[1] = 3.1; +
++ yP[1] = 3.1; +
++ xP[2] = 4.1; +
++ yP[2] = 4.1; +
++ xP[3] = 5.1; +
++ yP[3] = 5.1; +
++ xP[4] = 6.1; +
++ yP[4] = 6.1; +
++ xP[5] = 7.1; +
++ yP[5] = 7.1; +
++ xP[6] = 8.1; +
++ yP[6] = 8.1; +
++ status = defwStartSlots(2); +
+ ++ status = defwSlotLayer("MET1"); +
+ ++ status = defwSlotRect(1000, 2000, 1500, 4000); +
+ ++ status = defwSlotPolygon(5, xP, yP); +
+ ++ status = defwSlotRect(2000, 2000, 2500, 4000); +
+ ++ status = defwSlotPolygon(7, xP, yP); +
+ ++ status = defwSlotRect(3000, 2000, 3500, 4000); +
+ ++ status = defwSlotLayer("MET2"); +
+ ++ status = defwSlotRect(1000, 2000, 1500, 4000); +
+ ++ status = defwSlotRect(1000, 4500, 1500, 6500); +
+ ++ status = defwSlotRect(1000, 7000, 1500, 9000); +
+ ++ status = defwSlotRect(1000, 9500, 1500, 11500); +
+ ++ status = defwSlotPolygon(7, xP, yP); +
+ ++ status = defwSlotPolygon(6, xP, yP); +
+ + + + + ++ free((char*)xP); +
++ free((char*)yP); +
+ + ++ status = defwStartNonDefaultRules(4); +
+ ++ status = defwNonDefaultRule("doubleSpaceRule", 1); +
+ ++ status = defwNonDefaultRuleLayer("metal1", 2, 0, 1, 0); +
+ ++ status = defwNonDefaultRuleLayer("metal2", 2, 0, 1, 0); +
+ ++ status = defwNonDefaultRuleLayer("metal3", 2, 0, 1, 0); +
+ ++ status = defwNonDefaultRule("lowerResistance", 0); +
+ ++ status = defwNonDefaultRuleLayer("metal1", 6, 0, 0, 5); +
+ ++ status = defwNonDefaultRuleLayer("metal2", 5, 1, 6, 4); +
+ ++ status = defwNonDefaultRuleLayer("metal3", 5, 0, 0, 0); +
+ ++ status = defwNonDefaultRuleMinCuts("cut12", 2); +
+ ++ status = defwNonDefaultRuleMinCuts("cut23", 2); +
+ ++ status = defwNonDefaultRule("myRule", 0); +
+ ++ status = defwNonDefaultRuleLayer("metal1", 2, 0, 0, 0); +
+ ++ status = defwNonDefaultRuleLayer("metal2", 2, 0, 0, 0); +
+ ++ status = defwNonDefaultRuleLayer("metal3", 2, 0, 0, 0); +
+ ++ status = defwNonDefaultRuleViaRule("myvia12rule"); +
+ ++ status = defwNonDefaultRuleViaRule("myvia23rule"); +
+ ++ status = defwRealProperty("minlength", 50.5); +
+ ++ status = defwStringProperty("firstName", "Only"); +
+ ++ status = defwIntProperty("idx", 1); +
+ ++ status = defwNonDefaultRule("myCustomRule", 0); +
+ ++ status = defwNonDefaultRuleLayer("metal1", 5, 0, 1, 0); +
+ ++ status = defwNonDefaultRuleLayer("metal2", 5, 0, 1, 0); +
+ ++ status = defwNonDefaultRuleLayer("metal3", 5, 0, 1, 0); +
+ ++ status = defwNonDefaultRuleVia("myvia12_custom1"); +
+ ++ status = defwNonDefaultRuleVia("myvia12_custom2"); +
+ ++ status = defwNonDefaultRuleVia("myvia23_custom1"); +
+ ++ status = defwNonDefaultRuleVia("myvia23_custom2"); +
+ ++ status = defwEndNonDefaultRules(); +
+ + + + ++ // STYLES +
++ status = defwStartStyles(3); +
+ ++ xP = (double*)malloc(sizeof(double)*6); +
++ yP = (double*)malloc(sizeof(double)*6); +
++ xP[0] = 30; +
++ yP[0] = 10; +
++ xP[1] = 10; +
++ yP[1] = 30; +
++ xP[2] = -10; +
++ yP[2] = 30; +
++ xP[3] = -30; +
++ yP[3] = 10; +
++ xP[4] = -30; +
++ yP[4] = -10; +
++ xP[5] = -10; +
++ yP[5] = -30; +
++ status = defwStyles(1, 6, xP, yP); +
+ ++ status = defwStyles(2, 5, xP, yP); +
+ ++ free((char*)xP); +
++ free((char*)yP); +
++ xP = (double*)malloc(sizeof(double)*8); +
++ yP = (double*)malloc(sizeof(double)*8); +
++ xP[0] = 30; +
++ yP[0] = 10; +
++ xP[1] = 10; +
++ yP[1] = 30; +
++ xP[2] = -10; +
++ yP[2] = 30; +
++ xP[3] = -30; +
++ yP[3] = 10; +
++ xP[4] = -30; +
++ yP[4] = -10; +
++ xP[5] = -10; +
++ yP[5] = -30; +
++ xP[6] = 10; +
++ yP[6] = -30; +
++ xP[7] = 30; +
++ yP[7] = -10; +
++ status = defwStyles(3, 8, xP, yP); +
+ + + ++ free((char*)xP); +
++ free((char*)yP); +
+ + + ++ // BEGINEXT +
++ status = defwStartBeginext("tag"); +
+ ++ defwAddIndent(); +
++ status = defwBeginextCreator("CADENCE"); +
+ ++ status = defwBeginextSyntax("OTTER", "furry"); +
+ ++ status = defwStringProperty("arrg", "later"); +
+ ++ status = defwBeginextSyntax("SEAL", "cousin to WALRUS"); +
+ ++ status = defwEndBeginext(); +
+ + + + + + ++ lineNumber = defwCurrentLineNumber(); +
+ ++ fprintf(stderr, "ERROR: nothing has been read.\n"); +
+ ++ fclose(fout); +
+ ++ return 0; +
++ } +
+ +
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+ ![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+ ![]() |
+ |||||||||
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+
+
This chapter contains the following sections:
+
+
+
+ ![]() |
+ Overview | +
+
+
+ ![]() |
+ DEF Reader Working Modes | +
+
+
+ ![]() |
+ Comparison Utility | +
+
+
+ ![]() |
+ Compressed DEF Files | +
+
+
+ ![]() |
+ Orientation Codes | +
This manual describes the application programming interface (API) routines for the following Cadence® Design Exchange Format (DEF) components:
+
+
+
+ ![]() |
+ DEF reader | +
+
+
+ ![]() |
+ DEF writer | +
Note: The writer portion of the API does not always optimize the DEF output.
+The DEF reader can work in two modes - compatibility mode and session-based mode.
+
+
+
+ ![]() |
+ Compatibility mode (session-less mode) - This mode is compatible with the old parser behavior. You can call the parser initialization once with defrInit(), adjust parsing settings and initialize the parser callbacks any time. The properties once defined in PROPERTYDEFINITIONS sections will be also defined in all subsequent file reads. | +
+
+
+ ![]() |
+ Session-based mode - This mode introduces the concept of the parsing session. In this mode, the order of calling parsing configuration and processing API is strict: | +
+ | +
+
+
+ |
+ Parser initialization: Call defrInitSession() instead of defrInit() to start a new parsing session and close any old parsing session, if opened. | +
+ | +
+
+
+ |
+ Parser configuration: Call multiple callback setters and parsing parameters setting functions. | +
+ | +
+
+
+ |
+ Data processing: Do one or multiple parsing of DEF files with the defrRead() function. | +
+ | +
+
+
+ |
+ Cleaning of the parsing configuration: Call the defrClear() function (optional). The call releases all parsing session data and closes the parsing session. If this is skipped, the data cleaning and the session closing is done by the next defrInitSession() call. | +
In the session-based mode, the properties once defined in PROPERTYDEFINITIONS remain active in all the DEF file parsing cycles in the session and the properties definition data is cleaned when the parsing session ends.+
The session-based mode does not require you to call callbacks and property unsetter functions. All callbacks and properties are set to default by the next defrInitSession() call.+
The session-based mode allows you to avoid the lasting PROPERTYDEFINITIONS data effect when not required as you can just configure your application to parse one file per session.+
By default, the DEF parser works in the compatibility mode. To activate the session-based mode, you must use defrInitSession() instead of defrInit().
+Note: Currently, the compatibility mode can be used in all old applications where the code has not been adjusted. The def2oa translator has already been adjusted to use the session-based parsing mode.
+The DEF file comparison utility, lefdefdiff, helps you verify that your usage of the API is consistent and complete. This utility reads two DEF files, generally an initial file and the resulting file from reading in an application, then writes out a DEF file. The comparison utility reads and writes the data so that the UNIX diff utility can be used to compare the files.
+ +The DEF reader can parse compressed DEF files. To do so, you must link the libdef.a and libdefzlib.a libraries.
+A zlib compression library is also required in order to read compressed DEF files. The zlib source code is free software that can be downloaded from www.gnu.com.
+For information on compressed file routines, see "DEF Compressed File Routines."
++ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
Note: The location given is the lower left corner of the resulting site or component after the mirroring and rotation are applied. It is not the location of the origin of the child cell.
+
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+ ![]() |
+ |||||||||
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+
+
The Cadence® Design Exchange Format (DEF) reader provides several routines that initialize the reader and set global variables that are used by the reader.
+The following routines described in this section set options for reading a DEF file.
+
+
+
+ ![]() |
+ defrInit | +
+
+
+ ![]() |
+ defrInitSession | +
+
+
+ ![]() |
+ defrClear | +
+
+
+ ![]() |
+ defrRead | +
+
+
+ ![]() |
+ defrSetUserData | +
+
+
+ ![]() |
+ defrGetUserData | +
+
+
+ ![]() |
+ defrSetAddPathToNet | +
+
+
+ ![]() |
+ defrSetAllowComponentNets | +
+
+
+ ![]() |
+ defrGetAllowComponentNets | +
+
+
+ ![]() |
+ defrSetCommentChar | +
+
+
+ ![]() |
+ defrSetRegisterUnusedCallbacks | +
+
+
+ ![]() |
+ defrPrintUnusedCallbacks | +
+
+
+ ![]() |
+ defrUnusedCallbackCount | +
The following DEF reader setup and control routines are available in the API.
+Initializes internal variables in the DEF reader. You must use this routine before using defrRead. You can use other routines to set callback functions before or after this routine.
++ + startSession +
+Boolean. If is non-zero, performs the parser initialization in session-based mode; otherwise, the function will initialize parsing in the compatibility mode, working exactly as a defrInit() call.+
Releases all parsing session data and closes the parsing session. If the call to defrClear() is skipped, the data cleaning and the session closing is done by the next defrInitSession() call.
++ + file +
+Specifies a pointer to an already open file. This allows the parser to work with either a disk file or a piped stream. This argument is required. Any callbacks that have been set will be called from within this routine.+
+ + fileName +
+Specifies a UNIX filename using either a complete or a relative path specification.+
+ + data +
+Specifies the data type.+
+ + case_sensitive +
+Specifies whether the data is case sensitive.+
Sets the user-provided data. The DEF reader does not look at this data, but passes an opaque defiUserData pointer back to the application with each callback. You can set or change the user data at any time using the defrSetUserData and defrGetUserData routines. Every callback returns user data as the third argument.
++ + data +
+Specifies the user-provided data.+
Retrieves the user-provided data. The DEF reader returns an opaque defiUserData pointer, which you set using defrSetUserData. You can set or change the user data at any time with the defrSetUserData and defrGetUserData calls. Every callback returns the user data as the third argument.
+Returns non-zero value if component nets are allowed.
+Changes the character used to indicate comments in the DEF file.
++ + c +
+Specifies the comment character. The default is a pound sign (#).+
Prints all callback routines that are not set but have constructs in the DEF file.
++ + log +
+Specifies the file to which the unused callbacks are printed.+
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+ ![]() |
+ |||||||||
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+
+
The Cadence® Design Exchange Format (DEF) reader calls all callback routines when it reads in the appropriate part of the DEF file. Some routines, such as the design name callback, are called only once. Other routines, such as the net callback, can be called more than once.
+This chapter contains the following sections:
+
+
+
+ ![]() |
+ Callback Function Format | +
+
+
+ ![]() |
+ Callback Types and Setting Routines | +
+
+
+ ![]() |
+ User Callback Routines | +
All callback functions use the following format.
+Each user-supplied callback routine is passed three arguments.
+The callBackType argument is a list of objects that contains a unique number assignment for each callback from the parser. This list allows you to use the same callback routine for different types of DEF data.
+The DEF_data argument provides the data specified by the callback. Data types returned by the callbacks vary for each callback. Examples of the types of arguments passed include const char*, double, int, and defiProp. Two points to note:
+
+
+
+ ![]() |
+ The data returned in the callback is not checked for validity. | +
+
+
+ ![]() |
+ If you want to keep the data, you must make a copy of it. | +
The data argument is a four-byte data item that is set by the user. Note that the DEF reader contains only user data. The user data is most often set to a pointer to the design data so that it can be passed to the routines. This is more effective than using a global variable.
+ +Note: You can unset a callback by using the set function with a null argument.
+The following table lists the DEF reader callback setting routines and the associated callback types. The contents of the setting routines are described in detail in the section "User Callback Routines".
+
+
+ DEF |
+
+
+ + Setting Routine + + |
+
+
+ + Callback Types + + |
+
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | +
+ void defrComponentMaskShiftLayerCbk |
+ |
+ + | ++ + | +|
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
This section describes the following routines:
+
+
+
+ ![]() |
+ defrBlockageCbkFnType | +
+
+
+ ![]() |
+ defrBoxCbkFnType | +
+
+
+ ![]() |
+ defrComponentCbkFnType | +
+
+
+ ![]() |
+ defrComponentMaskShiftLayerCbkFnType | +
+
+
+ ![]() |
+ defrDoubleCbkFnType | +
+
+
+ ![]() |
+ defrFillCbkFnType | +
+
+
+ ![]() |
+ defrGcellGridCbkFnType | +
+
+
+ ![]() |
+ defrGroupCbkFnType | +
+
+
+ ![]() |
+ defrIntegerCbkFnType | +
+
+
+ ![]() |
+ defrNetCbkFnType | +
+
+
+ ![]() |
+ defrNonDefaultCbkFnType | +
+
+
+ ![]() |
+ defrPathCbkFnType | +
+
+
+ ![]() |
+ defrPinCbkFnType | +
+
+
+ ![]() |
+ defrPinPropCbkFnType | +
+
+
+ ![]() |
+ defrPropCbkFnType | +
+
+
+ ![]() |
+ defrRegionCbkFnType | +
+
+
+ ![]() |
+ defrRowCbkFnType | +
+
+
+ ![]() |
+ defrScanchainCbkFnType | +
+
+
+ ![]() |
+ defrSlotCbkFnType | +
+
+
+ ![]() |
+ defrStringCbkFnType | +
+
+
+ ![]() |
+ defrStylesCbkFnType | +
+
+
+ ![]() |
+ defrTrackCbkFnType | +
+
+
+ ![]() |
+ defrViaCbkFnType | +
+
+
+ ![]() |
+ defrVoidCbkFnType | +
Retrieves data from the BLOCKAGES statement in the DEF file. Use the arguments defined in the defiBlockage class to retrieve the data. For syntax information about the DEF BLOCKAGES statement, see Blockages in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrBlockageCbkType type, which indicates that the blockage callback was called.+
+ + blockage +
+Returns a pointer to a defiBlockage structure. For more information, see defiBlockage.+
+ + data +
+Returns four bytes of user-defined data. User data is most often set to a pointer to the design data.+
Retrieves data from the DIEAREA statement in the DEF file. Use the arguments defined in the defiBox class to retrieve the data. For syntax information about the DEF DIEAREA statement, see Die Area in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrDieAreaCbkType type, which indicates that the die area callback was called.+
+ + box +
+Returns a pointer to a defiBox structure. For more information, see defiBox.+
+ + data +
+Returns four bytes of user-defined data. User data is most often set to a pointer to the design data.+
Retrieves data from the COMPONENTS statement in the DEF file. Use the arguments defined in the defiComponent class to retrieve the data. For syntax information about the DEF COMPONENTS statement, see Components in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrComponentCbkType, which indicates that the component callback was called.+
+ + comp +
+Returns a pointer to a defiComponent structure. For more information, see defiComponent.+
+ + data +
+Returns four bytes of user-defined data. User data is most often set to a pointer to the design data.+
Retrieves data from the COMPONENTMASKSHIFT statement of the DEF file. The format of the data returned is always the same, but the actual data represented varies depending on the calling routine.
+For syntax information about the DEF COMPONENTMASKSHIFT statement, see "Component Mask Shift" in the LEF/DEF Language Reference.
++ + type +
+Returns the defrComponentMaskShiftLayerCbkFnType. This allows you to verity within your program that this is a correct callback.+
+ + shiftLayers +
+Returns a pointer to a defiComponentMaskShiftLayer. For more information, see defiComponentMaskShiftLayer.+
+ + data +
+Returns four bytes of user-defined data. User data is most often set to a pointer to the design data.+
Retrieves data from the UNITS and VERSION statements of the DEF file. The format of the data returned is always the same, but the actual data represented varies depending on the calling routine.
+For syntax information about the DEF UNITS and VERSION statements, see Units and Version in the LEF/DEF Language Reference.
+ ++ + typ +
+Returns a type that varies depending on the callback routine used. The following types can be returned.+
+ + DEF Data + + |
+
+ + Type Returned + + |
+
+ + | ++ + | +
+ + | ++ + | +
+ + number +
+Returns data that varies depending on the callback used. The following kinds of data can be returned.+
+ + DEF Data + + |
+ + + | +
+ + | +
+ DEFconvertFactor in the UNITS statement + |
+
+ + | +
+ versionNumber in the VERSION statement + |
+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
The following example shows a callback routine with the type defrVersionCbkType.
+ + +Retrieves data from the FILLS statement in the DEF file. Use the arguments defined in the defiFill class to retrieve the data. For syntax information about the DEF FILLS statement, see Fills in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrFillCbkFnType, which indicates that the fill callback was called.+
+ + fill +
+Returns a pointer to a defifill structure. For more information, see defiFill.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the GCELLGRID statement in the DEF file. Use the arguments defined in the defiGcellGrid class to retrieve the data. For syntax information about the DEF GCELLGRID statement, see GCell Grid in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrGcellGridCbkType, which indicates that the gcell grid callback was called.+
+ + grid +
+Returns a pointer to a defiGcellGrid structure. For more information, see defiGcellGrid.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the GROUPS statement in the DEF file. Use the arguments defined in the defiGroup class to retrieve the data. For syntax information about the DEF GROUPS statement, see Groups in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrGroupCbkType, which indicates that the group callback was called.+
+ + group +
+Returns a pointer to a defiGroup structure. For more information, see defiGroup.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
+ + typ +
+Returns a type that varies depending on the callback routine used. The following types can be returned.+
+ + DEF Data + + |
+
+ + Type Returned + + |
+
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + number +
+Returns data that varies depending on the callback used. The following kinds of data can be returned.+
+ + DEF Data + + |
+ + + | +
+ + | +
+ numBlockages in the BLOCKAGES statement + |
+
+ + | +
+ numComps in the COMPONENTS statement + |
+
+ + | +
+ numFills in the FILLS statement + |
+
+ + | +
+ numGroups in the GROUPS statement + |
+
+ + | +
+ numNets in the NETS statement + |
+
+ + | +
+ numRules in the NONDEFAULTRULES statement + |
+
+ + | +
+ num in the PINPROPERTIES statement + |
+
+ + | +
+ numPins in the PINS statement + |
+
+ + | +
+ numRegions in the REGIONS statement + |
+
+ + | +
+ numScanChains in the SCANCHAINS statement + |
+
+ + | +
+ numSlots in the SLOTS statement + |
+
+ + | +
+ numNets in the SPECIALNETS statement + |
+
+ + | +
+ numStyles in the STYLES statement + |
+
+ + | +
+ numVias in the VIAS statement + |
+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the NETS and SPECIALNETS sections of the DEF file. Use the arguments defined in the defiNet class to retrieve the data.
+For syntax information about the DEF NETS and SPECIALNETS statements, see Nets and Special Nets in the LEF/DEF Language Reference.
++ + typ +
+Returns a type that varies depending on the callback routine used. The following types can be returned.+
+ + DEF Data + + |
+
+ + Type Returned + + |
+
+ + | ++ + | +
+ + | ++ + | +
+ + net +
+Returns a pointer to a defiNet structure. For more information, see defiNet.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the NONDEFAULTRULES statement in the DEF file. Use the arguments defined in the defiNonDefault class to retrieve the data. For syntax information about the DEF NONDEFAULTRULES statement, see "Nondefault Rules," in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrNonDefaultCbkType type, which indicates that the nondefault rule callback was called.+
+ + rule +
+Returns a pointer to a defiNonDefault structure. For more information, see defiNonDefault.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the regularWiring and specialWiring specifications in the NETS and SPECIALNETS statements of the DEF file. Use the arguments defined in the defiPath class to retrieve the data.
+For syntax information about the DEF NETS and SPECIALNETS statements, see Nets and Special Nets in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrPathCbkType type, which indicates that the path callback was called.+
+ + path +
+Returns a pointer to a defiPath structure. For more information, see defiPath.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the PINS statement in the DEF file. Use the arguments defined in the defiPin class to retrieve the data. For syntax information about the DEF PINS statement, see Pins in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrPinCbkType type, which indicates that the Pin callback was called.+
+ + pin +
+Returns a pointer to a defiPin structure. For more information, see defiPin.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the PINPROPERTIES statement in the DEF file. Use the arguments defined in the defiPinProp class to retrieve the data. For syntax information about the DEF PINPROPERTIES statement, see Pin Properties in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrPinPropCbkType type, which indicates that the pin property callback was called.+
+ + pp +
+Returns a pointer to a defiPinProp structure. For more information, see defiPinProp.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the PROPERTYDEFINITIONS statement in the DEF file. Use the arguments defined in the defiProp class to retrieve the data. For syntax information about the DEF PROPERTYDEFINITIONS statement, see Property Definitions in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrPropCbkType type, which indicates that the property callback was called.+
+ + prop +
+Returns a pointer to a defiProp structure. For more information, see defiProp.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the REGIONS statement in the DEF file. Use the arguments defined in the defiRegion class to retrieve the data. For syntax information about the DEF REGIONS statement, see Regions in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrRegionCbkType type, which indicates that the region callback was called.+
+ + reg +
+Returns a pointer to a defiRegion structure. For more information, see defiRegion.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the ROWS statement in the DEF file. Use the arguments defined in the defiRow class to retrieve the data. For syntax information about the DEF ROWS statement, see Rows in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrRowCbkType type, which indicates that the row callback was called.+
+ + row +
+Returns a pointer to a defiRow structure. For more information, see defiRow.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the SCANCHAINS statement in the DEF file. Use the arguments defined in the defiScanchain class to retrieve the data. For syntax information about the DEF SCANCHAINS statement, see Scan Chains in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrScanchainCbkType type, which indicates that the scan chains callback was called.+
+ + sc +
+Returns a pointer to a defiScanchain structure. For more information, see defiScanchain.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the SLOTS statement in the DEF file. Use the arguments defined in the defiSlot class to retrieve the data. For syntax information about the DEF SLOTS statement, see Slots in the LEF/DEF Language Reference.
++ + typ +
+Returns the type, defrSlotCbkFnType, which indicates that the slot callback was called.+
+ + slot +
+Returns a pointer to a defiSlot structure. For more information, see defiSlot.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data+
+ + typ +
+Returns a type that varies depending on the callback routine used. The following types can be returned.+
+ + DEF Data + + |
+
+ + Type Returned + + |
+
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + string +
+The data returned varies depending on the callback used.The following table shows the kinds of data returned.+
+ + DEF Data + + |
+ + + | +
+ + | +
+ delimiterPair in the BUSBITCHARS statement + |
+
+ + | +
+ designName in the DESIGN statement + |
+
+ + | +
+ tag in the EXTENSIONS statement + |
+
+ + | +
+ character in the DIVIDERCHAR statement + |
+
+ + | +
+ tag in the EXTENSION statement + |
+
+ + | +
+ compNameRegExpr in the GROUPS statement + |
+
+ + | +
+ groupName in the GROUPS statement + |
+
+ + | +
+ anyText in the HISTORY statement + |
+
+ + | +
+ tag in the EXTENSION statement + |
+
+ + | +
+ tag in the EXTENSION statement + |
+
+ + | +
+ tag in the EXTENSION statement + |
+
+ + | +
+ tag in the EXTENSION statement + |
+
+ + | +
+ technologyName in the TECHNOLOGY statement + |
+
+ + | +
+ versionNumber in VERSION statement + |
+
+ + | +
+ tag in the EXTENSION statement + |
+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the STYLES statement in the DEF file. Use the arguments defined in the defiStyles class to retrieve the data. For syntax information about the DEF STYLES statement, see "Styles," in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrStylesCbkType, which indicates that the style callback was called.+
+ + style +
+Returns a pointer to a defiStyles structure. For more information, see defiStyles.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the TRACKS statement in the DEF file. Use the arguments defined in the defiTrack class to retrieve the data. For syntax information about the DEF TRACKS statement, see Tracks in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrTrackCbkType, which indicates that the track callback was called.+
+ + sc +
+Returns a pointer to a defiTrack structure. For more information, see defiTrack.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
Retrieves data from the VIAS statement in the DEF file. Use the arguments defined in the defiVia class to retrieve the data. For syntax information about the DEF VIAS statement, see Vias in the LEF/DEF Language Reference.
++ + typ +
+Returns the defrViaCbkType, which indicates that the via callback was called.+
+ + via +
+Returns a pointer to a defiVia structure. For more information, see defiVia.+
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
+ + typ +
+Returns a type that varies depending on the callback routine used. The following types can be returned.+
+ + DEF Data + + |
+
+ + Type Returned + + |
+
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + variable +
+Returns data that varies depending on the callback used. The following kinds of data can be returned. For all data types, the variable returns NULL.+
+ + DEF Data + + |
+ |
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + data +
+Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.+
The following example shows a callback routine using the arguments for defrCallbackType_e, char*, and defiUserData.
+ +The following example shows a callback routine using the arguments for defrCallbackType_e, int, and defiUserData.
+ +The following example shows a callback routine using the arguments for defrCallbackType_e, defiVia, and defiUserData.
+ + +
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+ ![]() |
+ |||||||||
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+
+
This chapter contains the following sections:
+
+
+
+ ![]() |
+ Introduction | +
+
+
+ ![]() |
+ Callback Style Interface | +
+
+
+ ![]() |
+ Retrieving Repeating DEF Data | +
+
+
+ ![]() |
+ Deriving C Syntax from C++ Syntax | +
+
+
+ ![]() |
+ DEF Reader Class Routines | +
Every statement in the Cadence® Design Exchange Format (DEF) file is associated with a DEF reader class. When the DEF reader uses a callback, it passes a pointer to the appropriate class. You can use the member functions in each class to retrieve data defined in the DEF file.
+
+ |
+
+
+
+ ![]() |
+ + Returned data is not static. If you want to keep the data, you must copy it. + | +
You can use a for loop from 0 to the number of items specified in the index. In the loop, retrieve the data from the subsequent arrays. For example:
+ + +The Cadence application programming interface (API) provides both C and C++ interfaces. The C API is generated from the C++ source, so there is no functional difference. The C API has been created in a pseudo object-oriented style. Examining a simple case should enable you to understand the API organization.
+The following examples show the same objects in C and C++ syntax.
+The C routine prototypes for the API functions can be found in the following files:
++ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
The following table lists the class routines that apply to the DEF information.
+
+ + DEF Information + + |
+
+ + DEF Class + + |
+
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | ++ + | +
+ + | +
+ defiBox |
+
Retrieves data from the BLOCKAGES statement in the DEF file. For syntax information about the DEF BLOCKAGES statement, see "Blockages" in the LEF/DEF Language Reference.
+Retrieves data from the DIEAREA statement of the DEF file. For syntax information about the DEF DIEAREA statement, see "Die Area" in the LEF/DEF Language Reference.
+Retrieves data from the COMPONENTS statement in the DEF file. For syntax information about the DEF COMPONENTS statement, see "Components" in the LEF/DEF Language Reference.
+The following example shows a callback routine with the type defrComponentCbkType. Callback routines for the type defrComponentStartCbkType and defrComponentEndCbkType are similar to the example for defrViaStartCbkType and defrViaEndCbkType in the Via section.
+ +Retrieves data from the COMPONENTMASKSHIFT statement in the DEF file.
+For syntax information about the DEF COMPONENTMASKSHIFT statement, see "Component Mask Shift" in the LEF/DEF Language Reference.
+Retrieves data from the FILLS statement in the DEF file. For syntax information about the DEF FILLS statement, see "Fills" in the LEF/DEF Language Reference.
+Retrieves data from the GCELLGRID statement in the DEF file. For syntax information about the DEF GCELLGRID statement, see "GCell Grid" in the LEF/DEF Language Reference.
+The following example shows a callback routine with the type defrGcellGridCbkType, and the class defiGcellGrid.
+ +Retrieves geometry data from the BLOCKAGES, FILLS, NETS, and SLOTS statements of the DEF file. For syntax information, see "Blockages," "Fills," "Nets," and "Slots" in the LEF/DEF Language Reference.
+Retrieves data from the GROUPS statement in the DEF file. For syntax information about the DEF GROUPS statement, see "Groups" in the LEF/DEF Language Reference.
+The following example shows callback routines for the types defrGroupNameCbkType, defrGroupMemberCbkType, and defrGroupCbkType. Callback routines for the type defrGroupsStartCbkType and defrGroupsEndCbkType are similar to the example for defrViaStartCbkType and defrViaEndCbkType in the Via section.
+ + + +Retrieves data from the NETS statement in the DEF file. For syntax information about the DEF NETS statement, see "Nets" in the LEF/DEF Language Reference.
+The following example shows a callback routine with the type defrSNetCbkType. Callback routines for the type defrSNetStartCbkType and defrSNetEndCbkType are similar to the example for defrViaStartCbkType and defrViaEndCbkType in the Via section. This example only shows how to retrieve part of the data from the defiNet class.
+ + + + + + + + + + +Retrieves data from the NONDEFAULTRULES statement in the DEF file. For syntax information about the DEF NONDEFAULTRULES statement, see "Nondefault Rules," in the LEF/DEF Language Reference.
+Retrieves data from the ORDERED statement in the SCANCHAINS statement of the DEF file. For syntax information about the DEF SCANCHAINS statement, see "Scan Chains" in the
LEF/DEF Language Reference.
Retrieves data from the regularWiring and specialWiring specifications in the NETS and SPECIALNETS sections of the DEF file. For syntax information about the DEF SPECIALNETS and NETS statements, see "Special Nets" and "Nets" in the LEF/DEF Language Reference.
+For a defiPath example, see the example in the defiNet section.
+Retrieves data from the PINS statement in the DEF file. For syntax information about the DEF PINS statement, see "Pins" in the LEF/DEF Language Reference.
+The following example shows a callback routine with the type defrPinCbkType. Callback routines for the type defrStartPinsCbkType and defrPinEndCbkType are similar to the example for defrViaStartCbkType and defrViaEndCbkType in the Via section.
+ + +Retrieves antenna model information in the PINS statement in the DEF file. For syntax information about the DEF PINS statement, see "Pins" in the LEF/DEF Language Reference.
+Retrieves data from the PINS PORT statement in the DEF file. For syntax information about the DEF PINS PORT statement, see "Pins" in the LEF/DEF Language Reference.
+Retrieves data from the PINPROPERTIES statement in the DEF file. For syntax information about the DEF PINPROPERTIES statement, see "Pin Properties" in the LEF/DEF Language Reference.
+The following example shows a callback routine with the type defrPinPropCbkType. Callback routines for the type defrPinPropStartCbkType and defrPinPropEndCbkType are similar to the example for defrViaStartCbkType and defrViaEndCbkType in the Via section.
+ +Retrieves a list of points for polygons in the DEF file.
+Retrieves data from the PROPERTYDEFINITIONS statement in the DEF file. For syntax information about the DEF PROPERTYDEFINITIONS statement, see "Property Definitions" in the LEF/DEF Language Reference.
+The string of the property is returned by the C++ function string or the C function defiProp_string. A property can have a number and a range, which are returned by the function hasNumber and hasRange. The actual values are returned by the functions number, left, and right.
+The following example shows a callback routine with the type defrPropDefStartCbkType, and void *. This callback routine marks the beginning of the Property Definitions section.
+ +The following example shows a callback routine with the type defrPropCbkType, and the class defiProp. This callback routine will be called for each defined property definition.
+ +The following example shows a callback routine with the type defrPropDefEndCbkType, and void *. This callback routine marks the end of the Property Definitions section.
+ +Retrieves data from the REGIONS statement in the DEF file. For syntax information about the DEF REGIONS statement, see "Regions" in the LEF/DEF Language Reference.
+The following example shows a callback routine with the type defrRegionCbkType. Callback routines for the type defrRegionStartCbkType and defrRegionEndCbkType are similar to the example for defrViaStartCbkType and defrViaEndCbkType in the Via section.
+ +Retrieves data from the ROW statement in the DEF file. For syntax information about the DEF ROW statement, see "Rows" in the LEF/DEF Language Reference.
+The following example shows a die area routine using a callback routine with the type defrDieAreaCbkType, and the class defiRow.
+ +The following example shows a row routine using a callback routine with the type defrRowCbkType, and the class defiRow.
+ + +Retrieves data from the SCANCHAINS statement in the DEF file. For syntax information about the DEF SCANCHAINS statement, see "Scan Chains" in the LEF/DEF Language Reference.
+The following example shows a callback routine with the type defrScanchainCbkType. Callback routines for the type defrScanchainsStartCbkType and defrScanchainsEndCbkType are similar to the example for defrViaStartCbkType and defrViaEndCbkType in the Via section.
+ +Retrieves data from the SPECIALNETS statement in the DEF file. For syntax information about the DEF SPECIALNETS statement, see "Special Nets" in the LEF/DEF Language Reference.
+For a defiShield example, see the example in the defiNet section.
+Retrieves data from any obsolete SITE sections of the DEF file.
+The following example shows a callback routine with the type defrCanplaceCbk and defrCannotOccupyCbk.
+ +Retrieves data from the SLOTS statement in the DEF file. For syntax information about the DEF SLOTS statement, see "Slots" in the LEF/DEF Language Reference.
+Retrieves data from the STYLES statement in the DEF file. For syntax information about the DEF STYLES statement, see "Styles," in the LEF/DEF Language Reference.
+Retrieves data from the SUBNETS statement in the NETS statement in the DEF file. For syntax information about the DEF NETS statement, see "Nets" in the LEF/DEF Language Reference.
+Retrieves data from the TRACKS statement in the DEF file. For syntax information about the DEF TRACKS statement, see "Tracks" in the LEF/DEF Language Reference.
+The following example shows a callback routine with the type defrTrackCbkType, and the class defiTrack.
+ +Retrieves data from the VIAS statement in the DEF file. For syntax information about the DEF VIAS statement, see "Vias" in the LEF/DEF Language Reference.
+The following example shows a callback routine with the type defrViaStartCbkType.
+ +The following example shows a callback routine with the type defrViaCbkType.
+ +The following example shows a callback routine with the type defrViaEndCbkType.
+ + +Retrieves via array data from the SPECIALNETS statement in the DEF file. For syntax information about the DEF SPECIALNETS statement, see "Special Nets" in the LEF/DEF Language Reference.
+Retrieves data from the VPIN statement in the NETS statement in the DEF file. For syntax information about the DEF NETS statement, see "Nets" and in the LEF/DEF Language Reference.
+Retrieves data from the regularWiring or specialWiring section of the NETS or SPECIALNETS statements in the DEF file. For syntax information about the DEF NETS and SPECIALNETS statements, see "Nets" and "Special Nets" in the LEF/DEF Language Reference.
+
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+ ![]() |
+ |||||||||
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+
+
You can use the Cadence® Design Exchange Format (DEF) writer with callback routines, or you can call one writer function at a time.
+ +
+ + Section + + |
+
+ + Required + + |
+ + + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
All callback functions use the following format.
+The callBackType argument is a list of objects that contains a unique number assignment for each callback from the parser. This list allows you to use the same callback routine for different types of DEF data.
+
+ + DEF Information + + |
+
+
+ + Setting Routine + + |
+
+
+ + Callback Types + + |
+
+ + | ++ + | ++ + | +
+ + | +
+ void defwSetBusBitCbk |
+ + + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+ ![]() |
+ |||||||||
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+
+
You can use the Cadence® Design Exchange Format (DEF) writer routines to create a program that outputs a DEF file. The DEF writer routines correspond to the sections of the DEF file. This chapter describes the routines listed below that you need to write a particular DEF section.
+
+ + Routines + + |
+
+ + DEF File Section + + |
+
+ + | ++ + | +
+ + | +
+ BLOCKAGES statement + |
+
+ + | +
+ BUSBITCHARS statement + |
+
+ + | +
+ COMPONENTS statement + |
+
+ + | +
+ DESIGN statement + |
+
+ + | +
+ DIEAREA statement + |
+
+ + | +
+ DIVIDERCHAR statement + |
+
+ + | +
+ EXTENSIONS statement + |
+
+ + | +
+ FILLS statement + |
+
+ + | +
+ GCELLGRID statement + |
+
+ + | +
+ GROUPS statement + |
+
+ + | +
+ HISTORY statement + |
+
+ + | +
+ NETS statement + |
+
+ Regular Wiring+ |
+
+ regularWiring statement in a NETS statement + |
+
+ Subnet+ |
+
+ SUBNET statement in a NETS statement + |
+
+ + | +
+ NONDEFAULTRULES statement + |
+
+ + | +
+ PINS statement + |
+
+ + | +
+ PINPROPERTIES statement + |
+
+ + | +
+ PROPERTYDEFINITIONS statement + |
+
+ + | +
+ PROPERTY statements + |
+
+ + | +
+ REGIONS statement + |
+
+ + | +
+ ROW statement + |
+
+ + | +
+ SPECIALNETS statement + |
+
+ Special Wiring+ |
+
+ specialWiring statement in a SPECIALNETS statement + |
+
+ Shielded Routing+ |
+
+ shielded routing statement in a SPECIALNETS statement + |
+
+ + | +
+ SCANCHAINS statement + |
+
+ + | +
+ SLOTS statement + |
+
+ + | +
+ STYLES statement + |
+
+ + | +
+ TECHNOLOGY statement + |
+
+ + | +
+ TRACKS statement + |
+
+ + | +
+ UNITS statement + |
+
+ + | +
+ VERSION statement + |
+
+ + | +
+ VIAS statement + |
+
The DEF writer setup and control routines initialize the reader and set global variables that are used by the DEF file. You must begin a DEF file with either the defwInit routine or the defwInitCbk routine. You must end a DEF file with the defwEnd routine. All other routines must be used between these routines. The remaining routines described in this section are provided as utilities.
+For an example on how to set up the writer, see "Setup Examples".
+All routines return 0 if successful.
+Initializes the DEF writer. Use this routine if you do not want to use the callback mechanism.
++ + file +
+Specifies the name of the DEF file to create.+
+ + vers1, vers2 +
+Specifies which version of LEF/DEF is being used. vers1 specifies the major number. vers2 specifies the minor number.+
+ + caseSensitive +
+Note: The NAMECASESENSITIVE statement is obsolete; therefore the writer ignores this argument.+
+ + dividerChar +
+Writes the DIVIDERCHAR statement that specifies the character used to express hierarchy when DEF names are mapped to or from other databases. The character must be enclosed in double quotation marks.+
+ + busBitChars +
+Writes the BUSBITCHARS statement that specifies the pair of characters used to specify bus bits when DEF names are mapped to or from other databases. The characters must be enclosed in double quotation marks.+
+ + designName +
+Writes the DESIGN statement that specifies a name for the design.+
+ + technology +
+Writes the TECHNOLOGY statement that specifies a technology name for the design.+
+ + units +
+Writes the UNITS statement that specifies how to convert DEF units.+
+
+
+ ![]() |
+ defwVersion | +
+
+
+ ![]() |
+ defwBusBitChars | +
+
+
+ ![]() |
+ defwDividerChar | +
+
+
+ ![]() |
+ defwDesignName | +
If you do not include these routines, default values are used.
++ + file +
+Specifies the name of the DEF file to create.+
Ends the DEF file. This routine is required and must be used last.
+Writes a blank line. This routine does not require any arguments.
+Prints the return status of the defw* routines.
++ + status +
+Specifies the nonzero integer returned by the DEF writer routines.+
The following examples show how to set up the writer. There are two ways to use the DEF writer:
+
+
+
+ ![]() |
+ You write callback routines for each section, and the writer calls your callback routines in the sequence based on the LEF/DEF Language Reference. If a section is required but you do not provide a callback routine, the writer will issue a warning. If there is a default routine, the writer will invoke the default routine with a message attached | +
This manual includes examples with and without callback routines.
+The following example uses the writer without callbacks.
+ + + + + +The following example uses the writer with callbacks.
+ + + + + + + + +The following example shows the callback routine to mark the end of the DEF design. The type is defwDesignEndCbkType.
+ + + +Blockages routines write a DEF BLOCKAGES statement. The BLOCKAGES statement is optional and can be used only once in a DEF file. For syntax information about the DEF BLOCKAGES statement, see "Blockages" in the LEF/DEF Language Reference.
+A BLOCKAGES statement must start and end with the defwStartBlockages and defwEndBlockages routines. All blockages must be defined between these routines.
+Starts a BLOCKAGES statement.
++ + count +
+Specifies the number of blockages defined in the BLOCKAGES statement.+
Ends the BLOCKAGES statement.
+Writes a DESIGNRULEWIDTH statement for the blockage. Either a SPACING or a DESIGNRULEWIDTH statement can be specified for a routing blockage. The DESIGNRULEWIDTH statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesLayerDesignRuleWidth instead.
++ + effectiveWidth +
+Specifies that the blockages have a width of effectiveWidth for the purposes of spacing calculations.+
Writes a DESIGNRULEWIDTH statement for the blockage. Either a SPACING or a DESIGNRULEWIDTH statement can be specified for a routing blockage. The DESIGNRULEWIDTH statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
++ + effectiveWidth +
+Specifies that the blockages have a width of effectiveWidth for the purposes of spacing calculations.+
Writes a LAYER statement that defines a routing blockage. When the compName argument is specified, writes a LAYER COMPONENT statement that defines a routing blockage that is associated with a component. Either a LAYER, LAYER COMPONENT, FILLS, SLOTS, or PUSHDOWN statement can be specified for each routing blockage in the BLOCKAGES statement. The LAYER and LAYER COMPONENT statements are optional and each can be used only once for each routing blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesLayer and/or defwBlockagesLayerComponent instead.
++ + layerName +
+Specifies the layer on which to create the routing blockage.+
+ + compName +
+Optional argument that specifies a component with which to associate the blockage. Specify NULL to ignore this argument.+
Writes a LAYER statement that defines a routing blockage. Any one of the LAYER, LAYER COMPONENT, FILLS, SLOTS, or PUSHDOWN statements can be specified for each routing blockage in the BLOCKAGES statement. The LAYER statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
++ + layerName +
+Specifies the layer on which to create the routing blockage.+
Writes a LAYER COMPONENT statement that defines a routing blockage that is associated with a component. Any one of the LAYER, LAYER COMPONENT, FILLS, SLOTS, or PUSHDOWN statements can be specified for each routing blockage in the BLOCKAGES statement. The LAYER COMPONENT statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
++ + compName +
+Specifies a component with which to associate the blockage.+
Writes an EXCEPTPGNET statement for a routing blockage on the given layer, which specifies that the blockage only blocks signal net routing and does not block power or ground net routing. Either a COMPONENT, SLOTS, FILLS, PUSHDOWN, or EXCEPTPGNET statement can be specified for each routing blockage in the BLOCKAGES statement. The EXCEPTPGNET statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesLayerExceptpgnet instead.
++ + layerName +
+Specifies the layer on which to create the routing blockage.+
Writes an EXCEPTPGNET statement for a routing blockage on the given layer, which specifies that the blockage only blocks signal net routing and does not block power or ground net routing. Any one of the COMPONENT, SLOTS, FILLS, PUSHDOWN, or EXCEPTPGNET statements can be specified for each routing blockage in the BLOCKAGES statement. The EXCEPTPGNET statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
++ + layerName +
+Specifies the layer on which to create the routing blockage.+
Writes a FILLS statement, which defines a routing blockage on the specified layer where metal fills cannot be placed. Either a LAYER, LAYER COMPONENT, FILLS, SLOTS, PUSHDOWN, or EXCEPTPGNET statement can be specified for each routing blockage in the BLOCKAGES statement. The FILLS statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesLayerFills instead.
++ + layerName +
+Specifies the layer on which to create the blockage.+
Writes a FILLS statement, which defines a routing blockage where metal fills cannot be placed. Any one of the LAYER, LAYER COMPONENT, FILLS, SLOTS, PUSHDOWN, or EXCEPTPGNET statements can be specified for each routing blockage in the BLOCKAGES statement. The FILLS statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
+Writes a LAYER PUSHDOWN statement, which defines the routing blockage as being pushed down into the block from the top level of the design. Either a LAYER, LAYER COMPONENT, FILLS, SLOTS, PUSHDOWN, or EXCEPTPGNET statement can be specified for each routing blockage in the BLOCKAGES statement. The LAYER PUSHDOWN statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesLayerPushdown instead.
++ + layerName +
+Specifies the layer on which the blockage lies.+
Writes a LAYER PUSHDOWN statement, which defines the routing blockage as being pushed down into the block from the top level of the design. Any one of the LAYER, LAYER COMPONENT, FILLS, SLOTS, PUSHDOWN, or EXCEPTPGNET statements can be specified for each routing blockage in the BLOCKAGES statement. The LAYER PUSHDOWN statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
++ + layerName +
+Specifies the layer on which the blockage lies.+
Writes a SLOTS statement, which defines a routing blockage where slots cannot be placed. Either a LAYER, LAYER COMPONENT, FILLS, SLOTS, PUSHDOWN, or EXCEPTPGNET statement can be specified for each routing blockage in the BLOCKAGES statement. The SLOTS statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
++ + layerName +
+Specifies the layer on which to create the blockage.+
Writes a PLACEMENT statement, which defines a placement blockage. Either a PLACEMENT, PLACEMENT COMPONENT, PLACEMENT PUSHDOWN, PLACEMENT PARTIAL, or PLACEMENT SOFT statement can be specified for each placement blockage in the BLOCKAGES statement. The PLACEMENT statement is optional and can be used only once for each placement blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesPlacement instead.
+Writes a PLACEMENT statement, which defines a placement blockage. Any one of the PLACEMENT, PLACEMENT COMPONENT, PLACEMENT PUSHDOWN, PLACEMENT PARTIAL, or PLACEMENT SOFT statements can be specified for each placement blockage in the BLOCKAGES statement. The PLACEMENT statement is optional and can be used only once for each placement blockage in the BLOCKAGES statement.
+Writes a PLACEMENT COMPONENT statement, which defines a placement blockage associated with a component. Either a PLACEMENT, PLACEMENT COMPONENT, PLACEMENT PUSHDOWN, PLACEMENT PARTIAL, or PLACEMENT SOFT statement can be specified for each placement blockage in the BLOCKAGES statement. The PLACEMENT COMPONENT statement is optional and can be used only once for each placement blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesPlacementComponent instead.
++ + compName +
+Specifies the component with which to associate the blockage.+
Writes a PLACEMENT COMPONENT statement, which defines a placement blockage associated with a component. Any one of the PLACEMENT, PLACEMENT COMPONENT, PLACEMENT PUSHDOWN, PLACEMENT PARTIAL, or PLACEMENT SOFT statements can be specified for each placement blockage in the BLOCKAGES statement. The PLACEMENT COMPONENT statement is optional and can be used only once for each placement blockage in the BLOCKAGES statement.
++ + compName +
+Specifies the component with which to associate the blockage.+
Writes a PLACEMENT PARTIAL statement, which specifies that the initial placement should not use more than maxDensity percentage of the blockage area for standard cells. Either a PLACEMENT, PLACEMENT PARTIAL, PLACEMENT COMPONENT, PLACEMENT SOFT, or PLACEMENT PUSHDOWN statement can be specified for each placement blockage. The PLACEMENT PARTIAL statement is optional and can be used only once for each placement blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesPlacementPartial instead.
++ + maxDensity +
+Specifies the maximum density value. The initial placement will not use more than maxDensity percentage of the blockage area for standard cells.+
Value: 0.0-100.0
Writes a PLACEMENT PARTIAL statement, which specifies that the initial placement should not use more than maxDensity percentage of the blockage area for standard cells. Any one of the PLACEMENT, PLACEMENT PARTIAL, PLACEMENT COMPONENT, PLACEMENT SOFT, or PLACEMENT PUSHDOWN statements can be specified for each placement blockage. The PLACEMENT PARTIAL statement is optional and can be used only once for each placement blockage in the BLOCKAGES statement.
++ + maxDensity +
+Specifies the maximum density value. The initial placement will not use more than maxDensity percentage of the blockage area for standard cells.+
Value: 0.0-100.0
Writes a PLACEMENT PUSHDOWN statement, which defines the placement blockage as being pushed down into the block from the top level of the design. Either a PLACEMENT, PLACEMENT COMPONENT, PLACEMENT PUSHDOWN, PLACEMENT PARTIAL, or PLACEMENT SOFT statement can be specified for each placement blockage in the BLOCKAGES statement. The PLACEMENT PUSHDOWN statement is optional and can be used only once for each placement blockage in a BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesPlacementPushdown instead.
+Writes a PLACEMENT PUSHDOWN statement, which defines the placement blockage as being pushed down into the block from the top level of the design. Any one of the PLACEMENT, PLACEMENT COMPONENT, PLACEMENT PUSHDOWN, PLACEMENT PARTIAL, or PLACEMENT SOFT statement can be specified for each placement blockage in the BLOCKAGES statement. The PLACEMENT PUSHDOWN statement is optional and can be used only once for each placement blockage in a BLOCKAGES statement.
+Writes a PLACEMENT SOFT statement, which specifies that the initial placement should not use the blockage area, but later timing optimization phases can use the blockage area. Either a PLACEMENT, PLACEMENT PARTIAL, PLACEMENT COMPONENT, PLACEMENT SOFT, or PLACEMENT PUSHDOWN statement can be specified for each placement blockage. The PLACEMENT SOFT statement is optional and can be used only once for each placement blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesPlacementSoft instead.
+Writes a PLACEMENT SOFT statement, which specifies that the initial placement should not use the blockage area, but later timing optimization phases can use the blockage area. Any one of the PLACEMENT, PLACEMENT PARTIAL, PLACEMENT COMPONENT, PLACEMENT SOFT, or PLACEMENT PUSHDOWN statements can be specified for each placement blockage. The PLACEMENT SOFT statement is optional and can be used only once for each placement blockage in the BLOCKAGES statement.
+Writes a POLYGON statement. Either a RECT or a POLYGON statement is required with a LAYER, LAYER COMPONENT, FILLS, SLOTS, or PUSHDOWN statement. The POLYGON statement can be used more than once for each routing blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesPolygon instead.
++ + num_polys +
+Specifies the number of polygon sides.+
+ + xl yl +
+Specifies a sequence of points to generate a polygon geometry. The polygon edges must be parallel to the x axis, to the y axis, or at a 45-degree angle.+
Writes a POLYGON statement. Either a RECT or a POLYGON statement is required with a LAYER, LAYER COMPONENT, FILLS, SLOTS, or PUSHDOWN statement. The POLYGON statement can be used more than once for each routing blockage in the BLOCKAGES statement.
++ + num_polys +
+Specifies the number of polygon sides.+
+ + xl yl +
+Specifies a sequence of points to generate a polygon geometry. The polygon edges must be parallel to the x axis, to the y axis, or at a 45-degree angle.+
Writes a RECT statement. Either a RECT or a POLYGON statement is required with a LAYER, LAYER COMPONENT, FILLS, SLOTS, or LAYER PUSHDOWN statement. A RECT statement is also required with a PLACEMENT COMPONENT or PLACEMENT PUSHDOWN statement. The RECT statement can be used more than once for each blockage in the BLOCKAGES statement.
+Note: This function will become obsolete in the next parser release. Use defwBlockagesRect instead.
++ + xl yl xh yh +
+Specifies the absolute coordinates of the blockage geometry.+
Writes a RECT statement. Either a RECT or a POLYGON statement is required with a LAYER, LAYER COMPONENT, FILLS, SLOTS, or LAYER PUSHDOWN statement. A RECT statement is also required with a PLACEMENT COMPONENT or PLACEMENT PUSHDOWN statement. The RECT statement can be used more than once for each blockage in the BLOCKAGES statement.
++ + xl yl xh yh +
+Specifies the absolute coordinates of the blockage geometry.+
Writes the blockage layer color mask.
++ + maskColor +
+Specifies the mask color.+
Writes a SPACING statement for the blockage. Either a SPACING or a DESIGNRULEWIDTH statement can be specified for a routing blockage. The SPACING statement is optional and can be used only once for each routing blockage in the BLOCKAGES statement.
++ + minSpacing +
+Specifies the minimum spacing between this blockage and any other routing shape.+
The Bus Bit Characters routine writes a DEF BUSBITCHARS statement. The BUSBITCHARS statement is required and can be used only once in a DEF file. For syntax information about the DEF BUSBITCHARS statement, see "Bus Bit Characters" in the LEF/DEF Language Reference.
+This routine returns 0 if successful.
+Writes a BUSBITCHARS statement.
++ + busBitChars +
+Specifies the pair of characters used to specify bus bits when DEF names are mapped to or from other databases. The characters must be enclosed in double quotation marks.+
If one of the bus bit characters appears in a DEF name as a regular character, you must use a backslash ( \) before the character to prevent the DEF reader from interpreting the character as a bus bit delimiter.
Components routines write a DEF COMPONENTS section. The COMPONENTS section is optional and can be used only once in a DEF file. For syntax information about the DEF COMPONENTS section, see "Components" in the LEF/DEF Language Reference.
+The COMPONENTS section must start and end with the defwStartComponents and defwEndComponents routines. All components must be defined between these routines.
+If the DEF file contains a REGIONS statement, the COMPONENTS statement must follow it. For more information about the DEF REGIONS routines, see "Regions".
+For examples of the routines described here, see "Components Example".
+Note: To write a PROPERTY statement for the component, you must use one of the property routines between the routines described here. For more information, see "Property Statements".
+All routines return 0 if successful.
+Starts the COMPONENTS section.
++ + count +
+Specifies the number of components defined in the COMPONENTS section.+
Ends the COMPONENTS section.
+If the count specified in defwStartComponents is not the same as the actual number of defwComponent routines used, this routine returns DEFW_BAD_DATA.
+Writes a set of statements that define one component. This routine is required and can be used more than once in the COMPONENTS statement.
+If you specify 0 for all optional arguments except weight, they are ignored. For weight, you must specify -1.0.
++ + eeq +
+Optional argument that specifies that the component being defined should be electrically equivalent to eeq (a previously defined component). Specify NULL to ignore this argument.+
+ + master +
+Specifies the name of a model defined in the library.+
+ + name +
+Specifies the component name, which is an instance of master.+
+ + region +
+Optional argument that specifies the name of a previously defined region in which the component must lie. Specify NULL to ignore this argument.+
+ + status +
+Optional argument that specifies the component state. Specify NULL to ignore this argument.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Specifies that the component has a location, but can be moved using automatic layout tools. + |
+
+ + | ++ + | ++ + | +
+ + statusOrient +
+Optional argument that specifies the orientation of the component. Specify -1 to ignore this argument.+
Value: 0 to 7. For more information, see "Orientation Codes".
+ + statusX statusY +
+Optional arguments that specify the location of the component. Specify 0 to ignore these arguments.+
+ + source +
+Optional argument that specifies the source of the component. Specify NULL to ignore this argument.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Component is generated by the user for some user-defined reason. + |
+
+ + weight +
+Optional argument that specifies the weight of the component, which determines if automatic placement attempts to keep the component near the specified location. weight is only meaningful when the component is placed. All non-zero weights have the same effect during automatic placement. Specify 0 to ignore this argument.+
Also writes a set of statements that define one component. This routine is the same as the defwComponent routine, with the exception of the foreignOrients argument, which takes a string instead of an integer.This routine is required and can be used more than once in the COMPONENTS statement.
+If you specify 0 for all optional arguments except weight, they are ignored. For weight, you must specify -1.0.
++ + eeq +
+Optional argument that specifies that the component being defined should be electrically equivalent to eeq (a previously defined component). Specify NULL to ignore this argument.+
+ + master +
+Specifies the name of a model defined in the library.+
+ + name +
+Specifies the component name, which is an instance of master.+
+ + region +
+Optional argument that specifies the name of a previously defined region in which the component must lie. Specify NULL to ignore this argument.+
+ + status +
+Optional argument that specifies the component state. Specify NULL to ignore this argument.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Specifies that the component has a location, but can be moved using automatic layout tools. + |
+
+ + | ++ + | ++ + | +
+ + statusOrient +
+Optional argument that specifies the orientation of the component. Specify NULL to ignore this argument.+
Value: N, W, S, E, FN, FW, FS, or FE
+ + statusX statusY +
+Optional arguments that specify the location of the component. Specify 0 to ignore these arguments.+
+ + source +
+Optional argument that specifies the source of the component. Specify NULL to ignore this argument.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Component is generated by the user for some user-defined reason. + |
+
+ + weight +
+Optional argument that specifies the weight of the component, which determines if automatic placement attempts to keep the component near the specified location. weight is only meaningful when the component is placed. All non-zero weights have the same effect during automatic placement. Specify 0 to ignore this argument.+
Writes a HALO statement for a component. The HALO statement creates a placement blockage around the component. The HALO statement is optional and can be used only once for each component in the COMPONENT statement. If you call this routine, you cannot call defwComponentHaloSoft.
++ + left bottom right top +
+Specifies the amount the halo extends from the left, bottom, right, and top edges of the LEF macro.+
Writes a HALO SOFT statement. This routine is similar to defwComponentHalo, except that it also writes the SOFT option. The HALO SOFT statement is optional and can be used only once for each component. If you call this routine, you cannot call defwComponentHalo.
++ + left bottom right top +
+Specifies the amount the halo extends from the left, bottom, right, and top edges of the LEF macro.+
Writes a ROUTEHALO statement. The ROUTEHALO statement is optional and can be used only once for each component.
++ + haloDist +
+Specifies the halo distance, as an integer in DEF database units.+
+ + minLayer +
+Specifies the minimum layer. The routing halo exists for the routing layers between minLayer and maxLayer. minLayer must be a lower routing layer than maxLayer. minLayer must be a string that matches a LEF routing layer name.+
+ + maxLayer +
+Specifies the maximum layer. The routing halo exists for the routing layers between minLayer and maxLayer. maxLayer must be a string that matches a LEF routing layer name.+
The following example shows a callback routine with the type defwComponentCbkType. This example only shows the usage of some functions related to component.
+ + +The Design routine writes a DEF DESIGN statement. The DESIGN statement is required and can be used only once in a DEF file. For syntax information about the DESIGN statement, see "Design" in the LEF/DEF Language Reference.
+This routine returns 0 if successful.
+Writes a DESIGN statement.
++ + name +
+Specifies a name for the design.+
Die Area routines write a DEF DIEAREA statement. The DIEAREA statement is optional and can be used only once in a DEF file. For syntax information about the DEF DIEAREA statement, see "Die Area" in the LEF/DEF Language Reference.
+If the DEF file contains a PROPERTYDEFINITIONS statement, the DIEAREA statement must follow it. For more information about the DEF PROPERTYDEFINITIONS statement, see "Property Definitions".
+This routine returns 0 if successful.
+Writes a DIEAREA statement.
++ + xl, yl, xh, yh +
+Specifies the points of two corners of the bounding rectangle for the design. Geometric shapes (such as blockages, pins, and special net routing) can be outside of the die area, to allow proper modeling of pushed down routing from top-level designs into sub blocks. However, routing tracks should still be inside the die area.+
Writes a DIEAREA statement that includes more than two points.
++ + num_points +
+Specifies the number of points specified.+
+ + xl yh +
+Specifies the points of a polygon that forms the die area. Geometric shapes (such as blockages, pins, and special net routing) can be outside of the die area, to allow proper modeling of pushed down routing from top-level designs into sub blocks. However, routing tracks should still be inside the die area.+
The following example shows a callback routine with the type defwDieAreaCbkType.
+ +The Divider Character routine writes a DEF DIVIDERCHAR statement. The DIVIDERCHAR statement is required and can be used only once in a DEF file. For syntax information about the DIVIDERCHAR statement, see "Divider Character" in the LEF/DEF Language Reference.
+This routine returns 0 if successful.
+Writes a DIVIDERCHAR statement.
++ + dividerChar +
+Specifies the character used to express hierarchy when DEF names are mapped to or from other databases. The character must be enclosed in double quotation marks.+
If the divider character appears in a DEF name as a regular character, you must use a backslash (\) before the character to prevent the DEF reader from interpreting the character as a hierarchy delimiter.
The Extension routines write a series of statements that define the EXTENSIONS statement in the DEF file. The EXTENSIONS statement is optional and can be used only once in a DEF file. For syntax information about the EXTENSIONS statement, see "Extensions" in the LEF/DEF Language Reference.
+You must use the defwStartBeginext and defwEndBeginext routines to create an EXTENSIONS statement. You must define all extensions between these routines.
+For examples of the routines described here, see "Extensions Example".
+All routines return 0 if successful.
+Starts the EXTENSIONS statement.
++ + name +
+Specifies the extension name.+
Ends the BEGINEXT statement.
+Writes a CREATOR statement. The CREATOR statement is optional and can be used only once in an EXTENSIONS statement.
++ + creatorName +
+Specifies a string value that defines the creator value.+
Writes a DATE statement that specifies the current system time and date. The DATE statement is optional and can be used only once in an EXTENSIONS statement.
+Writes a REVISION statement. The REVISION statement is optional and can be used only once in an EXTENSIONS statement.
++ + vers1, vers2 +
+Specifies the values used for the revision number string.+
Adds customized syntax to the DEF file. This routine is optional and can be used more than once in an EXTENSIONS statement.
++ + title, string +
+Specify any values you need.+
The following example shows a callback routine with the type defwExtCbkType. This example only shows the usage of some functions related to extensions.
+ +Fills routines write a DEF FILLS statement. The FILLS statement is optional and can be used only once in a DEF file. For syntax information about the DEF FILLS statement, see "Fills" in the LEF/DEF Language Reference.
+The DEF FILLS statement must start and end with the defwStartFills and defwEndFills routines. All fills must be defined between these routines.
+All routines return 0 if successful.
+Starts a FILLS statement.
++ + count +
+Specifies the number of fills defined in the FILLS statement.+
Ends the FILLS statement.
+Writes a LAYER statement. The LAYER statement is required for each fill and can be used more than once in a FILLS statement.
++ + layerName Specifies the layer on which to create the fill. +
+Writes an OPC keyword for a FILLS LAYER statement, which specifies that FILL shapes require OPC correction during mask generation. defwFillLayer must be called before this routine. This routine is optional and can be called only once after the defwFillLayer or defwFillVia routine.
+Specifies the points for a FILLS VIA statement. This routine is required after defwFillVia and can be called more than once.
++ + num_points +
+Specifies the number of points provided.+
+ + x1 y1 +
+Specify the placement locations (x y points) for the via.+
Writes a POLYGON statement. Either a POLYGON or a RECT statement is required with a LAYER statement. The POLYGON statement is required and can be used more than once for each fill in the FILLS statement.
++ + num_polys +
+Specifies the number of polygon sides.+
+ + xl yl +
+Specifies a sequence of points to generate a polygon geometry. The polygon edges must be parallel to the x axis, the y axis, or at a 45-degree angle.+
Writes a RECT statement. Either a POLYGON or a RECT statement is required with a LAYER statement. The RECT statement is required and can be used more than once for each fill in the FILLS statement.
++ + xl, yl, xh, yh +
+Specifies the coordinates of the fill.+
Writes a FILLS VIA statement. The FILLS VIA statement is optional and can be used more than once. Call defwFillPoints after this routine.
++ + viaName +
+The name of the via, which must be previously defined in the DEF VIA or LEF VIA section.+
Writes the OPC keyword for a FILLS VIA statement, which specifies that FILL shapes require OPC correction during mask generation. This routine is optional and can only be called after defwFillVia.
+The Gcell Grid routine writes a DEF GCELLGRID statement. The GCELLGRID statement is optional and can be used only once in a DEF file. For syntax information about the DEF GCELLGRID statement, see GCell Grid in the LEF/DEF Language Reference.
+If the DEF file contains a TRACKS statement, the GCELLGRID statement must follow it. For more information about the DEF TRACKS statement, see "Tracks".
+This routine returns 0 if successful.
+Writes a GCELLGRID statement.
++ + doCount +
+Specifies the number of columns or rows in the grid.+
+ + doStart +
+Specifies the starting location of the grid (that is, the first column or row).+
+ + doStep +
+Specifies the step spacing between the grid units.+
+ + master +
+Specifies the direction of the tracks for the global router grid that overlays the array.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
The following example shows a callback routine with the type defwGcellGridCbkType.
+ +The Groups routines write a DEF GROUPS statement. The GROUPS statement is optional and can be used only once in a DEF file. For syntax information about the DEF GROUPS statement, see Groups in the LEF/DEF Language Reference.
+You must begin and end a DEF GROUPS statement with the defwStartGroups and defwEndGroups routines. You must define all groups between these routines.
+For examples of the routines described here, see "Groups Example".
+Note: To write a PROPERTY statement for the component, you must use one of the property routines immediately following the defwGroup* routines that define the group. For more information, see "Property Statements".
+All routines return 0 if successful.
+Starts the GROUPS statement.
++ + count +
+Specifies the number of groups defined in the GROUPS statement.+
Ends the GROUPS statement.
+Writes a series of statements that define the specified group. This routine is required and can be used more than once in a GROUPS statement.
++ + groupExpr +
+Specifies a component name, a list of component names, or a regular expression for a set of components.+
+ + groupName +
+Specifies the name for a group of components.+
+ + numExpr +
+Specifies the number of components in the group.+
Writes a REGION statement for the group defined. This statement is optional and can be used only once per group name.
++ + regionName +
+Specifies the name of a previously defined region in which the group must lie.+
+ + xl xh yl yh +
+Specifies the coordinates of a rectangular region in which the group must lie. Specify the coordinates or regionName; do not specify both.+
The following example shows a callback routine with the type defwGroupCbkType.
+ +The History routine writes a DEF HISTORY statement. The HISTORY statement is optional and can be used more than once in a DEF file. For syntax information about the DEF HISTORY statement, see History in the LEF/DEF Language Reference.
+This routine returns 0 if successful.
+Writes a HISTORY statement.
++ + string +
+Lists a historical record about the design. Each line indicates one historical record. Any text excluding a semicolon (;) can be included. Linefeed and Return do not terminate the statement.+
The following example shows a callback routine with the type defwHistoryCbkType.
+ +Nets routines write a DEF NETS statement. The NETS statement is optional and can be used only once in a DEF file. For syntax information about the DEF NETS statement, see "Nets" in the LEF/DEF Language Reference.
+A NETS statement must start and end with the defwStartNets and defwEndNets routines. All nets must be defined between these routines. Each individual net must start and end with either defwNet or defwNetMustjoinConnection, and defwNetEndOneNet.
+For examples of the routines described here, see "Nets Example".
+In addition to the routines in this section, you can also include routines that form a regularWiring statement, a SUBNET statement, and a PROPERTY statement. For information about these routines, see "Regular Wiring" , "Subnet" , and "Property Statements".
+All routines return 0 if successful.
+Starts a NETS statement. A NET statement must start and end with defwStartNets and defwEndNets.
++ + count +
+Specifies the number of nets defined in the NETS statement.+
Ends the NETS statement. A NET statement must start and end with defwStartNets and defwEndNets.
+Starts a net description in the NETS statement. Each net description must start with either defwNet or defwNetMustJoinConnection, and end with defwNetEndOneNet.
+If you specify this routine, you can optionally specify the following routine:
+
+
+
+ ![]() |
+ defwNetConnection | +
+ + netName +
+Specifies the name of the net.+
Writes a MUSTJOIN statement in the NETS statement. Each net description must start with either defwNet or defwNetMustJoinConnection, and end with defwNetEndOneNet.
++ + compName, pinName +
+Identifies the net as a mustjoin by specifying one of its pins, using a component name and pin name.+
Ends a net description in the NETS statement. Each net description must start with either defwNet or defwNetMustJoinConnection, and end with defwNetEndOneNet.
+Defines the net specified in defwNet. This routine can be used more than once for each net in a NETS statement.
+ ++ + compName +
+Specifies the name of a regular component pin on the net. If you omit this value, the DEF writer writes the PIN statement.+
+ + pinName +
+Specifies the name of an I/O pin on the net.+
+ + synthesized +
+Optional argument that marks the pin as part of a synthesized scan chain.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Writes a SYNTHESIZED statement. + |
+
Writes an ESTCAP statement. The ESTCAP statement is optional and can be used only once for each net in the NETS statement.
++ + wireCap +
+Specifies the estimated wire capacitance for the net. ESTCAP can be loaded with simulation data to generate net constraints for timing-driven layout.+
Writes a FIXEDBUMP statement that indicates a bump cannot be assigned to a different pin. The FIXEDBUMP statement is optional and can be used only once for a net.
+Writes a FREQUENCY statement. The FREQUENCY statement is optional and can be used only once for a net.
++ + frequency +
+Specifies the frequency of the net, in hertz. The frequency value is used by the router to choose the correct number of via cuts required for a given net, and by validation tools to verify that the AC current density rules are met.+
Writes a NONDEFAULTRULE statement. The NONDEFAULTRULE statement is optional and can be used only once for a net.
++ + ruleName +
+Specifies that the net and wiring are created according to the specified nondefault rule defined in LEF.+
Writes an ORIGINAL statement. The ORIGINAL statement is optional and can be used only once for a net.
++ + netName +
+Specifies the name of the original net partitioned to create multiple nets, including the net being defined.+
Writes a PATTERN statement. The PATTERN statement is optional and can be used only once for a net.
++ + name +
+Specifies the routing pattern used for the net.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Used in ECL designs to connect output and mustjoin pins before routing to the remaining pins. + |
+
Writes a SOURCE statement. The SOURCE statement is optional and can be used only once for a net.
++ + name +
+Specifies the source of the net.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
Writes a USE statement. The USE statement is optional and can be used only once for a net.
++ + name +
+Specifies how the net is used.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
Writes a VPIN statement. The VPIN statement is optional and can be used more than once for a net.
++ + layerName +
+Optional argument that specifies the layer on which the virtual pin lies. Specify NULL to ignore this argument.+
+ + layerXl layerYl layerXh layerYh +
+Specifies the physical geometry of the virtual pin.+
+ + orient +
+Optional argument that specifies the orientation of the virtual pin. Specify -1 to ignore this argument.+
Value: 0 to 7. For more information, see "Orientation Codes".
+ + status +
+Optional argument that specifies the placement status of the virtual pin. Specify NULL to ignore this argument.+
Value: specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Specifies that the pin has a location, but can be moved during automatic layout. + |
+
+ + statusX statusY +
+Optional arguments that specify the placement location of the virtual pin. If you specify status, you must specify these arguments. Specify 0 to ignore these arguments.+
+ + vpinName +
+Specifies the name of the virtual pin to define.+
Also writes a VPIN statement. This routine is the same as the defwNetVpin routine, with the exception of the orient argument, which takes a string instead of an integer. The VPIN statement is optional and can be used more than once for a net.
++ + layerName +
+Optional argument that specifies the layer on which the virtual pin lies. Specify NULL to ignore this argument.+
+ + layerXl layerYl layerXh layerYh +
+Specifies the physical geometry of the virtual pin.+
+ + orient +
+Optional argument that specifies the orientation of the virtual pin. Specify NULL to ignore this argument.+
Value: N, W, S, E, FN, FW, FS, or FE
+ + status +
+Optional argument that specifies the placement status of the virtual pin. Specify NULL to ignore this argument.+
Value: specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Specifies that the pin has a location, but can be moved during automatic layout. + |
+
+ + statusX statusY +
+Optional arguments that specify the placement location of the virtual pin. If you specify status, you must specify these arguments. Specify 0 to ignore these arguments.+
+ + vpinName +
+Specifies the name of the virtual pin to define.+
Writes a WEIGHT statement. The WEIGHT statement is optional and can be used only once for a net.
++ + weight +
+Specifies the weight of the net. Automatic layout tools attempt to shorten the lengths of nets with high weights. A value of 0 indicates that the net length for that net can be ignored. A value of 1 specifies that the net should be treated normally. A larger weight specifies that the tool should try harder to minimize the net length of that net.+
For normal use, timing constraints are generally a better method to use for controlling net length than net weights. For the best results, you should typically limit the maximum weight to 10, and not add weights to more than 3 percent of the nets.
Writes a XTALK statement. The XTALK statement is optional and can be used only once for a net.
++ + num +
+Specifies the crosstalk class number for the net. If you specify the default value (0), the XTALK statement will not be written to the DEF file.+
Value: 0 to 200
The following example shows a callback routine with the type defwNetCbkType. This example only shows the usage of some functions related to net.
+ +Routines described in this section form a regularWiring statement that can be used to define regular wiring for a net or subnet. The regularWiring statement is optional and can be used more than once in a NETS statement. For syntax information about the DEF NETS statement, see "Nets" in the LEF/DEF Language Reference.
+A regularWiring statement must start and end with the defwNetPathStart and defwNetPathEnd routines. All regular wiring must be defined between these routines.
+For examples of the routines described here, see "Regular Wiring Example".
+The regular wiring routines can be included between the following pairs of routines:
+
+
+
+ ![]() |
+ defwNet and defwEndOneNet | +
+
+
+ ![]() |
+ defwNetMustjoinConnection and defwEndOneNet | +
+
+
+ ![]() |
+ defwNetSubnetStart and defwSubnetEnd | +
All routines return 0 if successful.
+Starts a regularWiring statement.
++ + type +
+Specifies the regular wiring type.+
Value: Specify one of the following:
+ + | ++ + | +
+ Specifies that the wiring cannot be moved by either automatic layout or interactive commands. + |
+
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Specifies that the wiring can be moved by the automatic layout tools. + |
+
+ + | ++ + | +
+ Specifies that the last wide segment of the net is not shielded. + |
+
Ends the regularWiring statement.
+Writes a LAYER statement. The LAYER statement is required and can be used more than once in the regularWiring statement.
++ + layerName +
+Specifies the layer name on which the wire lies.+
+ + isTaper +
+Optional argument that writes the keyword TAPER, which specifies that the next contiguous wire segment is created using the default rule.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Writes the keyword TAPER. If you specify 1, you must specify NULL for the rulename argument. + |
+
+ + ruleName +
+Optional argument that specifies that the next contiguous wire segment is created using the specified nondefault rule (ruleName). Specify NULL to ignore this argument. If you specify a rulename, you must specify 0 for the isTaper argument.+
Defines the center line coordinates of the route on the layer specified with defwNetPathLayer. This routine is required and can be used only once for each layer in the regularWiring statement.
++ + numPts +
+Specifies the number of points in the wire path (route)+
+ + pointX pointY +
+Specifies the coordinates of the path points.+
+ + value +
+Optional argument that specifies the amount by which the wire is extended past the end point of the segment. This value must be greater than or equal to 0 (zero). Specify NULL to ignore this argument.+
Writes a STYLE statement for the layer specified with defwNetPathLayer. The STYLE statement is optional and can be used only once for each layer in the regularWiring statement.
++ + styleNum +
+Specifies a previously defined style from the STYLES section in this DEF file. If a style is specified, the wire's shape is defined by the center line coordinates and the style.+
Specifies a via to place at the last point on the layer specified with defwNetPathLayer. This routine is optional and can be used only once for each layer in the regularWiring statement.
++ + viaName +
+Specifies the via to place at the last specified path coordinate.+
Specifies the orientation of the via specified with defwNetPathVia. This routine is optional and can be used only once for each via in the regularWiring statement.
++ + name +
+Specifies the via.+
+ + orient +
+Specifies the orientation.+
Value: 0 to 7. For more information, see "Orientation Codes"
Also specifies the orientation of the via specified with defwNetPathVia. This routine is the same as the defwNetPathViaWithOrient routine, with the exception of the orient argument, which takes a string instead of an integer. The defwNetPathViaWithOrientStr is optional and can be used only once for each via in the regularWiring statement.
++ + name +
+Specifies the via.+
+ + orient +
+Specifies the orientation. Specify NULL to ignore this argument.+
Value: N, W, S, E, FN, FW, FS, or FE
The Subnet routines write a SUBNET statement which further defines a net. A SUBNET statement is optional and can be used more than once in a NETS statement. For information about the DEF NETS statement, see "Nets" in the LEF/DEF Language Reference.
+You must begin and end a SUBNET statement with the defwNetSubnetStart and defwSubnetEnd routines. You must define all subnets between these routines.
+For examples of the routines described here, see "Subnet Example".
+In addition to the routines described in this section, you can include a NONDEFAULTRULE statement and a regularWiring statement within a SUBNET statement. For more information about these routines, see defwNetNondefaultRule , or "Regular Wiring".
+All routines return 0 if successful.
+Starts a SUBNET statement. This statement is optional and can be used only once in a NETS statement.
++ + name +
+Specifies the name of the subnet.+
Ends a SUBNET statement.
+Specifies a component for the SUBNET statement. This routine is optional and can be used more than once in a SUBNET statement.
++ + component +
+Specifies either a component name, or the value PIN or VPIN.+
+ + name +
+Specifies either a pin name if component is set to PIN, or a virtual pin name if component is set to VPIN.+
Nondefault rule routines write a DEF NONDEFAULTRULES statement. The NONDEFAULTRULES statement is optional and can be used only once in a DEF file. For syntax information about the DEF NONDEFAULTRULES statement, see "Nondefault Rules" in the LEF/DEF Language Reference.
+The NONDEFAULTRULES statement must start and end with the defwStartNonDefaultRules and defwEndNonDefaultRules routines. All nondefault rules must be defined between these two routines. Each individual nondefault rule must start with defwNonDefaultRule.
+Note: To write a PROPERTY statement for the nondefault rule, you must use one of the property routines immediately following the defwNonDefaultRule routine. For more information, see "Property Statements".
+All routines return 0 if successful.
+Starts a NONDEFAULTRULES statement.
++ + count +
+Specifies the number of rules defined in the NONDEFAULTRULES statement.+
Ends the NONDEFAULTRULES statement.
+Starts a nondefault rule definition. This routine is required for each nondefault rule and can be used more than once in the NONDEFAULTRULES statement.
++ + ruleName +
+Specifies the name for this nondefault rule. This name can be used in the NETS section wherever a nondefault rule name is allowed. The reserved name DEFAULT can be used to indicate the default routing rule used in the NETS section.+
+ + hardSpacing +
+Optional argument that specifies that any spacing values that exceed the LEF LAYER ROUTING spacing requirements are "hard" rules instead of "soft" rules. Specify 0 to ignore this argument.+
Writes a LAYER statement for the nondefault rule. The LAYER statement is required and can be used more than once for each nondefault rule in the NONDEFAULTRULES statement.
++ + layerName +
+`Specifies the layer for the various width and spacing values. layerName must be a routing layer.+
+ + width +
+Specifies the required minimum width allowed for layerName.+
+ + diagWidth +
+Optional argument that specifies the diagonal width for layerName, when 45-degree routing is used. Specify 0 to ignore this argument.+
+ + spacing +
+Optional argument that specifies the minimum spacing for layerName. The LEF LAYER SPACING or SPACINGTABLE definitions always apply; therefore it is only necessary to add a SPACING value if the desired spacing is larger than the LAYER rules already require. Specify 0 to ignore this argument.+
+ + wireExt +
+Optional argument that specifies the distance by which wires are extended at vias on layerName. Specify 0 to ignore this argument.+
Writes a MINCUTS statement. The MINCUTS statement is optional and can be used more than once for each nondefault rule in the NONDEFAULTRULES statement.
++ + cutLayerName +
+Specifies the cut layer.+
+ + numCuts +
+Specifies the minimum number of cuts allowed for any via using cutLayerName. All vias (generated or fixed vias) used for this nondefault rule must have at least numCuts cuts in the via.+
Writes a VIA statement for the nondefault rule. The VIA statement is optional and can be used more than once for each nondefault rule in the NONDEFAULTRULES statement.
++ + viaName +
+Specifies a previously defined LEF or DEF via to use with this rule.+
Writes a VIARULE statement. The VIARULE statement is optional and can be used more than once for each nondefault rule in the NONDEFAULTRULES statement.
++ + viaRuleName +
+Specifies a previously defined LEF VIARULE GENERATE to use with this routing rule. If no via or via rule is specified for a given routing-cut-routing layer combination, then a VIARULE GENERATE DEFAULT via rule must exist for that combination, and it is implicitly inherited.+
Pin routines write a DEF PINS statement. The PINS statement is optional and can be used only once in a DEF file. For syntax information about the DEF PINS statement, see "Pins" in the LEF/DEF Language Reference.
+A PINS statement must start and end with the defwStartPins and defwEndPins routines. All pins must be defined between these routines. Each individual pin must start with a defwPin routine.
+If the DEF file contains a COMPONENTS statement, the PINS statement must follow it. For more information about DEF COMPONENTS routines, see "Components".
+For examples of the routines described here, see "Pins Example".
+Note: To write a PROPERTY statement for the pin, you must use one of the property routines immediately following the defwPin routine. For more information, see "Property Statements".
+All routines return 0 if successful.
+Starts a PINS statement.
++ + count +
+Specifies the number of pins defined in the PINS statement.+
Ends the PINS statement. If count is not the same as the actual number of defwPin routines used, defwEndPins returns DEFW_BAD_DATA.
+Starts a pin description in the PINS statement. Each pin description must start with defwPin. This routine is required and can be used more than once in a PINS statement.
++ + direction +
+Optional argument that specifies the pin type. Specify NULL to ignore this argument.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Pin that can accept signals going either in or out of the cell. + |
+
+ + netName +
+Specifies the corresponding internal net name.+
+ + orient +
+Optional argument that specifies the orientation for the pin. Specify -1 to ignore this argument.+
Value: 0 to 7. For more information, see "Orientation Codes".
+ + pinName +
+Specifies the name for the external pin.+
+ + special +
+Optional argument that identifies the pin as a special pin. Specify 0 to ignore this argument.+
Value: Specify one of the following: I
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Writes a SPECIAL statement. + |
+
+ + status +
+Optional argument that specifies the placement status of the pin. Specify NULL to ignore this argument.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Specifies that the pin has a location, but can be moved during automatic layout. + |
+
+ + statusX statusY +
+Optional arguments that specify the placement location of the pin. If you specify status, you must specify these arguments.Specify 0 to ignore these arguments.+
+ + use +
+Optional argument that specifies how the pin is used. Specify NULL to ignore this argument.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Pin is used for connectivity to the chip-level ground distribution network. + |
+
+ + | ++ + | +
+ Pin is used for connectivity to the chip-level power distribution network. + |
+
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
Also starts a pin description in the PINS statement. This routine is the same as the defwPin routine, with the exception of the orient argument, which takes a string instead of an integer. Each pin description must start with defwPin. This routine is required and can be used more than once in a PINS statement.
++ + direction +
+Optional argument that specifies the pin type. Specify NULL to ignore this argument.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Pin that can accept signals going either in or out of the cell. + |
+
+ + netName +
+Specifies the corresponding internal net name.+
+ + orient +
+Optional argument that specifies the orientation for the pin. Specify NULL to ignore this argument.+
Value: N, W, S, E, FN, FW, FS, or FE
+ + pinName +
+Specifies the name for the external pin.+
+ + special +
+Optional argument that identifies the pin as a special pin. Specify 0 to ignore this argument.+
Value: Specify one of the following: I
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Writes a SPECIAL statement. + |
+
+ + status +
+Optional argument that specifies the placement status of the pin. Specify NULL to ignore this argument.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Specifies that the pin has a location, but can be moved during automatic layout. + |
+
+ + statusX statusY +
+Optional arguments that specify the placement location of the pin. If you specify status, you must specify these arguments.Specify 0 to ignore these arguments.+
+ + use +
+Optional argument that specifies how the pin is used. Specify NULL to ignore this argument.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Pin is used for connectivity to the chip-level ground distribution network. + |
+
+ + | ++ + | +
+ Pin is used for connectivity to the chip-level power distribution network. + |
+
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
Writes an ANTENNAMODEL statement. The ANTENNAMODEL statement is optional and can be used more than once in a pin definition.
++ + oxide +
+Specifies the oxide model for the pin. Each model can be specified once per layer. If you specify an ANTENNAMODEL statement, that value affects all ANTENNAGATEAREA and ANTENNA*CAR statements for the pin that follow it until you specify another ANTENNAMODEL statement.+
Value: OXIDE1, OXIDE2, OXIDE3, or OXIDE4
Note: OXIDE3 and OXIDE4 are currently not supported. If you specify either of these models, the tool parses and ignores it.
Writes an ANTENNAPINDIFFAREA statement. The ANTENNAPINDIFFAREA statement is optional and can be used more than once in a PIN section.
++ + value +
+Specifies the diffusion (diode) area to which the pin is connected on a layer.+
+ + layerName +
+Optional argument that specifies the layer. Specify NULL to ignore this argument.+
Writes an ANTENNAPINGATEAREA statement. The ANTENNAPINGATEAREA statement is optional, and can be used once after each defwPinAntennaModel routine in a PINS section.
++ + value +
+Specifies the gate area to which the pin is connected on a layer.+
+ + layerName +
+Optional argument that specifies the layer. Specify NULL to ignore this argument.+
Writes an ANTENNAPINMAXAREACAR statement. The ANTENNAPINMAXAREACAR statement is optional, and can be used once after each defwPinAntennaModel routine in a PINS section.
++ + value +
+Specifies the maximum cumulative antenna ratio, using the metal area below the current pin layer.+
+ + layerName +
+Specifies the pin layer.+
Writes an ANTENNAPINMAXCUTCAR statement. The ANTENNAPINMAXCUTCAR statement is optional, and can be used once after each defwPinAntennaModel routine in a PINS section.
++ + value +
+Specifies the maximum cumulative antenna ratio, using the cut area below the current pin layer.+
+ + layerName +
+Specifies the pin layer.+
Writes an ANTENNAPINMAXSIDEAREACAR statement. The ANTENNAPINMAXSIDEAREACAR statement is optional, and can be used once after each defwPinAntennaModel routine in a PINS section.
++ + value +
+Specifies the maximum cumulative antenna ratio, using the metal side wall area below the current pin layer.+
+ + layerName +
+Specifies the pin layer.+
Writes an ANTENNAPINPARTIALCUTAREA statement. The ANTENNAPINPARTIALCUTAREA statement is optional and can be used more than once in a PINS section.
++ + value +
+Specifies the partial cut area, which is above the current pin layer and inside (or outside) the macro on a layer.+
+ + layerName +
+Optional argument that specifies the layer. Specify NULL to ignore this argument.+
Writes an ANTENNAPINPARTIALMETALAREA statement. The ANTENNAPINPARTIALMETALAREA statement is optional and can be used more than once in a PINS section.
++ + value +
+Specifies the partial metal area, which is connected directly to the I/O pin and the inside (or outside) of the macro on a layer.+
+ + layerName +
+Optional argument that specifies the layer. Specify NULL to ignore this argument.+
Writes an ANTENNAPINPARTIALMETALSIDEAREA statement. The ANTENNAPINPARTIALMETALSIDEAREA statement is optional and can be used more than once for each pin in a PINS statement.
++ + value +
+Specifies the partial metal side wall area, which is connected directly to the I/O pin and the inside (or outside) of the macro on a layer.+
+ + layerName +
+Optional argument that specifies the layer. Specify NULL to ignore this argument.+
Writes a GROUNDSENSITIVITY statement for a pin in the PINS statement. The GROUNDSENSITIVITY statement is optional and can be used only once for each pin in the PINS statement.
++ + pinName +
+Specifies that if this pin is connected to a tie-low connection (such as 1'b0 in Verilog), it should connect to the same net to which pinName is connected.+
Writes a LAYER statement for a pin in the PINS statement. Either a LAYER or a POLYGON statement can be specified for a pin. The LAYER statement is optional and can be used more than once for each pin in the PINS statement.
++ + layerName +
+Specifies the routing layer used for the pin.+
+ + spacing +
+Optional argument that specifies the minimum spacing allowed between this pin and any other routing shape. If you specify a minimum spacing, you must specify 0 for designRuleWidth. Specify 0 to ignore this argument.+
+ + designRuleWidth +
+Optional argument that specifies that this pin has a width of designRuleWidth for the purpose of spacing calculations. If you specify a designRuleWidth value, you must specify 0 for spacing. Specify 0 to ignore this argument.+
+ + xl yl xh yh +
+Specifies the physical geometry for the pin on the specified layer.+
Writes a NETEXPR statement for a pin in the PINS statement. The NETEXPR statement is optional and can be used only once for each pin in the PINS statement.
++ + pinExpr +
+Specifies a net expression property name (such as power1 or power2). If pinExpr matches a net expression property higher up in the netlist (for example, in Verilog, VHDL, or OpenAccess), then the property is evaluated, and the software identifies a net to which to connect this pin.+
Writes a POLYGON statement for a pin in the PINS statement. Either a LAYER or a POLYGON statement can be specified for a pin. The POLYGON statement is optional and can be used more than once for each pin in the PINS statement.
++ + layerName +
+Specifies the layer on which to generate a polygon.+
+ + spacing +
+Optional argument that specifies the minimum spacing allowed between this pin and any other routing shape. If you specify a minimum spacing, you must specify 0 for designRuleWidth. Specify 0 to ignore this argument.+
+ + designRuleWidth +
+Optional argument that specifies that this pin has a width of designRuleWidth for the purpose of spacing calculations. If you specify a designRuleWidth value, you must specify 0 for spacing. Specify 0 to ignore this argument.+
+ + num_polys +
+Specifies the number of polygon sides.+
+ + xl yl +
+Specifies a sequence of points to generate a polygon for the pin. The polygon edges must be parallel to the x axis, the y axis, or at a 45-degree angle.+
Writes a PORT statement for a pin in the PINS statement. The PORT statement is optional and can be used more than once in a PINS statement.
+Writes a LAYER statement for a PINS PORT statement. Either a LAYER, POLYGON, or VIA statement can be specified for a pin port. This routine is optional and is called after defwPinPort.
++ + layerName +
+Specifies the layer name.+
+ + spacing +
+Optional argument that specifies the minimum spacing allowed between this pin port and any other routing shape. If you specify spacing, you must specify 0 for designRuleWidth. Specify 0 to ignore this argument.+
+ + designRuleWidth +
+Optional argument that specifies that this pin port has a width of designRuleWidth for the purpose of spacing calculations. If you specify designRuleWidth, you must specify 0 for spacing. Specify 0 to ignore this argument.+
+ + xl yl xh yh +
+Specifies the physical geometry for the pin port on the specified layer.+
Writes a FIXED, PLACED, or COVER statement for a PINS PORT statement. This routine is optional and is called after defwPinPort.
++ + status +
+Specifies the placement status of the pin.+
Value: specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Specifies that the pin has a location, but can be moved during automatic layout. + |
+
+ + statusX statusY +
+Specifies the placement location of the pin. If you specify status, you must specify these arguments.+
+ + orient +
+Specifies the orientation of the pin.+
Value: 0 to 7. For more information, see "Orientation Codes".
Writes a POLYGON statement for a PINS PORT statement. Either a LAYER, POLYGON, or VIA statement can be specified for a pin port. This routine is optional and is called after defwPinPort.
++ + layerName +
+Specifies the layer name.+
+ + spacing +
+Optional argument that specifies the minimum spacing allowed between this pin port and any other routing shape. If you specify a minimum spacing, you must specify 0 for designRuleWidth. Specify 0 to ignore this argument.+
+ + designRuleWidth +
+Optional argument that specifies that this pin port has a width of designRuleWidth for the purpose of spacing calculations. If you specify designRuleWidth, you must specify 0 for spacing. Specify 0 to ignore this argument.+
+ + num_polys +
+Specifies the number of polygon sides.+
+ + xl yl +
+Specifies a sequence of points to generate a polygon for the pin port. The polygon edges must be parallel to the x axis, the y axis, or at a 45-degree angle.+
Writes a VIA statement for a PINS PORT statement. Either a LAYER, POLYGON, or VIA statement can be specified for a pin port. This routine is optional and is called after defwPinPort.
++ + viaName +
+Specifies the via name. The via name must have been defined in the associated LEF files or this DEF file before this function is called.+
+ + x1 y1 +
+Specifies the point at which the via is to be placed.+
Writes a SUPPLYSENSITIVITY statement for a pin in the PINS statement. The SUPPLYSENSITIVITY statement is optional and can be used only once for each pin in the PINS statement.
++ + pinName +
+Specifies that if this pin is connected to a tie-high connection (such as 1'b1 in Verilog), it should connect to the same net to which pinName is connected.+
Writes a VIA statement for a pin in the PINS statement. The VIA statement is optional and can be used more than once for a pin.
++ + viaName +
+Specifies the via name. The via name must have been defined in the associated LEF files or this DEF file before this function is called.+
+ + x1 y1 +
+Specifies the point at which the via is to be placed.+
The following example shows a callback routine with the type defwPinCbkType.
+ + +The Pin Properties routines write a DEF PINPROPERTIES statement. The PINPROPERTIES statement is optional and can be used only once in a DEF file. For syntax information about the DEF PINPROPERTIES statement, see "Pin Properties" in the LEF/DEF Language Reference.
+You must begin and end a DEF PINPROPERTIES statement with the defwStartPinProperties and defwEndPinProperties routines. You must define all pin properties between these routines. Each property definition must start with a defwPinProperty routine.
+If the DEF file contains a PINS statement, the PINPROPERTIES statement must follow it. For more information about the DEF PINS writer routines, see "Pins".
+For examples of the routines described here, see"Pin Properties Example".
+Note: To write a PROPERTY statement for a pin, you must use one of the property routines immediately following the defwPinProperty routine, which specifies the pin name. For more information, see "Property Statements".
+All routines return 0 if successful.
+Starts a PINPROPERTIES statement.
++ + count +
+Specifies the number of pin properties defined in the PINPROPERTIES statement.+
Ends the PINPROPERTIES statement. If count specified in defwStartPinProperties is not the same as the actual number of defwPinProperty routines used, defwEndPinProperties returns DEFW_BAD_DATA. This routine does not require any arguments.
+Begins a property definition. This routine is required and can be used more than once in a PINPROPERTIES statement.
++ + component +
+Specifies either the string to use for the component pin name, or the keyword PIN.+
+ + pinName +
+Specifies the I/O pin name. Specify this value only when component is set to PIN.+
The following example shows a callback routine with the type defwPinPropCbkType.
+ +The Property Definitions routines write a DEF PROPERTYDEFINITIONS statement. The PROPERTYDEFINITIONS statement is optional and can be used only once in a DEF file. For syntax information about the DEF PROPERTYDEFINITIONS statement, see Property Definitions in the LEF/DEF Language Reference.
+You must begin and end a DEF PROPERTYDEFINITIONS statement with the defwStartPropDef and defwEndPropDef routines. You must define all properties between these routines.
+If the DEF file contains a HISTORY statement, the PROPERTYDEFINITIONS statement must follow it. For more information about the DEF HISTORY routine, see "History".
+For examples of the routines described here, see "Property Definitions Example".
+All routines return 0 if successful.
+Starts a PROPERTYDEFINITIONS statement. This routine does not require any arguments.
+Ends the PROPERTYDEFINITIONS statement. This routine does not require any arguments.
+Writes an integer property definition. This routine is optional and can be used more than once in a PROPERTYDEFINITIONS statement.
++ + objType +
+Specifies the type of object for which you can define properties.+
Value: DESIGN, COMPONENT, NET, SPECIALNET, GROUP, ROW, COMPONENTPIN, NONDEFAULTRULE, or REGION
+ + propName +
+Specifies a unique property name for the object type.+
+ + leftRange rightRange +
+Optional arguments that limit integer property values to a specified range. That is, the value must be greater than or equal to leftRange and less than or equal to rightRange. Specify 0 to ignore these arguments.+
+ + value +
+Optional argument that specifies a numeric value for an object. Specify NULL to ignore this argument.+
Writes a real property definition. This routine is optional and can be used more than once in a PROPERTYDEFINITIONS statement.
++ + objType +
+Specifies the type of object for which you can define properties.+
Value: Specify DESIGN, COMPONENT, NET, SPECIALNET, GROUP, ROW, COMPONENTPIN, NONDEFAULTRULE, or REGION
+ + propName +
+Specifies a unique property name for the object type.+
+ + leftRange rightRange +
+Optional arguments that limit real number property values to a specified range. That is, the value must be greater than or equal to leftRange and less than or equal to rightRange. Specify 0 to ignore these arguments.+
+ + value +
+Optional argument that specifies a numeric value for an object. Specify NULL to ignore this argument.+
Writes a string property definition. This routine is optional and can be used more than once in a PROPERTYDEFINITIONS statement.
++ + objType +
+Specifies the type of object for which you can define properties.+
Value: DESIGN, COMPONENT, NET, SPECIALNET, GROUP, ROW, COMPONENTPIN, NONDEFAULTRULE, or REGION
+ + propName +
+Specifies a unique property name for the object type.+
+ + leftRange rightRange +
+Optional arguments that limit string property values to a specified range. That is, the value must be greater than or equal to leftRange and less than or equal to rightRange. Specify 0 to ignore these arguments.+
+ + value +
+Optional argument that specifies a character value for an object. Specify NULL to ignore this argument.+
The following example shows a callback routine with the type defwPropDefCbkType.
+ +The Property Statements routines write PROPERTY statements when used after the defwRow, defwRegion, defwComponent, defwPin, defwPinProperty, defwSpecialNet, defwNet, defwNonDefaultRule, or defwGroup routines.
+For examples of the routines described here, see "Property Statements Example".
+Writes a PROPERTY statement with an integer value. This statement is optional and can be used more than once.
++ + propName +
+Specifies a unique property name for the object.+
+ + propValue +
+Specifies an integer value for the object.+
Writes a PROPERTY statement with a real number value. This statement is optional and can be used more than once.
++ + propName +
+Specifies a unique property name for the object.+
+ + propValue +
+Specifies a real value for the object.+
Writes a PROPERTY statement with a string value. This statement is optional and can be used more than once.
++ + propName +
+Specifies a unique property name for the object.+
+ + propValue +
+Specifies a string value for the object.+
The following example shows how to create a property inside a Rows callback routine.
+ +The Regions routines write a DEF REGIONS statement. The REGIONS statement is optional and can be used only once in a DEF file. For syntax information about the DEF REGIONS statement, see "Regions" in the LEF/DEF Language Reference.
+You must begin and end a DEF REGIONS statement with the defwStartRegions and defwEndRegions routines. You must define all regions between these routines. Each region definition must start with a defwRegions routine.
+If the DEF file contains a VIAS statement, the REGIONS statement must follow it. For more information about the DEF VIAS routines, see "Vias".
+For examples of the routines described here, see "Regions Example".
+Note: To write a PROPERTY statement for the region, you must use one of the property routines immediately following the defwRegion routines. For more information, see "Property Statements".
+All routines return 0 if successful.
+Starts a REGIONS statement.
++ + count +
+Specifies the number of regions defined in the REGIONS statement.+
Ends the REGIONS statement. If count specified in defwStartRegions is not the same as the actual number of defwRegionName routines used, this routine returns DEFW_BAD_DATA. This routine does not require any arguments.
+Starts a region description. This routine must be called the number of times specified in the defwStartRegions count argument.
++ + regionName +
+Specifies the name of the region.+
+ + xl yl xh yh +
+Specifies the corner points of the region.+
Writes a TYPE statement. The TYPE statement is optional and can be used only once per region.
++ + type +
+Specifies the region type.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
The following example shows a callback routine with the type defwRegionCbkType.
+ +The Row routines write a DEF ROWS statement. The ROWS statement is optional and can be used more than once in a DEF file. For syntax information about the DEF ROWS statement, see "Rows" in the LEF/DEF Language Reference.
+If the DEF file contains a DIEAREA statement, the ROWS statement must follow it. For more information about the DEF DIEAREA writer routines, see "Die Area".
+Note: To write a PROPERTY statement for the row, you must use one of the property routines immediately following the defwRow routine. For more information, see "Property Statements".
+All routines return 0 if successful.
+Writes a ROWS statement.
++ + do_count +
+Optional argument that specifies the number of columns in the array pattern. Specify 0 to ignore this argument.+
+ + do_increment +
+Optional argument that specifies the number of rows in the array pattern. Specify 0 to ignore this argument.+
+ + orient +
+Specifies the orientation of all sites in the row.+
Value: 0 to 7. For more information, see "Orientation Codes"
+ + rowName +
+Specifies the row name for this row.+
+ + rowType +
+Specifies the site to use for the row.+
+ + stepX stepY +
+Optional arguments that specify the spacing between the columns and rows. Specify 0 to ignore these arguments.+
+ + x_orig y_orig +
+Specifies the location in the design of the first site in the row.+
Also writes a ROWS statement. This routine is the same as the defwRow routine, with the exception of the orient argument, which takes a string instead of an integer.
++ + do_count +
+Optional argument that specifies the number of columns in the array pattern. Specify 0 to ignore this argument.+
+ + do_increment +
+Optional argument that specifies the number of rows in the array pattern. Specify 0 to ignore this argument.+
+ + orient +
+Specifies the orientation of all sites in the row.+
Value: N, W, S, E, FN, FW, FS, or FE
+ + rowName +
+Specifies the row name for this row.+
+ + rowType +
+Specifies the site to use for the row.+
+ + stepX stepY +
+Optional argument that specifies the spacing between the columns and rows. Specify 0 to ignore these arguments.+
+ + x_orig y_orig +
+Specifies the location in the design of the first site in the row.+
The following example shows a callback routine with the type defwRowCbkType.
+ +The Scan Chain routines write a DEF SCANCHAINS statement. The SCANCHAINS statement is optional and can be used only once in a DEF file. For syntax information about the DEF SCANCHAINS statement, see "Scan Chains" in the LEF/DEF Language Reference.
+You must begin and end a DEF SCANCHAINS statement with the defwStartScanchains and defwEndScanchains routines. You must define all scan chains between these routines. Each scan chain specification must start with a defwScanchains routine.
+For examples of the routines described here, see "Scan Chain Example".
+Note: To write a PROPERTY statement for the region, you must use one of the property routines following defwScanchains. For more information, see "Property Statements".
+All routines return 0 if successful.
+Starts the SCANCHAINS statement.
++ + count +
+Specifies the number of scan chains defined in the SCANCHAINS statement.+
Ends the SCANCHAINS statement. If count specified in the defwStartScanChains routine is not the same as the actual number of defwScanChain routines used, this routine returns DEFW_BAD_DATA.
+Starts a scan chain specification. This routine must be used the number of times specified in the defwStartScanchains count argument.
++ + chainName +
+Specifies the name of the scan chain.+
Writes a COMMONSCANPINS statement. The COMMONSCANPINS statement is optional and can be used only once for each scan chain.
++ + inst1 inst2 +
+Optional arguments that specify the common scan-in and scan-out pins. The inst1 argument can have the value IN or OUT. The inst2 argument can have the remaining IN or OUT value not specified in the inst1 argument. Specify NULL to ignore either of these arguments.+
+ + pin1 pin2 +
+Specifies the names of the scan-in and scan-out pins that correspond with the value of inst1 and inst2. Specify NULL to ignore either of these arguments.+
Note: The inst1/pin1 and inst2/pin2 arguments must be used as pairs. If you specify NULL for either inst1 or inst2, you must also specify NULL for the corresponding pin1 or pin2. Similarly, if you specify IN or OUT for inst1 or inst2, you must specify a pin name for the corresponding pin1 or pin2.
+Writes a FLOATING statement. The FLOATING statement is optional and can be used more than once for each scan chain.
++ + floatingComp +
+Specifies the floating component name.+
+ + inst1 inst2 +
+Optional arguments that specify the in and out pins for the component. The inst1 argument can have the value IN or OUT. The inst2 argument can have the remaining IN or OUT value not specified in the inst1 argument. Specify NULL to ignore either of these arguments.+
+ + pin1 pin2 +
+Specifies the names of the in and out pins that correspond with the value of inst1 and inst2. Specify NULL to ignore either of these arguments.+
Note: The inst1/pin1 and inst2/pin2 arguments must be used as pairs. If you specify NULL for either inst1 or inst2, you must also specify NULL for the corresponding pin1 or pin2. Similarly, if you specify IN or OUT for inst1 or inst2, you must specify a pin name for the corresponding pin1 or pin2.
+Writes a FLOATING statement that contains BITS information. The FLOATING statement is optional and can be used more than once for each scan chain.
++ + floatingComp +
+Specifies the floating component name.+
+ + inst1 inst2 +
+Optional arguments that specify the in and out pins for the component. The inst1 argument can have the value IN or OUT. The inst2 argument can have the remaining IN or OUT value not specified in the inst1 argument. Specify NULL to ignore either of these arguments.+
+ + pin1 pin2 +
+Specifies the names of the in and out pins that correspond with the value of inst1 and inst2. Specify NULL to ignore either of these arguments.+
Note: The inst1/pin1 and inst2/pin2 arguments must be used as pairs. If you specify NULL for either inst1 or inst2, you must also specify NULL for the corresponding pin1 or pin2. Similarly, if you specify IN or OUT for inst1 or inst2, you must specify a pin name for the corresponding pin1 or pin2.
+ + bits +
+Optional argument that specifies the sequential bit length of any chain element. Specify -1 to ignore this argument.+
Writes an ORDERED statement. The ORDERED statement specifies an ordered list of scan chains. The ORDERED statement is optional and can be used more than once for each scan chain.
++ + name1 name2 +
+Specifies the fixed component names. You must specify both name1 and name2 the first time you call this routine within a scanchain. If you call this routine multiple times within a scanchain, you only need to specify name1.+
+ + inst1 inst2 inst3 inst4 +
+Optional arguments that specify the scan-in and scan-out pins for the components. The inst1 and inst3 arguments can have the value IN or OUT. The inst2 and inst4 arguments can have the remaining IN or OUT not specified in the inst1 or inst3 arguments. Specify NULL to ignore any of these arguments.+
+ + pin1 pin2 pin3 pin4 +
+Specifies the names of the scan-in and scan-out pins that correspond with the inst* values. Specify NULL to ignore any of these arguments.+
Note: The inst*/pin* arguments must be used as pairs. If you specify NULL for inst1, you must also specify NULL for the corresponding pin1. Similarly, if you specify IN or OUT for inst1, you must specify a pin name for the corresponding pin1.
Writes an ORDERED statement that contains BITS information. The ORDERED statement specifies an ordered list of scan chains. The ORDERED statement is optional and can be used more than once for each scan chain.
++ + name1 name2 +
+Specifies the fixed component names. You must specify both name1 and name2 the first time you call this routine within a scanchain. If you call this routine multiple times within a scanchain, you only need to specify name1.+
+ + inst1 inst2 inst3 inst4 +
+Optional arguments that specify the scan-in and scan-out pins for the components. The inst1 and inst3 arguments can have the value IN or OUT. The inst2 and inst4 arguments can have the remaining IN or OUT not specified in the inst1 or inst3 arguments. Specify NULL to ignore any of these arguments.+
+ + pin1 pin2 pin3 pin4 +
+Specifies the names of the scan-in and scan-out pins that correspond with the inst* values. Specify NULL to ignore any of these arguments.+
Note: The inst*/pin* arguments must be used as pairs. If you specify NULL for inst1, you must also specify NULL for the corresponding pin1. Similarly, if you specify IN or OUT for inst1, you must specify a pin name for the corresponding pin1.
+ + bits* +
+Optional argument that specifies the sequential bit length of any chain element. Specify -1 to ignore this argument.+
Writes a PARTITION statement. The PARTITION statement is optional and can be used only once to define a scan chain.
++ + name +
+Specifies a partition name. A partition name associates each chain with a partition group, which determines their compatibility for repartitioning by swapping elements between them. Chains with matching PARTITION names constitute a swap-compatible group.+
+ + maxBits +
+Optional argument that specifies the maximum bit length that the chain can grow to in the partition. Specify -1 to ignore this argument.+
Writes a START statement. The START statement is required and can be used only once to define a scan chain.
++ + inst +
+Specifies the start of the scan chain. You can specify a component name, or the keyword PIN to specify an I/O pin.+
+ + pin +
+Specifies the out pin name. If you do not specify the out pin, DEF uses the out pin specified for common scan pins. If the scan chain starts at an I/O pin, you must specify the I/O pin name as the out pin.+
Writes a STOP statement. The STOP statement is required and can be used only once to define a scan chain.
++ + inst +
+Specifies the end point of the scan chain. You can specify a component name, or the keyword PIN to specify an I/O pin.+
+ + pin +
+Specifies the in pin name. If you do not specify the in pin, DEF uses the in pin specified for common scan pins. If the scan chain starts at an I/O pin, you must specify the I/O pin name as the in pin.+
The following example shows a callback routine with the type defwScanchainCbkType.
+ + +Special Nets routines write a DEF SPECIALNETS statement. The SPECIALNETS statement is optional and can be used only once in a DEF file. For syntax information about the DEF SPECIALNETS statement, see "Special Nets" in the LEF/DEF Language Reference.
+A SPECIALNETS statement must start and end with the defwStartSpecialNets and defwEndSpecialNets routines. All special nets must be defined between these routines. Each individual special net must start and end with the defwSpecialNet and defwSpecialNetEndOneNet routines.
+For examples of the routines described here, see "Special Nets Example".
+In addition to the routines in this section, you can also include routines that form a specialWiring statement and a PROPERTY statement. For information about these routines, see "Special Wiring" and "Property Statements".
+All routines return 0 if successful.
+Starts the SPECIALNETS statement.
++ + count +
+Specifies the number of special nets defined in the SPECIALNETS statement.+
Ends the SPECIALNETS statement. If count specified in defwStartSpecialNets is not the same as the actual number of defwSpecialNet routines used, this routine returns DEFW_BAD_DATA.
+Starts a special net description. Each special net in the SPECIALNETS statement must start and end with defwSpecialNet and defwSpecialNetEndOneNet.
++ + netName +
+Specifies the name of the net to define.+
Ends the special net description started with defwSpecialNet. Each special net in the SPECIALNETS statement must start and end with defwSpecialNet and defwSpecialNetEndOneNet.
+Specifies the special pin and component information for the special net. This routine is optional and can be used only once for each special net in the SPECIALNETS statement.
++ + compNameRegExpr +
+Specifies a component name or a regular expression that specifies a set of component names.+
+ + pinName +
+Specifies the name of the special pin on the net that corresponds to the component. During evaluation of the regular expression, components that match the expression but do not have a pin named pinName are ignored.+
+ + synthesized +
+Optional argument that marks the pin as part of a synthesized scan chain.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Writes a SYNTHESIZED statement. + |
+
Writes an ESTCAP statement. The ESTCAP statement is optional and can be used only once for each special net in the SPECIALNETS statement.
++ + wireCap +
+Specifies the estimated wire capacitance for the net. ESTCAP can be loaded with simulation data to generate net constraints for timing-driven layout.+
Writes a FIXEDBUMP statement that indicates the bump cannot be assigned to a different pin. The FIXEDBUMP statement is optional and can be used only once for each special net in the SPECIALNETS statement.
+Writes an ORIGINAL statement. The ORIGINAL statement is optional and can be used only once for each special net in the SPECIALNETS statement.
++ + netName +
+Specifies the original net partitioned to create multiple nets, including the current net.+
Writes a PATTERN statement. The PATTERN statement is optional and can be used only once for each special net in the SPECIALNETS statement.
++ + name +
+Specifies the routing pattern used for the net.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Used in ECL designs to connect output and mustjoin pins before routing to the remaining pins. + |
+
Writes a SOURCE statement. The SOURCE statement is optional and can only be used once for each special net in the SPECIALNETS statement.
++ + name +
+Specifies the source of the net.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
Writes a USE statement. The USE statement is optional and can be used only once for each special net in the SPECIALNETS statement.
++ + name +
+Specifies how the net is used.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
Writes a VOLTAGE statement. The VOLTAGE statement is optional and can be used only once for each special net in the SPECIALNETS statement.
++ + volts +
+Specifies the voltage for the net as an integer in units of .001 volts. For Example, 1.5 v is equal to 1500 in DEF.+
Writes a WEIGHT statement. The WEIGHT statement is optional and can be used only once for each special net in the SPECIALNETS statement.
++ + weight +
+Specifies the weight of the net. Automatic layout tools attempt to shorten the lengths of nets with high weights. Do not specify a net weight larger than 10, or assign weights to more than 3 percent of the nets in a design.+
The following example shows a callback routine with the type defwSNetCbkType. This example only shows the usage of some functions related to special net.
+Special wiring routines form a specialWiring statement that can be used to define the wiring for both routed and shielded nets.The specialWiring statement is optional and can be used more than once in a SPECIALNET statement. For syntax information about the DEF SPECIALNETS statement, see "Special Nets" in the LEF/DEF Language Reference.
+A specialWiring statement can include routines to define either rectangles, polygons, or a path of points to create the routing for the nets. Each path of points must start and end with the defwSpecialNetPathStart and defwSpecialNetPathEnd routines. If defined, a specialWiring statement must be included between the defwSpecialNet and defwEndOneNet routines.
+For examples of the routines described here, see "Special Wiring Example".
+All routines return 0 if successful.
+Starts a specialWiring statement. Each specialWiring statement must start and end with defwSpecialNetPathStart and defwSpecialNetPathEnd.
++ + type +
+Specifies the special wiring type. If no wiring is specified for a particular net, the net is unrouted.+
Value: Specify one of the following:
+ + | ++ + | +
+ Specifies that the wiring cannot be moved by either automatic layout or interactive commands. + |
+
+ + | ++ + | ++ + | +
+ + | ++ + | +
+ Specifies that the wiring can be moved by automatic layout tools. + |
+
+ + | ++ + | +
+ Specifies that the special net being defined shields a regular net. + |
+
+ + | ++ + | ++ + | +
Ends the specialWiring statement. Each specialWiring statement must start and end with defwSpecialNetPathStart and defwSpecialNetPathEnd.
+Writes a LAYER statement. Either a LAYER, POLYGON, or RECT statement is required for each specialWiring statement.The LAYER statement can be used more than once for each specialWiring statement.
++ + layerName +
+Specifies the layer on which the wire lies.+
Defines the center line coordinates of the route on the layer specified with defwSpecialNetPathLayer. Either this routine or defwSpecialNetPathPointWithWireExt is required with a LAYER statement, and can be used only once for each LAYER statement in a specialWiring statement.
++ + numPts +
+Specifies the number of points in the route.+
+ + pointX pointY +
+Specifies the route coordinates.+
Defines the center line coordinates and wire extension value of the route on the layer specified with defwSpecialNetPathLayer. Either this routine or defwSpecialNetPathPoint is required with a LAYER statement, and can be used only once for each LAYER statement in a specialWiring statement.
++ + numPoints +
+Specifies the number of points in the route.+
+ + pointX pointY +
+Specifies the route coordinates.+
+ + value +
+Optional argument that specifies the amount by which the wire is extended past the endpoint of the segment. Specify NULL to ignore this argument.+
Writes a SHAPE statement. The SHAPE statement is optional with a LAYER statement, and can be used only once for each LAYER statement in a specialWiring statement.
++ + shapeType +
+Specifies a wire with special connection requirements because of its shape.+
Value: RING, PADRING, BLOCKRING, STRIPE, FOLLOWPIN, IOWIRE, COREWIRE, BLOCKWIRE, FILLWIRE, BLOCKAGEWIRE, or DRCFILL
Writes a STYLE statement. A STYLE statement is optional with a LAYER statement, and can be used only once for each LAYER statement in a specialWiring statement.
++ + styleNum +
+Specifies a previously defined style number from the STYLES section in this DEF file.+
Specifies a via for the special wiring. This routine is optional with a LAYER statement, and can be used only once for each LAYER statement in a specialWiring statement.
++ + viaName +
+Specifies a via to place at the last point of the route.+
Creates an array of power vias of the via specified with defwSpecialNetPathVia. This routine is optional with a LAYER statement, and can be used only once for each LAYER statement in a specialWiring statement.
++ + numX numY +
+Specifies the number of vias to create in the x and y directions.+
+ + stepX stepY +
+Specifies the step distance between vias, in the x and y directions+
Writes a WIDTH statement. The WIDTH statement is required with a LAYER statement, and can be used only once for each LAYER statement in a specialWiring statement.
++ + width +
+Specifies the width for wires on the layer specified with defwSpecialNetPathLayer.+
Specifies the name of a regular net to be shielded by the special net being defined. This routine is required if SHIELD is specified in the defwSpecialNetPathStart routine and can be used only once for each specialWiring statement.
++ + name +
+Specifies the name of the regular net to be shielded.+
Writes a POLYGON statement. Either a LAYER, POLYGON, or RECT statement is required for each specialWiring statement. The POLYGON statement can be used only once for each specialWiring statement.
++ + layerName +
+Specifies the layer on which to generate the polygon.+
+ + num_polys +
+Specifies the number of polygon sides.+
+ + xl yl +
+Specifies a sequence of points to generate a polygon geometry on layerName. The polygon edges must be parallel to the x axis, the y axis, or at a 45-degree angle.+
Writes a RECT statement. Either a LAYER, POLYGON, or RECT statement is required for each specialWiring statement. The RECT statement can be used only once for each specialWiring statement.
++ + layerName +
+Specifies the layer on which to create the rectangle.+
+ + xl yl xh yh +
+Specifies the coordinates of two points which define the opposite corners of the rectangle.+
The shielded routing routines form a shielded routing specification that can be used to define a special net. The shielded routing specification is optional and can be used more than once in a SPECIALNET statement. For syntax information about the DEF SPECIALNETS statement, see Special Nets in the LEF/DEF Language Reference.
+You must begin and end a shielded routing specification with the defwSpecialNetShieldStart and defwSpecialNetShieldEnd routines. You must define all shielded routing between these routines. The shielded routing routines must be included between the defwSpecialNet and defwEndOneNet routines.
+For examples of the routines described here, see "Shielded Routing Example".
++ + name +
+Specifies the net shield name.+
Ends the shielded routing specification.
+Writes a LAYER statement. The LAYER statement is required and can be used only once per special net shield.
++ + name +
+Specifies the layer on which the wire lies.+
+ + numPts +
+Specifies the number of points in the special net shield.+
+ + pointx pointy +
+Specifies the coordinate locations for the path points.+
Writes a SHAPE statement. The SHAPE statement is optional and can be used only once per special net shield.
++ + shapeType +
+Specifies a wire with special connection requirements because of its shape.+
Value: RING, PADRING, BLOCKRING, STRIPE, FOLLOWPIN, IOWIRE, COREWIRE, BLOCKWIRE, FILLWIRE, or BLOCKAGEWIRE
+ + name +
+Specifies the via to place at the last specified path coordinate.+
Creates an array of power vias of the via specified with the defwSpecialNetShieldVia routine. This routine is optional and can be used more than once for a special net.
++ + numX numY +
+Specifies the number of vias to create in the x and y directions.+
+ + stepX stepY +
+Specifies the step distance in the x and y directions.+
Writes a WIDTH statement. The WIDTH statement is required and can be used only once per special net shield.
++ + width +
+Specifies the wire width.+
Slots routines write a DEF SLOTS statement. The SLOTS statement is optional and can be used only once in a DEF file. For syntax information about the DEF SLOTS statement, see "Slots" in the LEF/DEF Language Reference.
+The SLOTS statement must start and end with the defwStartSlots and defwEndSlots routines. All slots must be defined between these routines.
+All routines return 0 if successful.
+Starts a SLOTS statement.
++ + count +
+Specifies the number of defwSlotLayer routines in the SLOTS statement.+
Ends the SLOTS statement.
+Writes a LAYER statement. The LAYER statement is required for each slot and can be used more than once in a SLOTS statement.
++ + layerName +
+Specifies the layer on which to create the slot.+
Writes a POLYGON statement. Either a POLYGON or RECT statement is required with a LAYER statement. The POLYGON statement can be used more than once for each slot in the SLOTS statement.
++ + num_polys +
+Specifies the number of polygon sides.+
+ + xl yl +
+Specifies a sequence of points to generate a polygon geometry. The polygon edges must be parallel to the x axis, the y axis, or at a 45-degree angle.+
Writes a RECT statement. The RECT statement is required and can be used more than once for each slot in the SLOTS statement.
++ + xl yl xh yh +
+Specifies the coordinates of the slot geometry.+
Styles routines write a DEF STYLES statement. The STYLES statement is optional and can be used only once in a DEF file. For syntax information about the STYLES statement, see "Styles" in the LEF/DEF Language Reference.
+The STYLES statement must start and end with the defwStartStyles and defwEndStyles routines.
+All routines return 0 if successful.
+Starts the STYLES statement.
++ + count +
+Specifies the number of styles defined in the STYLES statement.+
Ends the STYLES statement.
+Defines a style. This routine is required and can be used more than once in the STYLES statement.
++ + styleNums +
+Defines a style. styleNums is a positive integer that is greater than or equal to 0 (zero), and is used to reference the style later in the DEF file. When defining multiple styles, the first styleNums must be 0 (zero), and any following styleNums should be numbered consecutively so that a table lookup can be used to find them easily.+
+ + num_points +
+Specifies the number of points in the style.+
+ + xp yp +
+Specifies a sequence of points to generate a polygon geometry. The syntax corresponds to a coordinate pair, such as x y. Specify an asterisk (*) to repeat the same value as the previous x or y value from the last point. The polygon must be convex. The polygon edges must be parallel to the x axis, the y axis, or at a 45-degree angle, and must enclose the point (0 0).+
The Technology routine writes a DEF TECHNOLOGY statement. The TECHNOLOGY statement is optional and can be used only once in a DEF file. For syntax information about the TECHNOLOGY statement, see "Technology" in the LEF/DEF Language Reference.
+This routine returns 0 if successful.
+Writes a TECHNOLOGY statement.
++ + technology +
+Specifies a technology name for the design in the database.+
The Tracks routine writes a DEF TRACKS statement. The TRACKS statement is optional and can be used only once in a DEF file. For syntax information about the DEF TRACKS statement, see Tracks in the LEF/DEF Language Reference.
+If the DEF file contains a ROWS statement, the TRACKS statement must follow it. For more information about the DEF ROWS writer routine, see "Rows".
+For examples of the routines described here, see "Tracks Example".
+This routine returns 0 if successful.
+Writes a TRACKS statement.
++ + doCount +
+Specifies the number of tracks to create.+
+ + doStep +
+Specifies the step spacing between the tracks.+
+ + doStart +
+Specifies the coordinate of the first line.+
+ + layers +
+Specifies the routing layers used for the tracks.+
+ + master +
+Specifies the direction for the first track defined.+
Value: Specify one of the following:
+ + | ++ + | ++ + | +
+ + | ++ + | ++ + | +
+ + numLayers +
+Specifies the number of routing layers to use for tracks.+
The following example shows a callback routine with the type defwTrackCbkType.
+ + +The Units routine writes a DEF UNITS statement. The UNITS statement is optional and can be used only once in a DEF file. For syntax information about the UNITS statement, see "Units" in the LEF/DEF Language Reference.
+This routine returns 0 if successful.
+Writes a UNITS statement.
++ + units +
+Specifies the convert factor used to convert DEF distance units into LEF distance units.+
The Version routine writes a DEF VERSION statement. The VERSION statement is required and can be used only once in a DEF file. For syntax information about the DEF VERSION statement, see "Version" in the LEF/DEF Language Reference.
+This routine returns 0 if successful.
+Writes a VERSION statement.
++ + version1 +
+Specifies the major number.+
+ + version2 +
+Specifies the minor number.+
Vias routines write a DEF VIAS statement. The VIAS statement is optional and can be used only once in a DEF file. For syntax information about the DEF VIAS statement, see "Vias" in the LEF/DEF Language Reference.
+The VIAS statement must start and end with the defwStartVias and defwEndVias routines. All vias must be defined between these routines. Each individual via must start and end with the defwViaName and defwOneViaEnd routines.
+For examples of the routines described here, see "Vias Example".
+All routines return 0 if successful.
+Starts a VIAS statement.
++ + count +
+Specifies the number of vias defined in the VIAS statement.+
Ends the VIAS statement.
+If the count specified in defwStartVias is not the same as the actual number of defwViaName routines used, this routine returns DEFW_BAD_DATA.
+Starts a via description in the VIAS statement. Each via in the VIAS statement must start and end with defwViaName and defwOneViaEnd. This routine must be used the exact number of times specified with count in defwStartVias.
+Each via can include one of the following routines:
+
+
+
+ ![]() |
+ defwViaPolygon | +
+
+
+ ![]() |
+ defwViaRect | +
+
+
+ ![]() |
+ defwViaViarule | +
+ + name +
+Specifies the name of the via. Via names are generated by appending a number after the rule name. Vias are numbered in the order in which they are created.+
Ends a via description in the VIAS statement. Each via in the VIAS statement must start and end with defwViaName and defwOneViaEnd. This routine must be used the exact number of times specified with count in defwStartVias.
+Writes a POLYGON statement for a via in the VIAS statement. Either a POLYGON, RECT, or VIARULE statement can be specified for a via. The POLYGON statement is optional and can be used more than once for each via in the VIAS statement.
++ + layerName +
+Specifies the layer on which to generate a polygon.+
+ + num_polys +
+Specifies the number of polygon sides.+
+ + xl yl +
+Specifies a sequence of points to generate a polygon geometry. The polygon edges must be parallel to the x axis, to the y axis, or at a 45-degree angle.+
Writes a RECT statement for a via in the VIAS statement. Either a POLYGON, RECT, or VIARULE statement can be specified for a via. The RECT statement is optional and can be used more than once for each via in the VIAS statement.
++ + layerName +
+Specifies the layer on which the via geometry lies. All geometries for the via, including the cut layers, are output by the DEF writer.+
+ + xl yl xh yh +
+Defines the via geometry for the specified layer. The points are specified with respect to the via origin. In most cases, the via origin is the center of the via bounding box.+
Writes a VIARULE statement for a via in the VIAS statement. Either a POLYGON, RECT, or VIARULE statement can be specified for a via. The VIARULE statement is optional and can be used only once for each via in the VIAS statement.
+If you specify this routine, you can optionally specify the following routines:
+
+
+
+ ![]() |
+ defwViaViaruleRowCol | +
+
+
+ ![]() |
+ defwViaViaruleOrigin | +
+
+
+ ![]() |
+ defwViaViaruleOffset | +
+
+
+ ![]() |
+ defwViaViarulePattern | +
+ + viaRuleName +
+Specifies the name of the LEF VIARULE that produced this via. The VIARULE must be a VIARULE GENERATE via rule; it cannot refer to a VIARULE without a GENERATE keyword.+
+ + xCutSize yCutSize +
+Specifies the required width (xCutSize) and height (yCutSize) of the cut layer rectangles.+
+ + botMetalLayer cutLayer topMetalLayer +
+Specifies the required names of the bottom routing layer, cut layer, and top routing layer. These layer names must be previously defined in layer definitions, and must match the layer names defined in the specified LEF viaRuleName.+
+ + xCutSpacing yCutSpacing +
+Specifies the required x and y spacing between cuts. The spacing is measured form one cut edge to the next cut edge.+
+ + xBotEnc yBotEnc xTopEnc yTopEnc +
+Specifies the required x and y enclosure values for the bottom and top metal layers. The enclosure measures the distance from the cut array edge to the metal edge that encloses the cut array.+
Writes a ROWCOL statement in the VIARULE for a via. The ROWCOL statement is optional and can be used only once for each via in the VIAS statement.
++ + numCutRows numCutCols +
+Specifies the number of cut rows and columns that make up the cut array.+
Writes an ORIGIN statement in a VIARULE statement for a via. The ORIGIN statement is optional and can be used only once for each via in the VIAS statement.
++ + xOffset yOffset +
+Specifies the x and y offset for all of the via shapes. By default, the 0,0 origin of the via is the center of the cut array and the enclosing metal rectangles. After the non-shifted via is computed, all cut and metal rectangles are offset by adding these values.+
Writes an OFFSET statement in a VIARULE statement for a via. The OFFSET statement is optional and can be used only once for each via in the VIAS statement.
++ + xBotOffset yBotOffset xTopOffset yTopOffset +
+Specifies the x and y offset for the bottom and top metal layers. These values allow each metal layer to be offset independently.+
By default, the 0,0 origin of the via is the center of the cut array and the enclosing metal rectangles. After the non-shifted via is computed, the metal layer rectangles are offset by adding the appropriate values--the x/y BotOffset values to the metal layer below the cut layer, and the x/y TopOffset values to the metal layer above the cut layer.
Writes a PATTERN statement in a VIARULE statement for a via. The PATTERN statement is optional and can be used only once for each via in the VIAS statement.
++ + cutPattern +
+Specifies the cut pattern encoded as an ASCII string.+
The following example shows a callback routine with the type defwViaCbkType.
+ + + + +
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+ ![]() |
+ |||||||||
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+
+
The Cadence® Design Exchange Format (DEF) reader provides the following routines for opening and closing compressed DEF files. These routines are used instead of the fopen and fclose routines that are used for regular DEF files.
+
+
+
+ ![]() |
+ defGZipOpen | +
+
+
+ ![]() |
+ defGZipClose | +
+
+
+ ![]() |
+ Example | +
+ + gzipFile +
+Specifies the compressed file to open.+
+ + mode +
+Specifies how to open the file. Compressed files should be opened as read only; therefore, specify "r".+
Closes the compressed DEF file. If the file closes with no errors, this routine returns zero.
++ + filePtr +
+Specifies a pointer to the compressed file to close.+
The following example uses the defGZipOpen and defGZipClose routines to open and close a compressed file.
++ defrInit() ; +
+ ++ for (fileCt = 0; fileCt < numInFile; fileCt++) { +
++ + defrReset(); ++
+ + // Open the compressed DEF file for the reader to read ++
+ + if ((f = defGZipOpen(inFile[fileCt], "r")) == 0) { ++
+ + fprintf(stderr, "Couldn't open input file '%s'\n", inFile[fileCt]); ++
+ + return(2) ; ++
+ + } ++
+ + // Set case sensitive to 0 to start with, in History and PropertyDefinition ++
+ + // reset it to 1. ++
+ + res = defrRead((FILE*)f, inFile[fileCt], (void*)userData, 1); ++
+ + ++
+ + if (res) ++
+ + fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]); ++
+ + ++
+ + // Close the compressed DEF file. ++
+ + defGZipClose(f); ++
+ + (void)defrPrintUnusedCallbacks(fout); ++
+ } +
++ fclose(fout); +
+ ++ return 0;} +
+ +
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+ ![]() |
+ |||||||||
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+
+
The Cadence® Design Exchange Format (DEF) reader provides the following utility for comparing DEF files.
+Compares two LEF or DEF files and reports any differences between them.
+Because LEF and DEF files can be very large, the lefdefdiff utility writes each construct from a file to an output file in the /tmp directory. The utility writes the constructs using the format:
+section_head/subsection/subsection/ ... /statement+
The lefdefdiff utility then sorts the output files and uses the diff program to compare the two files. Always verify the accuracy of the diff results.
+Note: You must specify the -lef or -def, inFileName1, and inFileName2 arguments in the listed order. All other arguments can be specified in any order after these arguments.
++ + -d +
+Uses the gnu diff program to compare the files for a smaller set of differences. Use this argument only for UNIX platforms.+
+ + -h +
+Returns the syntax and command usage for the lefdefdiff utility.+
+ + -ignorePinExtra +
+Ignores any .extraN statements in the pin name. This argument can only be used when comparing DEF files.+
+ + -ignoreRowName +
+Ignores the row name when comparing ROW statements in the DEF files. This argument can only be used when comparing DEF files.+
+ + inFileName1 +
+Specifies the first LEF or DEF file.+
+ + inFileName2 +
+Specifies the LEF or DEF file to compare with the first file.+
+ + -lef | -def +
+Specifies whether you are comparing LEF or DEF files.+
+ + -o outFileName +
+Outputs the results of the comparison to the specified file.+
Default: Outputs the results to the screen.
+ + -path pathName +
+Temporarily stores the intermediate files created by the lefdefdiff utility in the specified path directory.+
Default: Temporarily stores the files in the current directory
+ + -quick +
+Uses the bdiff program to perform a faster comparison.+
The following example shows an output file created by the lefdefdiff utility after comparing two DEF files:
++ + #The names of the two DEF files that were compared. ++
+ + < in.def ++
+ + > out.def ++
+ + #Statements listed under Deleted were found in in.def but not in out.def. ++
+ + Deleted: ++
+ + < BLOCKAGE LAYER m3 RECT 455 454 344 890 ++
+ + < BLOCKAGE LAYER m3 SLOTS ++
+ + < BLOCKAGE LAYER m4 FILLS ++
+ + < BLOCKAGE LAYER m4 RECT 455 454 344 890 ++
+ + < BLOCKAGE LAYER m5 PUSHDOWN ++
+ + < BLOCKAGE LAYER m5 RECT 455 454 344 890 ++
+ + < BLOCKAGE PLACEMENT ++
+ + Deleted: ++
+ + < BLOCKAGE PLACEMENT PUSHDOWN ++
+ + Deleted: ++
+ + < BLOCKAGE PLACEMENT RECT 4000 6000 8000 4000 ++
+ + < BLOCKAGE PLACEMENT RECT 4000 6000 8000 4000 ++
+ + #Changed always contains two statements: the statement as it appears in in.def and the statement as it appears in out.def. ++
+ + Changed: ++
+ + < COMP |i1 UNPLACED ++
+ + < DESIGN muk ++
+ + --- ++
+ + > DESIGN cell ++
+ + Changed: ++
+ + < NET net1 USE SCAN ++
+ + --- ++
+ + > NET net1 WEIGHT 30 SOURCE TIMING ORIGINAL VDD USE SCAN ++
+ + Changed: ++
+ + < NET net3 SOURCE USER PATTERN BALANCED ORIGINAL extra_crispy USE SIGNAL ++
+ + --- ++
+ + > NET net3 SOURCE USER PATTERN BALANCED ORIGINAL extra_crispy ++
+ + #Statements listed under Added were found in out.def but not in in.def. ++
+ + Added: ++
+ + > NET SCAN ( PIN scanpin ) ++
+ + Added: ++
+ + > NET net1 ( PIN pin1 ) ++
+ + Added: ++
+ + > NET net2 ( PIN pin2 ) ++
+ + ++ +
+![]() |
+
+![]() |
+
+
+![]() |
+
+ ![]() |
+
+ ![]() |
+
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+
+![]() |
+