This appendix contains examples of the Cadence® Design Exchange Format (DEF) reader and writer.
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) {
fprintf(fout, "ERROR: callback type is out of bounds!\n");
int done(defrCallbackType_e c, void* dummy, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "END DESIGN\n");
int endfunc(defrCallbackType_e c, void* dummy, defiUserData ud) {
if ((long)ud != userData) dataError();
int compf(defrCallbackType_e c, defiComponent* co, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "- %s %s ", co->defiComponent::id(),
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()) {
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()) {
co->defiComponent::regionBounds(&size, &xl, &yl, &xh, &yh);
fprintf(fout, "+ REGION %d %d %d %d \n",
if (co->defiComponent::hasHalo()) {
(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 ");
case 'I': fprintf(fout, "INTEGER ");
case 'S': fprintf(fout, "STRING ");
case 'Q': fprintf(fout, "QUOTESTRING ");
case 'N': fprintf(fout, "NUMBER ");
fprintf(fout, "END COMPONENTS\n");
int netpath(defrCallbackType_e c, defiNet* ppath, defiUserData ud) {
fprintf (fout, "Callback of partial path for net\n");
int netNamef(defrCallbackType_e c, const char* netName, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "- %s ", netName);
int subnetNamef(defrCallbackType_e c, const char* subnetName, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, " + SUBNET CBK %s ", subnetName);
int nondefRulef(defrCallbackType_e c, const char* ruleName, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, " + NONDEFAULTRULE CBK %s ", ruleName);
int netf(defrCallbackType_e c, defiNet* net, defiUserData ud) {
int i, j, k, x, y, z, count, newLayer;
if ((long)ud != userData) dataError();
fprintf(fout, "BOGUS NET TYPE ");
if (net->defiNet::pinIsMustJoin(0))
for (i = 0; i < net->defiNet::numConnections(); i++) {
// set the limit of only 5 items per line
fprintf(fout, "( %s %s ) ", net->defiNet::instance(i),
if (net->defiNet::pinIsSynthesized(i))
fprintf(fout, "+ SYNTHESIZED ");
fprintf(fout, "+ NONDEFAULTRULE %s\n", net->nonDefaultRule());
for (i = 0; i < net->defiNet::numVpins(); i++) {
fprintf(fout, " + %s", vpin->name());
fprintf(fout, " %s", vpin->layer());
fprintf(fout, " %d %d %d %d", vpin->xl(), vpin->yl(), vpin->xh(),
fprintf(fout, " %c", vpin->status());
fprintf(fout, " %d %d", vpin->xLoc(), vpin->yLoc());
fprintf(fout, " %s", orientStr(vpin->orient()));
if (net->defiNet::numWires()) {
for (i = 0; i < net->defiNet::numWires(); i++) {
fprintf(fout, "\n + %s ", wire->wireType());
for (j = 0; j < wire->defiWire::numPaths(); j++) {
while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) {
// Don't want the line to be too long
fprintf(fout, "%s ", p->defiPath::getLayer());
fprintf(fout, "NEW %s ", p->defiPath::getLayer());
fprintf(fout, "%s ", p->defiPath::getVia());
orientStr(p->defiPath::getViaRotation()));
fprintf(fout, "%d ", p->defiPath::getWidth());
p->defiPath::getPoint(&x, &y);
fprintf(fout, "( %d %d ) ", x, y);
p->defiPath::getFlushPoint(&x, &y, &z);
fprintf(fout, "( %d %d %d ) ", x, y, z);
fprintf(fout, "TAPERRULE %s ",p->defiPath::getTaperRule());
fprintf(fout, "STYLE %d ",p->defiPath::getStyle());
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++) {
if (s->defiSubnet::numConnections()) {
if (s->defiSubnet::pinIsMustJoin(0))
fprintf(fout, " + SUBNET %s ", s->defiSubnet::name());
for (j = 0; j < s->defiSubnet::numConnections(); j++)
fprintf(fout, " ( %s %s )\n", s->defiSubnet::instance(j),
if (s->defiSubnet::numWires()) {
for (k = 0; k < s->defiSubnet::numWires(); k++) {
wire = s->defiSubnet::wire(k);
fprintf(fout, " %s ", wire->wireType());
for (j = 0; j < wire->defiWire::numPaths(); j++) {
while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) {
// Don't want the line to be too long
fprintf(fout, "%s ", p->defiPath::getLayer());
fprintf(fout, "%s ", p->defiPath::getVia());
p->defiPath::getViaRotationStr());
fprintf(fout, "%d ", p->defiPath::getWidth());
p->defiPath::getPoint(&x, &y);
fprintf(fout, "( %d %d ) ", x, y);
p->defiPath::getFlushPoint(&x, &y, &z);
fprintf(fout, "( %d %d %d ) ", x, y, z);
fprintf(fout, "TAPERRULE %s ",
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));
case 'I': fprintf(fout, "%g INTEGER ", net->defiNet::propNumber(i));
case 'S': fprintf(fout, "%s STRING ", net->defiNet::propValue(i));
case 'Q': fprintf(fout, "%s QUOTESTRING ", net->defiNet::propValue(i));
case 'N': fprintf(fout, "%g NUMBER ", net->defiNet::propNumber(i));
if (net->defiNet::hasWeight())
fprintf(fout, "+ WEIGHT %d ", net->defiNet::weight());
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());
fprintf(fout, "+ USE %s ", net->defiNet::use());
int snetpath(defrCallbackType_e c, defiNet* ppath, defiUserData ud) {
int i, j, x, y, z, count, newLayer;
if (c != defrSNetPartialPathCbkType)
if ((long)ud != userData) dataError();
fprintf (fout, "SPECIALNET partial data\n");
fprintf(fout, "- %s ", ppath->defiNet::name());
for (i = 0; i < ppath->defiNet::numConnections(); i++) {
// set the limit of only 5 items print out in one line
fprintf (fout, "( %s %s ) ", ppath->defiNet::instance(i),
if (ppath->defiNet::pinIsSynthesized(i))
fprintf(fout, "+ SYNTHESIZED ");
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]);
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()) {
for (i = 0; i < ppath->defiNet::numWires(); i++) {
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++) {
while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) {
// Don't want the line to be too long
fprintf(fout, "%s ", p->defiPath::getLayer());
fprintf(fout, "NEW %s ", p->defiPath::getLayer());
fprintf(fout, "%s ", p->defiPath::getVia());
orientStr(p->defiPath::getViaRotation()));
p->defiPath::getViaData(&numX, &numY, &stepX, &stepY);
fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY,
fprintf(fout, "%d ", p->defiPath::getWidth());
p->defiPath::getPoint(&x, &y);
fprintf(fout, "( %d %d ) ", x, y);
p->defiPath::getFlushPoint(&x, &y, &z);
fprintf(fout, "( %d %d %d ) ", x, y, z);
fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape());
fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle());
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, "- %s ", s->defiSubnet::name());
for (j = 0; j < s->defiSubnet::numConnections(); j++) {
fprintf(fout, " ( %s %s )\n", s->defiSubnet::instance(j),
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++) {
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 ");
case 'I': fprintf(fout, "INTEGER ");
case 'S': fprintf(fout, "STRING ");
case 'Q': fprintf(fout, "QUOTESTRING ");
case 'N': fprintf(fout, "NUMBER ");
// 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());
for (j = 0; j < shield->defiShield::numPaths(); j++) {
p = shield->defiShield::path(j);
while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) {
// Don't want the line to be too long
fprintf(fout, "%s ", p->defiPath::getLayer());
fprintf(fout, "NEW %s ", p->defiPath::getLayer());
fprintf(fout, "%s ", p->defiPath::getVia());
orientStr(p->defiPath::getViaRotation()));
p->defiPath::getViaRotationStr());
fprintf(fout, "%d ", p->defiPath::getWidth());
p->defiPath::getPoint(&x, &y);
fprintf(fout, "( %d %d ) ", x, y);
p->defiPath::getFlushPoint(&x, &y, &z);
fprintf(fout, "( %d %d %d ) ", x, y, z);
fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape());
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);
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());
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());
fprintf(fout, "\n + USE %s ", ppath->defiNet::use());
int snetwire(defrCallbackType_e c, defiNet* ppath, defiUserData ud) {
int i, j, x, y, z, count = 0, newLayer;
if ((long)ud != userData) dataError();
fprintf (fout, "SPECIALNET wire data\n");
fprintf(fout, "- %s ", ppath->defiNet::name());
if (ppath->defiNet::numWires()) {
for (i = 0; i < ppath->defiNet::numWires(); i++) {
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++) {
while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) {
// Don't want the line to be too long
fprintf(fout, "%s ", p->defiPath::getLayer());
fprintf(fout, "NEW %s ", p->defiPath::getLayer());
fprintf(fout, "%s ", p->defiPath::getVia());
orientStr(p->defiPath::getViaRotation()));
p->defiPath::getViaData(&numX, &numY, &stepX, &stepY);
fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY,
fprintf(fout, "%d ", p->defiPath::getWidth());
p->defiPath::getPoint(&x, &y);
fprintf(fout, "( %d %d ) ", x, y);
p->defiPath::getFlushPoint(&x, &y, &z);
fprintf(fout, "( %d %d %d ) ", x, y, z);
fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape());
fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle());
} 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());
for (j = 0; j < shield->defiShield::numPaths(); j++) {
p = shield->defiShield::path(j);
while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) {
// Don't want the line to be too long
fprintf(fout, "%s ", p->defiPath::getLayer());
fprintf(fout, "NEW %s ", p->defiPath::getLayer());
fprintf(fout, "%s ", p->defiPath::getVia());
orientStr(p->defiPath::getViaRotation()));
fprintf(fout, "%d ", p->defiPath::getWidth());
p->defiPath::getPoint(&x, &y);
fprintf(fout, "( %d %d ) ", x, y);
p->defiPath::getFlushPoint(&x, &y, &z);
fprintf(fout, "( %d %d %d ) ", x, y, z);
fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape());
fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle());
int snetf(defrCallbackType_e c, defiNet* net, defiUserData ud) {
int i, j, x, y, z, count, newLayer;
if ((long)ud != userData) dataError();
fprintf(fout, "BOGUS NET TYPE ");
for (i = 0; i < net->defiNet::numConnections(); i++) {
// set the limit of only 5 items print out in one line
fprintf (fout, "( %s %s ) ", net->defiNet::instance(i),
if (net->defiNet::pinIsSynthesized(i))
fprintf(fout, "+ SYNTHESIZED ");
if (net->defiNet::numWires()) {
for (i = 0; i < net->defiNet::numWires(); 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++) {
while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) {
// Don't want the line to be too long
fprintf(fout, "%s ", p->defiPath::getLayer());
fprintf(fout, "NEW %s ", p->defiPath::getLayer());
fprintf(fout, "%s ", p->defiPath::getVia());
orientStr(p->defiPath::getViaRotation()));
p->defiPath::getViaData(&numX, &numY, &stepX, &stepY);
fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY,
fprintf(fout, "%d ", p->defiPath::getWidth());
p->defiPath::getPoint(&x, &y);
fprintf(fout, "( %d %d ) ", x, y);
p->defiPath::getFlushPoint(&x, &y, &z);
fprintf(fout, "( %d %d %d ) ", x, y, z);
fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape());
fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle());
if (net->defiNet::numPolygons()) {
for (i = 0; i < net->defiNet::numPolygons(); i++) {
fprintf(fout, "\n + POLYGON %s ", net->polygonName(i));
for (j = 0; j < points.numPoints; j++)
fprintf(fout, "%d %d ", points.x[j], points.y[j]);
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++) {
if (s->defiSubnet::numConnections()) {
if (s->defiSubnet::pinIsMustJoin(0))
fprintf(fout, "- %s ", s->defiSubnet::name());
for (j = 0; j < s->defiSubnet::numConnections(); j++) {
fprintf(fout, " ( %s %s )\n", s->defiSubnet::instance(j),
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++) {
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),
if (net->defiNet::propIsNumber(i))
fprintf(fout, " + PROPERTY %s %g ", net->defiNet::propName(i),
switch (net->defiNet::propType(i)) {
case 'R': fprintf(fout, "REAL ");
case 'I': fprintf(fout, "INTEGER ");
case 'S': fprintf(fout, "STRING ");
case 'Q': fprintf(fout, "QUOTESTRING ");
case 'N': fprintf(fout, "NUMBER ");
// 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());
for (j = 0; j < shield->defiShield::numPaths(); j++) {
p = shield->defiShield::path(j);
while ((path = (int)p->defiPath::next()) != DEFIPATH_DONE) {
// Don't want the line to be too long
fprintf(fout, "%s ", p->defiPath::getLayer());
fprintf(fout, "NEW %s ", p->defiPath::getLayer());
fprintf(fout, "%s ", p->defiPath::getVia());
orientStr(p->defiPath::getViaRotation()));
fprintf(fout, "%d ", p->defiPath::getWidth());
p->defiPath::getPoint(&x, &y);
fprintf(fout, "( %d %d ) ", x, y);
p->defiPath::getFlushPoint(&x, &y, &z);
fprintf(fout, "( %d %d %d ) ", x, y, z);
fprintf(fout, "+ SHAPE %s ", p->defiPath::getShape());
fprintf(fout, "+ STYLE %d ", p->defiPath::getStyle());
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);
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());
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());
fprintf(fout, "\n + USE %s ", net->defiNet::use());
fprintf(fout, "END SPECIALNETS\n");
int ndr(defrCallbackType_e c, defiNonDefault* nd, defiUserData ud) {
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");
case 'I': fprintf(fout, "INTEGER\n");
case 'S': fprintf(fout, "STRING\n");
case 'Q': fprintf(fout, "QUOTESTRING\n");
case 'N': fprintf(fout, "NUMBER\n");
fprintf(fout, "END NONDEFAULTRULES\n");
int tname(defrCallbackType_e c, const char* string, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "TECHNOLOGY %s ;\n", string);
int dname(defrCallbackType_e c, const char* string, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "DESIGN %s ;\n", string);
// Test changing the user data.
defrSetUserData((void*)userData);
char* address(const char* in) {
int cs(defrCallbackType_e c, int num, defiUserData ud) {
if ((long)ud != userData) dataError();
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);
int constraintst(defrCallbackType_e c, int num, defiUserData ud) {
// Handles both constraints and assertions
if ((long)ud != userData) dataError();
if (c == defrConstraintsStartCbkType)
fprintf(fout, "\nCONSTRAINTS %d ;\n\n", num);
fprintf(fout, "\nASSERTIONS %d ;\n\n", num);
void operand(defrCallbackType_e c, defiAssertion* a, int ind) {
char* fromInst, * fromPin, * toInst, * toPin;
if (a->defiAssertion::isSum()) {
// Sum in operand, recursively call operand
if (ind >= a->defiAssertion::numItems()) {
fprintf(fout, "ERROR: when writing out SUM in Constraints.\n");
for (i = ind; i < a->defiAssertion::numItems(); i++) {
if (a->defiAssertion::isNet(i)) {
a->defiAssertion::net(i, &netName);
fprintf(fout, ", "); // print , as separator
fprintf(fout, "NET %s ", netName);
} else if (a->defiAssertion::isPath(i)) {
a->defiAssertion::path(i, &fromInst, &fromPin, &toInst,
fprintf(fout, "PATH %s %s %s %s ", fromInst, fromPin, toInst,
// SUM within SUM, reset the flag
int constraint(defrCallbackType_e c, defiAssertion* a, defiUserData ud) {
// Handles both constraints and assertions
if ((long)ud != userData) dataError();
if (a->defiAssertion::isWiredlogic())
fprintf(fout, "- WIREDLOGIC %s + MAXDIST %g ;\n",
a->defiAssertion::netName(), a->defiAssertion::fallMax());
isSumSet = 0; // reset the global variable
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());
if (c == defrConstraintCbkType)
fprintf(fout, "END CONSTRAINTS\n");
fprintf(fout, "END ASSERTIONS\n");
int propstart(defrCallbackType_e c, void* dummy, defiUserData ud) {
fprintf(fout, "\nPROPERTYDEFINITIONS\n");
int prop(defrCallbackType_e c, defiProp* p, defiUserData ud) {
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')
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(),
fprintf(fout, "%g ", p->defiProp::number());
fprintf(fout, "\"%s\" ", p->defiProp::string());
int propend(defrCallbackType_e c, void* dummy, defiUserData ud) {
fprintf(fout, "END PROPERTYDEFINITIONS\n\n");
int hist(defrCallbackType_e c, const char* h, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "HISTORY %s ;\n", h);
int an(defrCallbackType_e c, const char* h, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "ARRAY %s ;\n", h);
int fn(defrCallbackType_e c, const char* h, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "FLOORPLAN %s ;\n", h);
int bbn(defrCallbackType_e c, const char* h, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "BUSBITCHARS \"%s\" ;\n", h);
int vers(defrCallbackType_e c, double d, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "VERSION %g ;\n", d);
defrAddAlias ("alias1", "aliasValue1", 1);
defrAddAlias ("alias2", "aliasValue2", 0);
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());
int versStr(defrCallbackType_e c, const char* versionName, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "VERSION %s ;\n", versionName);
int units(defrCallbackType_e c, double d, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "UNITS DISTANCE MICRONS %g ;\n", d);
int casesens(defrCallbackType_e c, int d, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "NAMESCASESENSITIVE ON ;\n", d);
fprintf(fout, "NAMESCASESENSITIVE OFF ;\n", d);
int cls(defrCallbackType_e c, void* cl, defiUserData ud) {
defiSite* site; // Site and Canplace and CannotOccupy
char **inst, **inPin, **outPin;
if ((long)ud != userData) dataError();
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());
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());
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());
fprintf(fout, "DIEAREA %d %d %d %d ;\n",
box->defiBox::xl(), box->defiBox::yl(), box->defiBox::xh(),
points = box->defiBox::getPoint();
for (i = 0; i < points.numPoints; i++)
fprintf(fout, "%d %d ", points.x[i], points.y[i]);
fprintf(fout, "MINPINS %d WIRECAP %g ;\n",
pc->defiPinCap::pin(), pc->defiPinCap::cap());
fprintf(fout, "END DEFAULTCAP\n");
fprintf(fout, "- %s + NET %s ", pin->defiPin::pinName(),
if (pin->defiPin::hasDirection())
fprintf(fout, "+ DIRECTION %s ", pin->defiPin::direction());
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))
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))
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);
for (i = 0; i < port->defiPinPort::numLayer(); i++) {
fprintf(fout, "\n + LAYER %s ",
if (port->defiPinPort::hasLayerSpacing(i))
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))
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::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, "( %d %d ) %s ",
port->defiPinPort::placementX(),
port->defiPinPort::placementY(),
orientStr(port->defiPinPort::orient()));
if (port->defiPinPort::isFixed()) {
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, "( %d %d ) %s ", pin->defiPin::placementX(),
orientStr(pin->defiPin::orient()));
if (pin->defiPin::isCover()) {
fprintf(fout, "( %d %d ) %s ", pin->defiPin::placementX(),
orientStr(pin->defiPin::orient()));
if (pin->defiPin::isFixed()) {
fprintf(fout, "( %d %d ) %s ", pin->defiPin::placementX(),
orientStr(pin->defiPin::orient()));
if (pin->defiPin::isUnplaced())
if (pin->defiPin::hasSpecial()) {
if (pin->hasAPinPartialMetalArea()) {
for (i = 0; i < pin->defiPin::numAPinPartialMetalArea(); i++) {
fprintf(fout, "ANTENNAPINPARTIALMETALAREA %d",
pin->APinPartialMetalArea(i));
if (*(pin->APinPartialMetalAreaLayer(i)))
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)))
pin->APinPartialMetalSideAreaLayer(i));
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",
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();
fprintf(fout, "ANTENNAPINGATEAREA %d",
if (aModel->hasAPinGateAreaLayer(i))
fprintf(fout, " LAYER %s", aModel->APinGateAreaLayer(i));
if (aModel->hasAPinMaxAreaCar()) {
i < aModel->defiPinAntennaModel::numAPinMaxAreaCar(); i++) {
fprintf(fout, "ANTENNAPINMAXAREACAR %d",
if (aModel->hasAPinMaxAreaCarLayer(i))
" LAYER %s", aModel->APinMaxAreaCarLayer(i));
if (aModel->hasAPinMaxSideAreaCar()) {
i < aModel->defiPinAntennaModel::numAPinMaxSideAreaCar();
fprintf(fout, "ANTENNAPINMAXSIDEAREACAR %d",
aModel->APinMaxSideAreaCar(i));
if (aModel->hasAPinMaxSideAreaCarLayer(i))
" LAYER %s", aModel->APinMaxSideAreaCarLayer(i));
if (aModel->hasAPinMaxCutCar()) {
for (i = 0; i < aModel->defiPinAntennaModel::numAPinMaxCutCar();
fprintf(fout, "ANTENNAPINMAXCUTCAR %d",
if (aModel->hasAPinMaxCutCarLayer(i))
aModel->APinMaxCutCarLayer(i));
fprintf(fout, "DEFAULTCAP %d\n", i);
fprintf(fout, "ROW %s %s %g %g %s ", row->defiRow::name(),
row->defiRow::macro(), row->defiRow::x(), row->defiRow::y(),
orientStr(row->defiRow::orient()));
row->defiRow::xNum(), row->defiRow::yNum());
if (row->defiRow::hasDoStep())
fprintf(fout, "STEP %g %g ;\n",
row->defiRow::xStep(), row->defiRow::yStep());
if (row->defiRow::numProps() > 0) {
for (i = 0; i < row->defiRow::numProps(); i++) {
fprintf(fout, " + PROPERTY %s %s ",
switch (row->defiRow::propType(i)) {
case 'R': fprintf(fout, "REAL ");
case 'I': fprintf(fout, "INTEGER ");
case 'S': fprintf(fout, "STRING ");
case 'Q': fprintf(fout, "QUOTESTRING ");
case 'N': fprintf(fout, "NUMBER ");
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));
fprintf(fout, "GCELLGRID %s %d DO %d STEP %g ;\n",
gcg->defiGcellGrid::macro(), gcg->defiGcellGrid::x(),
gcg->defiGcellGrid::xNum(), gcg->defiGcellGrid::xStep());
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",
if (via->defiVia::numPolygons()) {
for (i = 0; i < via->defiVia::numPolygons(); i++) {
fprintf(fout, "\n + POLYGON %s ", via->polygonName(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());
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 ");
case 'I': fprintf(fout, "INTEGER ");
case 'S': fprintf(fout, "STRING ");
case 'Q': fprintf(fout, "QUOTESTRING ");
case 'N': fprintf(fout, "NUMBER ");
fprintf(fout, "END REGIONS\n");
fprintf(fout, "- %s", (char*)cl);
fprintf(fout, " %s", (char*)cl);
if (group->defiGroup::hasMaxX() | group->defiGroup::hasMaxY()
| group->defiGroup::hasPerim()) {
if (group->defiGroup::hasPerim())
fprintf(fout, "MAXHALFPERIMETER %d ",
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()) {
group->defiGroup::regionRects(&size, &gxl, &gyl, &gxh, &gyh);
fprintf(fout, "REGION %d %d %d %d ", gxl[i], gyl[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 ");
case 'I': fprintf(fout, "INTEGER ");
case 'S': fprintf(fout, "STRING ");
case 'Q': fprintf(fout, "QUOTESTRING ");
case 'N': fprintf(fout, "NUMBER ");
fprintf(fout, "END GROUPS\n");
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);
fprintf(fout, " + FLOATING\n");
fprintf(fout, " %s ", inst[i]);
fprintf(fout, "( IN %s ) ", inPin[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,
fprintf(fout, " + ORDERED\n");
fprintf(fout, " %s ", inst[j]);
fprintf(fout, "( IN %s ) ", inPin[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())
sc->defiScanchain::partitionMaxBits());
fprintf(fout, "END SCANCHAINS\n");
fprintf(fout, "- ( %s %s )\n", iot->defiIOTiming::inst(),
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())
if (iot->defiIOTiming::hasTo())
if (iot->defiIOTiming::hasParallel())
iot->defiIOTiming::parallel());
fprintf(fout, "END IOTIMINGS\n");
fprintf(fout, "- %s ", fpc->defiFPC::name());
if (fpc->defiFPC::isVertical())
if (fpc->defiFPC::isHorizontal())
fprintf(fout, "%g ", fpc->defiFPC::alignMax());
fprintf(fout, "%g ", fpc->defiFPC::alignMin());
fprintf(fout, "%g ", fpc->defiFPC::equal());
for (i = 0; i < fpc->defiFPC::numParts(); i++) {
fpc->defiFPC::getPart(i, &corner, &typ, &name);
fprintf(fout, "ROWS %s ", name);
fprintf(fout, "COMPS %s ", name);
fprintf(fout, "END FLOORPLANCONSTRAINTS\n");
case defrTimingDisableCbkType :
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());
fprintf(fout, "- %s ", part->defiPartition::name());
if (part->defiPartition::isSetupRise() |
part->defiPartition::isSetupFall() |
part->defiPartition::isHoldRise() |
part->defiPartition::isHoldFall()) {
if (part->defiPartition::isSetupRise())
if (part->defiPartition::isSetupFall())
if (part->defiPartition::isHoldRise())
if (part->defiPartition::isHoldFall())
itemT = part->defiPartition::itemType();
dir = part->defiPartition::direction();
if (strcmp(itemT, "CLOCK") == 0) {
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())
part->defiPartition::partitionMin(),
part->defiPartition::partitionMax());
if (part->defiPartition::hasMax())
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) {
fprintf(fout, "+ TOIOPIN %s %s ",
part->defiPartition::instName(),
part->defiPartition::pinName());
fprintf(fout, "+ FROMIOPIN %s %s ",
part->defiPartition::instName(),
part->defiPartition::pinName());
} else if (strcmp(itemT, "COMP") == 0) {
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());
fprintf(fout, "END PARTITIONS\n");
if (pprop->defiPinProp::isPin())
fprintf(fout, "- PIN %s ", pprop->defiPinProp::pinName());
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 ");
case 'I': fprintf(fout, "INTEGER ");
case 'S': fprintf(fout, "STRING ");
case 'Q': fprintf(fout, "QUOTESTRING ");
case 'N': fprintf(fout, "NUMBER ");
fprintf(fout, "END PINPROPERTIES\n");
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())
if (block->defiBlockage::hasFills())
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())
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++) {
points = block->getPolygon(i);
for (j = 0; j < points.numPoints; j++)
fprintf(fout, "%d %d ", points.x[j], points.y[j]);
fprintf(fout, "END BLOCKAGES\n");
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++) {
points = slots->getPolygon(i);
for (j = 0; j < points.numPoints; j++)
fprintf(fout, "%d %d ", points.x[j], points.y[j]);
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++) {
points = fills->getPolygon(i);
for (j = 0; j < points.numPoints; j++)
fprintf(fout, "%d %d ", points.x[j], points.y[j]);
if (fills->defiFill::hasVia()) {
fprintf(fout, "- VIA %s", fills->defiFill::viaName());
if (fills->defiFill::hasViaOpc())
for (i = 0; i < fills->defiFill::numViaPts(); i++) {
for (j = 0; j < points.numPoints; j++)
fprintf(fout, " %d %d", points.x[j], points.y[j]);
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]);
fprintf(fout, "END STYLES\n");
default: fprintf(fout, "BOGUS callback to cls.\n"); return 1;
int dn(defrCallbackType_e c, const char* h, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "DIVIDERCHAR \"%s\" ;\n",h);
int ext(defrCallbackType_e t, const char* c, defiUserData ud) {
if ((long)ud != userData) dataError();
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);
int extension(defrCallbackType_e c, const char* extsn, defiUserData ud) {
if ((long)ud != userData) dataError();
fprintf(fout, "BEGINEXT %s\n", extsn);
void* reallocCB(void* name, int size) {
void lineNumberCB(int lineNo) {
fprintf(fout, "Parsed %d number of lines!!\n", lineNo);
int main(int argc, char** argv) {
strcpy(defaultName, "def.in");
if (strcmp(*argv, "-d") == 0) {
} else if (strcmp(*argv, "-nc") == 0) {
} else if (strcmp(*argv, "-o") == 0) {
if ((fout = fopen(outFile, "w")) == 0) {
fprintf(stderr, "ERROR: could not open output file\n");
} else if (strcmp(*argv, "-verStr") == 0) {
/* New to set the version callback routine to return a string */
} else if (argv[0][0] != '-') {
fprintf(stderr, "ERROR: too many input files, max = 6.\n");
} else if (strcmp(*argv, "-h") == 0) {
fprintf(stderr, "Usage: defrw [<defFilename>] [-o <outputFilename>]\n");
} else if (strcmp(*argv, "-setSNetWireCbk") == 0) {
fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv);
defrSetExtensionCbk(extension);
defrSetPropDefStartCbk(propstart);
defrSetPropDefEndCbk(propend);
defrSetNetNonDefaultRuleCbk(nondefRulef);
defrSetNetSubnetNameCbk(subnetNamef);
defrSetNetPartialPathCbk(netpath);
defrSetSNetPartialPathCbk(snetpath);
defrSetConstraintCbk(constraint);
defrSetAssertionCbk(constraint);
defrSetAssertionsStartCbk(constraintst);
defrSetConstraintsStartCbk(constraintst);
defrSetScanchainsStartCbk(cs);
defrSetTimingDisablesStartCbk(cs);
defrSetPartitionsStartCbk(cs);
defrSetNonDefaultStartCbk(cs);
// All of the extensions point to the same function.
defrSetNetConnectionExtCbk(ext);
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);
defrSetIOTimingsEndCbk(endfunc);
defrSetPartitionsEndCbk(endfunc);
defrSetScanchainsEndCbk(endfunc);
defrSetTimingDisablesEndCbk(endfunc);
defrSetPinPropEndCbk(endfunc);
defrSetBlockageEndCbk(endfunc);
defrSetNonDefaultEndCbk(endfunc);
defrSetMallocFunction(mallocCB);
defrSetReallocFunction(reallocCB);
defrSetLineNumberFunction(lineNumberCB);
// Testing to set the number of warnings
defrSetCaseSensitiveWarnings(3);
for (fileCt = 0; fileCt < numInFile; fileCt++) {
if ((f = fopen(inFile[fileCt],"r")) == 0) {
fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]);
// Set case sensitive to 0 to start with, in History & PropertyDefinition
res = defrRead(f, inFile[fileCt], (void*)userData, 1);
fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]);
(void)defrPrintUnusedCallbacks(fout);
(void)defrReleaseNResetMemory();
#define CHECK_STATUS(status) \
int main(int argc, char** argv) {
int status; // return code, if none 0 means error
int *foreignX, *foreignY, *foreignOrient;
const char** foreignOrientStr;
if (strcmp(*argv, "-o") == 0) { // output filename
if ((fout = fopen(outfile, "w")) == 0) {
fprintf(stderr, "ERROR: could not open output file\n");
} else if (strncmp(*argv, "-h", 2) == 0) { // compare with -h[elp]
fprintf(stderr, "Usage: defwrite [-o <filename>] [-help]\n");
fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv);
status = defwDividerChar(":");
status = defwBusBitChars("[]");
status = defwDesignName("muk");
status = defwTechnology("muk");
status = defwArray("core_array");
status = defwFloorplan("DEFAULT");
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)");
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);
xPoints = (int*)malloc(sizeof(int)*6);
yPoints = (int*)malloc(sizeof(int)*6);
status = defwDieAreaList(6, xPoints, yPoints);
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);
layers = (const char**)malloc(sizeof(char*)*1);
status = defwTracks("X", 3000, 40, 120, 1, layers);
status = defwTracks("Y", 5000, 10, 20, 1,layers);
status = defwGcellGrid("X", 0, 100, 600);
status = defwGcellGrid("Y", 10, 120, 400);
status = defwCanPlaceStr("dp", 45, 64, "N", 35, 1, 39, 1);
status = defwCanPlace("dp", 45, 64, 1, 35, 1, 39, 1);
status = defwCannotOccupyStr("dp", 54, 44, "S", 55, 2, 45, 3);
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 = 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 = defwViaPattern("P2-435-543-IJ1FS");
status = defwViaRect("M2", -40, -40, 40, 40);
xP = (double*)malloc(sizeof(double)*6);
yP = (double*)malloc(sizeof(double)*6);
status = defwViaPolygon("M3", 4, xP, yP);
status = defwViaRect("M4", -40, -40, 40, 40);
status = defwViaPolygon("M5", 6, xP, yP);
status = defwViaPolygon("M6", 5, xP, yP);
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");
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,
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,
foreigns[0] = strdup("gds2name");
status = defwComponent("cell3", "CHM6A", 0, NULL, NULL, NULL, NULL,
"TIMING", 1, foreigns, foreignX, foreignY,
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,
status = defwComponent("scancell2", "CHK3A", 0, NULL, NULL, NULL, NULL,
NULL, 0, NULL, NULL, NULL, NULL, "PLACED", 700,
free((char*)foreignOrientStr[0]);
free((char*)foreignOrientStr[1]);
free((char*)foreignOrientStr);
xP = (double*)malloc(sizeof(double)*6);
yP = (double*)malloc(sizeof(double)*6);
status = defwPin("scanpin", "net1", 0, "INPUT", NULL, NULL, 0, 0, -1, NULL,
status = defwPinPolygon("metal1", 0, 1000, 6, xP, yP);
status = defwPinNetExpr("power1 VDD1");
status = defwPin("pin0", "net1", 0, "INPUT", "SCAN", NULL, 0, 0, -1, NULL,
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,
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,
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");
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();
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);
status = defwSpecialNetPathPointWithWireExt(3, coorX, coorY, coorValue);
status = defwSpecialNetPathEnd();
status = defwSpecialNetShieldStart("my_net");
status = defwSpecialNetShieldLayer("M2");
status = defwSpecialNetShieldWidth(90);
status = defwSpecialNetShieldShape("STRIPE");
status = defwSpecialNetShieldPoint(2, coorX, coorY);
status = defwSpecialNetShieldVia("M2_TURN");
status = defwSpecialNetShieldPoint(1, coorX, coorY);
status = defwSpecialNetShieldVia("M1_M2");
status = defwSpecialNetShieldViaData(10, 20, 1000, 2000);
status = defwSpecialNetShieldPoint(1, coorX, coorY);
status = defwSpecialNetShieldEnd();
status = defwSpecialNetShieldStart("my_net1");
status = defwSpecialNetShieldLayer("M2");
status = defwSpecialNetShieldWidth(90);
status = defwSpecialNetShieldPoint(2, coorX, coorY);
status = defwSpecialNetShieldVia("M2_TURN");
status = defwSpecialNetShieldPoint(1, coorX, coorY);
status = defwSpecialNetShieldVia("M1_M2");
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");
status = defwSpecialNetPathPoint(2, coorX, coorY);
status = defwSpecialNetPathStart("NEW");
status = defwSpecialNetPathLayer("M2");
status = defwSpecialNetPathWidth(270);
status = defwSpecialNetPathPoint(2, coorX, coorY);
status = defwSpecialNetPathEnd();
status = defwSpecialNetEndOneNet();
status = defwSpecialNet("CLOCK");
status = defwSpecialNetPathStart("ROUTED");
status = defwSpecialNetPathLayer("M2");
status = defwSpecialNetPathWidth(200);
status = defwSpecialNetPathShape("BLOCKRING");
status = defwSpecialNetPathPoint(2, coorX, coorY);
status = defwSpecialNetPathStart("NEW");
status = defwSpecialNetPathLayer("M2");
status = defwSpecialNetPathWidth(270);
status = defwSpecialNetPathPoint(2, coorX, coorY);
status = defwSpecialNetPathEnd();
status = defwSpecialNetEndOneNet();
status = defwSpecialNet("VCC");
status = defwSpecialNetPathStart("ROUTED");
status = defwSpecialNetPathLayer("M2");
status = defwSpecialNetPathWidth(200);
status = defwSpecialNetPathShape("DRCFILL");
status = defwSpecialNetPathPoint(2, coorX, coorY);
status = defwSpecialNetPathStart("NEW");
status = defwSpecialNetPathLayer("M2");
status = defwSpecialNetPathWidth(270);
status = defwSpecialNetPathShape("STRIPE");
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");
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);
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();
status = defwEndSpecialNets();
status = defwNetConnection("Z38A01", "Q", 0);
status = defwNetConnection("Z38A03", "Q", 0);
status = defwNetConnection("Z38A05", "Q", 0);
status = defwNetConnection("cell1", "PB1", 0);
status = defwNetConnection("cell2", "PB1", 0);
status = defwNetConnection("cell3", "PB1", 0);
status = defwNetVpin("P1", NULL, 0, 0, 0, 0, "PLACED", 54, 64, 3);
status = defwNetConnection("cell4", "PA3", 0);
status = defwNetConnection("cell2", "P10", 0);
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");
coorX = (const char**)malloc(sizeof(char*)*5);
coorY = (const char**)malloc(sizeof(char*)*5);
coorValue = (const char**)malloc(sizeof(char*)*5);
status = defwNetConnection("I1", "A", 0);
status = defwNetConnection("BUF", "Z", 0);
status = defwNetNondefaultRule("RULE1");
status = defwNetShieldnet("VSS");
status = defwNetShieldnet("VDD");
status = defwNetPathStart("ROUTED");
status = defwNetPathLayer("M2", 0, NULL);
status = defwNetPathPoint(3, coorX, coorY, coorValue);
status = defwNetPathVia("nd1VIA12");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathStart("NEW");
status = defwNetPathLayer("M1", 1, NULL);
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetNoshieldStart("M2");
status = defwNetNoshieldPoint(2, coorX, coorY);
status = defwNetNoshieldEnd();
status = defwNet("|INBUS[1]");
status = defwNetConnection("|i1", "A", 0);
status = defwNet("|INBUS<0>");
status = defwNetConnection("|i0", "A", 0);
status = defwNet("|OUTBUS<1>");
status = defwNetConnection("|i0", "Z", 0);
status = defwNetConnection("cell4", "PA1", 0);
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");
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetPathVia("nd1VIA12");
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetPathViaWithOrient("nd1VIA23", 6);
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetSubnetStart("SUB2_XX100");
status = defwNetSubnetPin("Z38A03", "G");
status = defwNetSubnetPin("VPIN", "V_SUB2_XX100");
status = defwNetPathStart("ROUTED");
status = defwNetPathLayer("M1", 0, NULL);
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetPathVia("M1_M2");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathViaWithOrientStr("M2_M3", "SE");
status = defwNetSubnetStart("SUB3_XX100");
status = defwNetSubnetPin("Z38A01", "G");
status = defwNetSubnetPin("VPIN", "V_SUB3_XX100");
status = defwNetPathStart("ROUTED");
status = defwNetPathLayer("M1", 0, NULL);
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetPathVia("M1_M2");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("M1_M2");
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);
status = defwNetPathPoint(5, coorX, coorY, coorValue);
status = defwNetPathVia("nd1VIA23");
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetPathVia("nd1VIA23");
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetPathVia("nd1VIA23");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("nd1VIA23");
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetPathVia("nd1VIA23");
status = defwNetPathVia("nd1VIA23");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("nd1VIA12");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathStart("NEW");
status = defwNetPathLayer("M3", 1, NULL);
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetPathVia("M2_M3");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("M2_M3");
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetPathVia("M2_M3");
status = defwNetPathPoint(2, coorX, coorY, coorValue);
status = defwNetPathVia("M2_M3");
status = defwNetConnection("scancell1", "P10", 1);
status = defwNetConnection("scancell2", "PA0", 1);
status = defwNetSource("TEST");
status = defwNetConnection("Z38A05", "G", 0);
status = defwNetConnection("Z38A03", "G", 0);
status = defwNetConnection("Z38A01", "G", 0);
status = defwNetPathStart("ROUTED");
status = defwNetPathLayer("M1", 0, NULL);
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("GETH1W1W1");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("GETH2W1W1");
status = defwNetPathStart("NEW");
status = defwNetPathLayer("M3", 0, NULL);
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("GETH2W1W1");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("GETH1W1W1");
status = defwNetPathStart("NEW");
status = defwNetPathLayer("M1", 0, NULL);
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathStart("NEW");
status = defwNetPathLayer("M1", 0, NULL);
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("GETH1W1W1");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("GETH2W1W1");
status = defwNetPathPoint(1, coorX, coorY, coorValue);
status = defwNetPathVia("GETH3W1W1");
status = defwNetConnection("PIN", "n1", 0);
status = defwNetConnection("driver1", "in", 0);
status = defwNetConnection("bumpa1", "bumppin", 0);
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);
groupExpr = (const char**)malloc(sizeof(char*)*2);
groupExpr[0] = strdup("cell2");
groupExpr[1] = strdup("cell3");
status = defwGroup("group1", 2, groupExpr);
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);
status = defwGroupRegion(0, 10, 1000, 1010, NULL);
status = defwStringProperty("ggrp", "after the fall");
status = defwGroupSoft("MAXHALFPERIMETER", 4000, "MAXX", 10000, 0, 0);
xP = (double*)malloc(sizeof(double)*7);
yP = (double*)malloc(sizeof(double)*7);
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);
xP = (double*)malloc(sizeof(double)*7);
yP = (double*)malloc(sizeof(double)*7);
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);
xP = (double*)malloc(sizeof(double)*7);
yP = (double*)malloc(sizeof(double)*7);
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 = defwFillRect(100, 200, 150, 400);
status = defwFillRect(300, 200, 350, 400);
status = defwFillVia("via28");
status = defwFillPoints(1, xP, yP);
status = defwFillVia("via26");
status = defwFillPoints(3, xP, yP);
xP = (double*)malloc(sizeof(double)*7);
yP = (double*)malloc(sizeof(double)*7);
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);
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();
xP = (double*)malloc(sizeof(double)*6);
yP = (double*)malloc(sizeof(double)*6);
status = defwStyles(1, 6, xP, yP);
status = defwStyles(2, 5, xP, yP);
xP = (double*)malloc(sizeof(double)*8);
yP = (double*)malloc(sizeof(double)*8);
status = defwStyles(3, 8, xP, yP);
status = defwStartBeginext("tag");
status = defwBeginextCreator("CADENCE");
status = defwBeginextSyntax("OTTER", "furry");
status = defwStringProperty("arrg", "later");
status = defwBeginextSyntax("SEAL", "cousin to WALRUS");
lineNumber = defwCurrentLineNumber();