示例#1
0
void defiNonDefault::addMinCuts(const char* name, int numCuts) {
  if (numMinCuts_ == minCutsAllocated_) {
    int i;
    char** cln;
    int*   nc;

    if (minCutsAllocated_ == 0)
      minCutsAllocated_ = 2;
    else
      minCutsAllocated_ *= 2;
    cln = (char**)defMalloc(sizeof(char*)* minCutsAllocated_);
    nc = (int*)defMalloc(sizeof(int)* minCutsAllocated_);
    for (i = 0; i < numMinCuts_; i++) {
      cln[i] = cutLayerName_[i];
      nc[i]  = numCuts_[i];
    }
    if (minCutsAllocated_ > 2) {
      defFree((char*)(cutLayerName_));
      defFree((char*)(numCuts_));
    }
    cutLayerName_ = cln;
    numCuts_ = nc;
  } 
  cutLayerName_[numMinCuts_] = (char*)defMalloc(strlen(name)+1);
  strcpy(cutLayerName_[numMinCuts_], DEFCASE(name));
  numCuts_[numMinCuts_] = numCuts;
  numMinCuts_ += 1;
}
示例#2
0
void defiGroup::addRegionRect(int xl, int yl, int xh, int yh) {
  int i;
  if (numRects_ == rectsAllocated_) {
    int max = numRects_ * 2;
    int* nxl = (int*)defMalloc(sizeof(int)*max);
    int* nyl = (int*)defMalloc(sizeof(int)*max);
    int* nxh = (int*)defMalloc(sizeof(int)*max);
    int* nyh = (int*)defMalloc(sizeof(int)*max);
    max = numRects_;
    for (i = 0; i < max; i++) {
      nxl[i] = xl_[i];
      nyl[i] = yl_[i];
      nxh[i] = xh_[i];
      nyh[i] = yh_[i];
    }
    defFree((char*)(xl_));
    defFree((char*)(yl_));
    defFree((char*)(xh_));
    defFree((char*)(yh_));
    xl_ = nxl;
    yl_ = nyl;
    xh_ = nxh;
    yh_ = nyh;
    rectsAllocated_ *= 2;
  }

  i = numRects_;
  xl_[i] = xl;
  yl_[i] = yl;
  xh_[i] = xh;
  yh_[i] = yh;
  numRects_ += 1;
}
void defiComponent::setRegionBounds(int xl, int yl, int xh, int yh) {
  int i;
  i = this->numRects_;
  if (i == this->rectsAllocated_) {
    int max = this->rectsAllocated_ * 2;
    int* nxl = (int*)defMalloc(sizeof(int)*max);
    int* nyl = (int*)defMalloc(sizeof(int)*max);
    int* nxh = (int*)defMalloc(sizeof(int)*max);
    int* nyh = (int*)defMalloc(sizeof(int)*max);
    for (i = 0; i < this->numRects_; i++) {
      nxl[i] = this->rectXl_[i];
      nyl[i] = this->rectYl_[i];
      nxh[i] = this->rectXh_[i];
      nyh[i] = this->rectYh_[i];
    }
    defFree((char*)(this->rectXl_));
    defFree((char*)(this->rectYl_));
    defFree((char*)(this->rectXh_));
    defFree((char*)(this->rectYh_));
    this->rectXl_ = nxl;
    this->rectYl_ = nyl;
    this->rectXh_ = nxh;
    this->rectYh_ = nyh;
    this->rectsAllocated_ = max;
  }
  this->rectXl_[i] = xl;
  this->rectYl_[i] = yl;
  this->rectXh_[i] = xh;
  this->rectYh_[i] = yh;
  this->numRects_ += 1;
}
示例#4
0
void defiRegion::addRect(int xl, int yl, int xh, int yh) {
  if (this->numRectangles_ == this->rectanglesAllocated_) {
    int i;
    int max = this->rectanglesAllocated_ = this->rectanglesAllocated_ * 2;
    int* newxl = (int*)defMalloc(sizeof(int)*max);
    int* newyl = (int*)defMalloc(sizeof(int)*max);
    int* newxh = (int*)defMalloc(sizeof(int)*max);
    int* newyh = (int*)defMalloc(sizeof(int)*max);
    for (i = 0; i < this->numRectangles_; i++) {
      newxl[i] = this->xl_[i];
      newyl[i] = this->yl_[i];
      newxh[i] = this->xh_[i];
      newyh[i] = this->yh_[i];
    }
    defFree((char*)(this->xl_));
    defFree((char*)(this->yl_));
    defFree((char*)(this->xh_));
    defFree((char*)(this->yh_));
    this->xl_ = newxl;
    this->yl_ = newyl;
    this->xh_ = newxh;
    this->yh_ = newyh;
  }
  this->xl_[this->numRectangles_] = xl;
  this->yl_[this->numRectangles_] = yl;
  this->xh_[this->numRectangles_] = xh;
  this->yh_[this->numRectangles_] = yh;
  this->numRectangles_ += 1;
}
示例#5
0
void defiPath::Destroy() {
  this->defiPath::clear();
  if (this->keys_)
     defFree((char*)(this->keys_));
  if (this->data_)
     defFree((char*)(this->data_));
}
示例#6
0
void defiRegion::addRect(int xl, int yl, int xh, int yh) {
  if (numRectangles_ == rectanglesAllocated_) {
    int i;
    int max = rectanglesAllocated_ = rectanglesAllocated_ * 2;
    int* newxl = (int*)defMalloc(sizeof(int)*max);
    int* newyl = (int*)defMalloc(sizeof(int)*max);
    int* newxh = (int*)defMalloc(sizeof(int)*max);
    int* newyh = (int*)defMalloc(sizeof(int)*max);
    for (i = 0; i < numRectangles_; i++) {
      newxl[i] = xl_[i];
      newyl[i] = yl_[i];
      newxh[i] = xh_[i];
      newyh[i] = yh_[i];
    }
    defFree((char*)(xl_));
    defFree((char*)(yl_));
    defFree((char*)(xh_));
    defFree((char*)(yh_));
    xl_ = newxl;
    yl_ = newyl;
    xh_ = newxh;
    yh_ = newyh;
  }
  xl_[numRectangles_] = xl;
  yl_[numRectangles_] = yl;
  xh_[numRectangles_] = xh;
  yh_[numRectangles_] = yh;
  numRectangles_ += 1;
}
void defiRow::setup(const char* name, const char* macro, double x, double y,
		 int orient) {
  int len = strlen(name) + 1;

  this->defiRow::clear();

  if (len > this->nameLength_) {
    if (this->name_) defFree(this->name_);
    this->nameLength_ = len;
    this->name_ = (char*)defMalloc(len);
  }
  strcpy(this->name_, DEFCASE(name));

  len = strlen(macro) + 1;
  if (len > this->macroLength_) {
    if (this->macro_) defFree(this->macro_);
    this->macroLength_ = len;
    this->macro_ = (char*)defMalloc(len);
  }
  strcpy(this->macro_, DEFCASE(macro));

  this->x_ = x;
  this->y_ = y;
  this->xStep_ = 0.0;
  this->yStep_ = 0.0;
  this->xNum_ = 0.0;
  this->yNum_ = 0.0;
  this->orient_ = orient;

}
示例#8
0
void defiFPC::addItem(char item, const char* name) {
  int len = strlen(name) + 1;

  if (namesUsed_ >= namesAllocated_) {
    char* newR;
    char** newN;
    int i;
    namesAllocated_ =
	namesAllocated_ ? namesAllocated_ * 2 : 8 ;
    newN = (char**) defMalloc(sizeof(char*) * namesAllocated_);
    newR = (char*) defMalloc(sizeof(char) * namesAllocated_);
    for (i = 0; i < namesUsed_; i++) {
      newN[i] = names_[i];
      newR[i] = rowOrComp_[i];
    }
    if (names_) defFree((char*)(names_));
    if (rowOrComp_) defFree(rowOrComp_);
    names_ = newN;
    rowOrComp_ = newR;
  }

  names_[namesUsed_] = (char*)defMalloc(len);
  strcpy(names_[namesUsed_], name);

  // 4 for bottomleft
  // 2 for row
  rowOrComp_[namesUsed_] = 
         (char)(((corner_ == 'B') ? 4 : 0) |
	 (item == 'R' ? 2 : 0));

  namesUsed_ += 1;
}
void defiPropType::bumpProps() {
    int lim = this->propertiesAllocated_;
    int news ;
    char** newpn;
    char*   newt;

    news = lim ? lim + lim : 2;

    newpn = (char**)defMalloc(sizeof(char*)*news);
    newt = (char*)defMalloc(sizeof(char)*news);

    lim = this->propertiesAllocated_ = news;

    if (lim > 2) {
        int i;
        for (i = 0; i < this->numProperties_; i++) {
            newpn[i] = this->propNames_[i];
            newt[i] = this->propTypes_[i];
        }
        defFree((char*)(this->propNames_));
        defFree((char*)(this->propTypes_));
    }
    this->propNames_ = newpn;
    this->propTypes_ = newt;
}
示例#10
0
void defiPropType::Destroy() {
    this->defiPropType::Clear();
    if (this->propNames_)
        defFree(this->propNames_);
    if (this->propTypes_)
        defFree(this->propTypes_);
}
示例#11
0
void defiBox::addPoint(defiGeometries* geom) {
  struct defiPoints* p;
  struct defiPoints* tp;
  int x, y;
  int i;

  p = (struct defiPoints*)defMalloc(sizeof(struct defiPoints));
  p->numPoints = geom->numPoints();
  p->x = (int*)defMalloc(sizeof(int)*p->numPoints);
  p->y = (int*)defMalloc(sizeof(int)*p->numPoints);
  for (i = 0; i < p->numPoints; i++) {
    geom->points(i, &x, &y);
    p->x[i] = x;
    p->y[i] = y;
    // for backward compatibility assign the first 2 points to xl, yl, xh & yh
    if (i == 0) {
      xl_ = x;
      yl_ = y;
    } else if (i == 1) {
      xh_ = x;
      yh_ = y;
    }
  }
  if (points_) {
     tp = points_;
     defFree((char*)(tp->x));
     defFree((char*)(tp->y));
     defFree((char*)(tp));
  }
  points_ = p;
}
示例#12
0
void defiBox::Destroy() {
  struct defiPoints* p;

  p = points_;
  if (p) {
    defFree((char*)(p->x));
    defFree((char*)(p->y));
    defFree((char*)(points_));
  }
}
示例#13
0
void defiRow::clear() {
  int i;
  for (i = 0; i < this->numProps_; i++) {
    defFree(this->propNames_[i]);
    defFree(this->propValues_[i]);
    this->propDValues_[i] = 0;
  }
  this->hasDo_ = 0;
  this->hasDoStep_ = 0;
  this->numProps_ = 0;
}
示例#14
0
void defiTrack::Destroy() {
  int i;

  if (this->macro_) defFree(this->macro_);

  if (this->layers_) {
    for (i = 0; i < this->numLayers_; i++)
      if (this->layers_[i]) defFree(this->layers_[i]);
    defFree((char*)(this->layers_));
  }
}
示例#15
0
void defiRegion::clear() {
  int i;
  for (i = 0; i < numProps_; i++) {
    defFree(propNames_[i]);
    defFree(propValues_[i]);
    propDValues_[i] = 0;
  }
  numProps_ = 0;
  numRectangles_ = 0;
  if (type_) defFree(type_);
  type_ = 0;
}
示例#16
0
void defiFPC::Destroy() {

  this->defiFPC::clear();

  if (this->name_) defFree(this->name_);
  this->name_ = 0;
  this->nameLength_ = 0;

  defFree((char*)(this->names_));
  defFree((char*)(this->rowOrComp_));
  this->namesAllocated_ = 0;
}
示例#17
0
void defiFPC::Destroy() {

  clear();

  if (name_) defFree(name_);
  name_ = 0;
  nameLength_ = 0;

  defFree((char*)(names_));
  defFree((char*)(rowOrComp_));
  namesAllocated_ = 0;
}
示例#18
0
void defiRegion::clear() {
  int i;
  for (i = 0; i < this->numProps_; i++) {
    defFree(this->propNames_[i]);
    defFree(this->propValues_[i]);
    this->propDValues_[i] = 0;
  }
  this->numProps_ = 0;
  this->numRectangles_ = 0;
  if (this->type_) defFree(this->type_);
  this->type_ = 0;
}
示例#19
0
void defiFill::clearPts() {
  struct defiPoints* p;
  int i;

  for (i = 0; i < numPts_; i++) {
    p = viaPts_[i];
    defFree((char*)(p->x));
    defFree((char*)(p->y));
    defFree((char*)(viaPts_[i]));
  }
  numPts_ = 0;
}
示例#20
0
void defiFill::clearPoly() {
  struct defiPoints* p;
  int i;

  for (i = 0; i < numPolys_; i++) {
    p = polygons_[i];
    defFree((char*)(p->x));
    defFree((char*)(p->y));
    defFree((char*)(polygons_[i]));
  }
  numPolys_ = 0;
}
示例#21
0
void defiGroup::clear() {
  int i;
  hasRegionName_ = 0;
  hasPerim_ = 0;
  hasMaxX_ = 0;
  hasMaxY_ = 0;
  for (i = 0; i < numProps_; i++) {
    defFree(propNames_[i]);
    defFree(propValues_[i]);
    propDValues_[i] = 0;
  }
  numProps_ = 0;
  numRects_ = 0;
}
示例#22
0
void
defrDisableParserMsgs(int   nMsg,
                      int   *msgs)
{
    ASSERT_INIT;
    int i, j;
    int *tmp;

    if (defSettings->nDDMsgs == 0) {
        defSettings->nDDMsgs = nMsg;
        defSettings->disableDMsgs = (int*) defMalloc(sizeof(int) * nMsg);
        for (i = 0; i < nMsg; i++)
            defSettings->disableDMsgs[i] = msgs[i];
    } else {  // add the list to the existing list 
        // 1st check if the msgId is already on the list before adding it on 
        tmp = (int*) defMalloc(sizeof(int) * (nMsg + defSettings->nDDMsgs));
        for (i = 0; i < defSettings->nDDMsgs; i++)  // copy the existing to the new list 
            tmp[i] = defSettings->disableDMsgs[i];
        defFree((int*) (defSettings->disableDMsgs));
        defSettings->disableDMsgs = tmp;           // set disableDMsgs to the new list 
        for (i = 0; i < nMsg; i++) { // merge the new list with the existing 
            for (j = 0; j < defSettings->nDDMsgs; j++) {
                if (defSettings->disableDMsgs[j] == msgs[i])
                    break;             // msgId already on the list 
            }
            if (j == defSettings->nDDMsgs)           // msgId not on the list, add it on 
                defSettings->disableDMsgs[defSettings->nDDMsgs++] = msgs[i];
        }
    }
    return;
}
示例#23
0
void defiPartition::clear() {
  int i;

  this->setup_ = ' ';
  this->hold_ = ' ';
  this->direction_ = ' ';
  this->type_ = ' ';
  if (this->name_) *(this->name_) = '\0';
  if (this->pin_) *(this->pin_) = '\0';
  if (this->inst_) *(this->inst_) = '\0';
  this->hasMin_ = 0;
  this->hasMax_ = 0;

  if (this->numPins_) {
    for (i = 0; i < this->numPins_; i++) {
      defFree(this->pins_[i]);
      this->pins_[i] = 0;
    }
    this->numPins_ = 0;
  }
  this->hasRiseMin_ = 0;
  this->hasFallMin_ = 0;
  this->hasRiseMax_ = 0;
  this->hasFallMax_ = 0;
  this->hasRiseMinRange_ = 0;
  this->hasFallMinRange_ = 0;  
  this->hasRiseMaxRange_ = 0;
  this->hasFallMaxRange_ = 0;
}
示例#24
0
void defiIOTiming::Init() {
  inst_ = 0;
  instLength_ = 0;
  pin_ = 0;
  pinLength_ = 0;
  from_ = 0;
  fromLength_ = 0;
  to_ = 0;
  toLength_ = 0;
  driveCell_ = 0;
  driveCellLength_ = 0;
  hasVariableRise_ = 0;
  hasVariableFall_ = 0;
  hasSlewRise_ = 0;
  hasSlewFall_ = 0;
  hasCapacitance_ = 0;
  hasDriveCell_ = 0;
  hasFrom_ = 0;
  if (pin_) defFree(pin_);
  pin_ = 0;
  pinLength_ = 0;

  hasTo_ = 0;
  hasParallel_ = 0;
  variableFallMin_ = 0.0;
  variableRiseMin_ = 0.0;
  variableFallMax_ = 0.0;
  variableRiseMax_ = 0.0;
  slewFallMin_ = 0.0;
  slewRiseMin_ = 0.0;
  slewFallMax_ = 0.0;
  slewRiseMax_ = 0.0;
  capacitance_ = 0.0;
  parallel_ = 0.0;
}
示例#25
0
// 5.7
void defiFill::addPts(defiGeometries* geom) {
  struct defiPoints* p;
  int x, y;
  int i;

  if (numPts_ == ptsAllocated_) {
    struct defiPoints** pts;
    ptsAllocated_ = (ptsAllocated_ == 0) ?
          2 : ptsAllocated_ * 2;
    pts= (struct defiPoints**)defMalloc(sizeof(struct defiPoints*) *
            ptsAllocated_);
    for (i = 0; i < numPts_; i++)
      pts[i] = viaPts_[i];
    if (viaPts_)
      defFree((char*)(viaPts_));
    viaPts_ = pts;
  }
  p = (struct defiPoints*)defMalloc(sizeof(struct defiPoints));
  p->numPoints = geom->numPoints();
  p->x = (int*)defMalloc(sizeof(int)*p->numPoints);
  p->y = (int*)defMalloc(sizeof(int)*p->numPoints);
  for (i = 0; i < p->numPoints; i++) {
    geom->points(i, &x, &y);
    p->x[i] = x;
    p->y[i] = y;
  }
  viaPts_[numPts_] = p;
  numPts_ += 1;
}
示例#26
0
void
defrEnableAllMsgs()
{
    ASSERT_INIT;
    defSettings->nDDMsgs = 0;
    defFree((int*) (defSettings->disableDMsgs));
}
示例#27
0
void defiRegion::setType(const char* type) {
  int len;
  if (type_) defFree(type_);
  len = strlen(type) + 1;
  type_ = (char*)defMalloc(len);
  strcpy(type_, DEFCASE(type));
}
示例#28
0
void defiComponent::clear() {
  int i;

  if (this->id_)
     *(this->id_) = '\0';
  if (this->name_)
     *(this->name_) = '\0';
  if (this->regionName_)
     *(this->regionName_) = '\0';
  if (this->foreignName_)
     *(this->foreignName_) = '\0';
  if (this->EEQ_)
     *(this->EEQ_) = '\0';
  if (this->minLayer_)
     *(this->minLayer_) = '\0';
  if (this->maxLayer_)
     *(this->maxLayer_) = '\0';
  this->Fori_ = 0;
  this->status_ = 0;
  this->hasRegionName_ = 0;
  this->hasForeignName_ = 0;
  this->hasFori_ = 0;
  this->hasEEQ_ = 0;
  this->hasWeight_ = 0;
  this->hasGenerate_ = 0;
  this->weight_ = 0;
  if (this->source_) defFree(this->source_);
  for (i = 0; i < this->numNets_; i++) {
    defFree(this->nets_[i]);
  }
  this->numNets_ = 0;
  this->source_ = 0;
  this->hasHalo_ = 0;
  this->hasHaloSoft_ = 0;
  this->haloDist_ = 0;
  this->leftHalo_ = 0;
  this->bottomHalo_ = 0;
  this->rightHalo_ = 0;
  this->topHalo_ = 0;
  for (i = 0; i < this->numProps_; i++) {
    defFree(this->names_[i]);
    defFree(this->values_[i]);
    this->dvalues_[i] = 0;
  }
  this->numProps_ = 0;
  this->numRects_ = 0;
}
示例#29
0
void defiPath::bumpSize(int size) {
  int i;
  int* newKeys = (int*)defMalloc(size * sizeof(int*));
  void** newData = (void**)defMalloc(size * sizeof(void*));

  for (i = 0; i < this->numUsed_; i++) {
    newKeys[i] = this->keys_[i];
    newData[i] = this->data_[i];
  }

  if (this->keys_) defFree((char*)(this->keys_));
  if (this->data_) defFree((char*)(this->data_));

  this->keys_ = newKeys;
  this->data_ = newData;
  this->numAllocated_ = size;
}
示例#30
0
void defiRegion::Destroy() {
  if (name_) defFree(name_);
  clear();
  name_ = 0;
  nameLength_ = 0;
  defFree((char*)(xl_));
  defFree((char*)(yl_));
  defFree((char*)(xh_));
  defFree((char*)(yh_));
  defFree((char*)(propNames_));
  defFree((char*)(propValues_));
  defFree((char*)(propDValues_));
  defFree((char*)(propTypes_));
}