예제 #1
0
void defiComponent::setRegionName(const char* name) {
  int len;

  if ((len = strlen(name)+1) > this->regionNameSize_)
    this->defiComponent::bumpRegionName(len);
  strcpy(this->regionName_, DEFCASE(name));
  this->hasRegionName_ = 1;
}
예제 #2
0
void defiPath::addShape(const char* l) {
  int len = strlen(l)+1;
  if (this->numUsed_ == this->numAllocated_)
    this->defiPath::bumpSize(this->numAllocated_ * 2);
  this->keys_[this->numUsed_] = 'S' ;
  this->data_[this->numUsed_] = defMalloc(len);
  strcpy((char*)(this->data_[this->numUsed_]), DEFCASE(l));
  (this->numUsed_)++;
}
예제 #3
0
// 5.7
void defiFill::setVia(const char* name) {
  int len = strlen(name) + 1;
  if (viaNameLength_ < len) {
    if (viaName_) defFree(viaName_);
    viaName_ = (char*)malloc(len);
    viaNameLength_ = len;
  }
  strcpy(viaName_, DEFCASE(name));
  hasVia_ = 1;
}
예제 #4
0
void defiFill::setLayer(const char* name) {
  int len = strlen(name) + 1;
  if (layerNameLength_ < len) {
    if (layerName_) defFree(layerName_);
    layerName_ = (char*)malloc(len);
    layerNameLength_ = len;
  }
  strcpy(layerName_, DEFCASE(name));
  hasLayer_ = 1;
}
예제 #5
0
void defiComponent::setForeignName(const char* name) {
  int len;

  if (this->defiComponent::hasForeignName())
      defiError(
      "Multiple define of '+ FOREIGN' in COMPONENT is not supported.\n");
  if ((len = strlen(name)+1) > this->foreignNameSize_)
    this->defiComponent::bumpForeignName(len);
  strcpy(this->foreignName_, DEFCASE(name));
  this->hasForeignName_ = 1;
}
예제 #6
0
void defiComponent::setGenerate(const char* newName, const char* macroName) {
  int len = strlen(newName) + 1;

  if (this->generateNameSize_ < len) {
    if (this->generateName_) defFree(this->generateName_);
    this->generateName_ = (char*)defMalloc(len);
    this->generateNameSize_ = len;
  }
  strcpy(this->generateName_, DEFCASE(newName));

  len = strlen(macroName) + 1;
  if (this->macroNameSize_ < len) {
    if (this->macroName_) defFree(this->macroName_);
    this->macroName_ = (char*)defMalloc(len);
    this->macroNameSize_ = len;
  }
  strcpy(this->macroName_, DEFCASE(macroName));

  this->hasGenerate_ = 1;  // Ying Tan fix at 20010918
}
예제 #7
0
void defiGroup::setup(const char* name) {
  int len = strlen(name) + 1;
  if (len > nameLength_) {
    if (name_) defFree(name_);
    nameLength_ = len;
    name_ = (char*)defMalloc(len);
  }
  strcpy(name_, DEFCASE(name));
  clear();

}
예제 #8
0
void defiPropType::setPropType(const char* name, const char type) {
    int len;

    if (this->numProperties_ == this->propertiesAllocated_)
        this->defiPropType::bumpProps();
    len = strlen(name) + 1;
    this->propNames_[this->numProperties_] = (char*)defMalloc(len);
    strcpy(this->propNames_[this->numProperties_], DEFCASE(name));
    this->propTypes_[this->numProperties_] = type;
    this->numProperties_ += 1;
}
예제 #9
0
void defiGroup::setRegionName(const char* region) {
  int len = strlen(region) + 1;
  if (len > regionLength_) {
    if (region_) defFree(region_);
    regionLength_ = len;
    region_ = (char*)defMalloc(len);
  }
  strcpy(region_, DEFCASE(region));
  hasRegionName_ = 1;

}
예제 #10
0
void defiIOTiming::setTo(const char* name) {
  int len = strlen(name) + 1;

  if (toLength_ < len) {
    if (to_) defFree(to_);
    to_ = (char*) defMalloc(len);
    toLength_ = len;
  }

  strcpy(to_, DEFCASE(name));
  hasTo_ = 1;
}
예제 #11
0
void defiIOTiming::setFrom(const char* name) {
  int len = strlen(name) + 1;

  if (fromLength_ < len) {
    if (from_) defFree(from_);
    from_ = (char*) defMalloc(len);
    fromLength_ = len;
  }

  strcpy(from_, DEFCASE(name));
  hasFrom_ = 1;
}
예제 #12
0
void defiIOTiming::setDriveCell(const char* name) {
  int len = strlen(name) + 1;

  if (driveCellLength_ < len) {
    if (driveCell_) defFree(driveCell_);
    driveCell_ = (char*) defMalloc(len);
    driveCellLength_ = len;
  }

  strcpy(driveCell_, DEFCASE(name));
  hasDriveCell_ = 1;
}
예제 #13
0
void defiRegion::addNumProperty(const char* name, const double d,
                                const char* value, const char type) {
  int len;
  if (numProps_ == propsAllocated_) {
    int i;
    char**  nn;
    char**  nv;
    double* nd;
    char*   nt;

    propsAllocated_ *= 2;
    nn = (char**)defMalloc(sizeof(char*)*propsAllocated_);
    nv = (char**)defMalloc(sizeof(char*)*propsAllocated_);
    nd = (double*)defMalloc(sizeof(double)*propsAllocated_);
    nt = (char*)defMalloc(sizeof(char)*propsAllocated_);
    for (i = 0; i < numProps_; i++) {
      nn[i] = propNames_[i];
      nv[i] = propValues_[i];
      nd[i] = propDValues_[i];
      nt[i] = propTypes_[i];
    }
    defFree((char*)(propNames_));
    defFree((char*)(propValues_));
    defFree((char*)(propDValues_));
    defFree((char*)(propTypes_));
    propNames_ = nn;
    propValues_ = nv;
    propDValues_ = nd;
    propTypes_ = nt;
  }
  len = strlen(name) + 1;
  propNames_[numProps_] = (char*)defMalloc(len);
  strcpy(propNames_[numProps_], DEFCASE(name));
  len = strlen(value) + 1;
  propValues_[numProps_] = (char*)defMalloc(len);
  strcpy(propValues_[numProps_], DEFCASE(value));
  propDValues_[numProps_] = d;
  propTypes_[numProps_] = type;
  numProps_ += 1;
}
void defiTimingDisable::setFromTo(const char* fromInst, const char* fromPin,
	 const char* toInst, const char* toPin) {
  int len;

  this->defiTimingDisable::clear();
  this->hasFromTo_ = 1;

  len = strlen(fromInst) + 1;
  if (len > this->fromInstLength_) {
    if (this->fromInst_) defFree(this->fromInst_);
    this->fromInstLength_ = len;
    this->fromInst_ = (char*)defMalloc(len);
  }
  strcpy(this->fromInst_, DEFCASE(fromInst));

  len = strlen(fromPin) + 1;
  if (len > this->fromPinLength_) {
    if (this->fromPin_) defFree(this->fromPin_);
    this->fromPinLength_ = len;
    this->fromPin_ = (char*)defMalloc(len);
  }
  strcpy(this->fromPin_, DEFCASE(fromPin));

  len = strlen(toInst) + 1;
  if (len > this->toInstLength_) {
    if (this->toInst_) defFree(this->toInst_);
    this->toInstLength_ = len;
    this->toInst_ = (char*)defMalloc(len);
  }
  strcpy(this->toInst_, toInst);

  len = strlen(toPin) + 1;
  if (len > this->toPinLength_) {
    if (this->toPin_) defFree(this->toPin_);
    this->toPinLength_ = len;
    this->toPin_ = (char*)defMalloc(len);
  }
  strcpy(this->toPin_, toPin);

}
예제 #15
0
void defiRow::addProperty(const char* name, const char* value, const char type) 
{
  int len;
  if (this->numProps_ == this->propsAllocated_) {
    int i;
    char**  nn;
    char**  nv;
    double* nd;
    char*   nt;
    this->propsAllocated_ *= 2;
    nn = (char**)defMalloc(sizeof(char*)*this->propsAllocated_);
    nv = (char**)defMalloc(sizeof(char*)*this->propsAllocated_);
    nd = (double*)defMalloc(sizeof(double)*this->propsAllocated_);
    nt = (char*)defMalloc(sizeof(char)*this->propsAllocated_);
    for (i = 0; i < this->numProps_; i++) {
      nn[i] = this->propNames_[i];
      nv[i] = this->propValues_[i];
      nd[i] = this->propDValues_[i];
      nt[i] = this->propTypes_[i];
    }
    defFree((char*)(this->propNames_));
    defFree((char*)(this->propValues_));
    defFree((char*)(this->propDValues_));
    defFree((char*)(this->propTypes_));
    this->propNames_ = nn;
    this->propValues_ = nv;
    this->propDValues_ = nd;
    this->propTypes_ = nt;
  }
  len = strlen(name) + 1;
  this->propNames_[this->numProps_] = (char*)defMalloc(len);
  strcpy(this->propNames_[this->numProps_], DEFCASE(name));
  len = strlen(value) + 1;
  this->propValues_[this->numProps_] = (char*)defMalloc(len);
  strcpy(this->propValues_[this->numProps_], DEFCASE(value));
  this->propDValues_[this->numProps_] = 0;
  this->propTypes_[this->numProps_] = type;
  this->numProps_ += 1;
}
예제 #16
0
void defiPartition::set(char dir, char typ, const char* inst, const char* pin) {
  int len = strlen(pin) + 1;
  this->direction_ = dir;
  this->type_ = typ;

  if (this->pinLength_ <= len) {
    if (this->pin_) defFree(this->pin_);
    this->pin_ = (char*)defMalloc(len);
    this->pinLength_ = len;
  }

  strcpy(this->pin_, DEFCASE(pin));

  len = strlen(inst) + 1;
  if (this->instLength_ <= len) {
    if (this->inst_) defFree(this->inst_);
    this->inst_ = (char*)defMalloc(len);
    this->instLength_ = len;
  }

  strcpy(this->inst_, DEFCASE(inst));
}
예제 #17
0
void defiPartition::setName(const char* name) {
  int len = strlen(name) + 1;

  this->defiPartition::clear();

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

}
예제 #18
0
void defiGcellGrid::setup(const char* macro, int x, int xNum, double xStep) {
  int 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->xNum_ = xNum;
  this->xStep_ = xStep;
}
예제 #19
0
void defiIOTiming::setName(const char* inst, const char* pin) {
  int len;

  clear();

  len = strlen(inst) + 1;
  if (len > instLength_) {
    if (inst_) defFree(inst_);
    instLength_ = len;
    inst_ = (char*)defMalloc(len);
  }
  strcpy(inst_, DEFCASE(inst));

  len = strlen(pin) + 1;
  if (len > pinLength_) {
    if (pin_) defFree(pin_);
    pinLength_ = len;
    pin_ = (char*)defMalloc(len);
  }
  strcpy(pin_, DEFCASE(pin));

}
void defiTimingDisable::setMacro(const char* name) {
  int len;

  // hasThru_ or hasFromTo_ was already set.
  // clear() was already called.
  this->hasMacro_ = 1;

  len = strlen(name) + 1;
  if (len > this->fromInstLength_) {
    if (this->fromInst_) defFree(this->fromInst_);
    this->fromInstLength_ = len;
    this->fromInst_ = (char*)defMalloc(len);
  }
  strcpy(this->fromInst_, DEFCASE(name));
}
void defiTimingDisable::setMacroThru(const char* thru) {
  int len;

  this->defiTimingDisable::clear();

  this->hasThru_ = 1;

  len = strlen(thru) + 1;
  if (len > this->fromPinLength_) {
    if (this->fromPin_) defFree(this->fromPin_);
    this->fromPinLength_ = len;
    this->fromPin_ = (char*)defMalloc(len);
  }
  strcpy(this->fromPin_, DEFCASE(thru));

}
예제 #22
0
void defiPartition::addPin(const char* name) {
  int len;
  int i;
  char** newp;

  if (this->numPins_ >= this->pinsAllocated_) {
    this->pinsAllocated_ = this->pinsAllocated_ ? 2 * this->pinsAllocated_ : 8;
    newp = (char**) defMalloc(sizeof(char*) * this->pinsAllocated_);
    for (i = 0; i < this->numPins_; i++)
      newp[i] = this->pins_[i];
    if (this->pins_) defFree((char*)(this->pins_));
    this->pins_ = newp;
  }

  len = strlen(name) + 1;
  this->pins_[this->numPins_] = (char*)defMalloc(len);
  strcpy(this->pins_[this->numPins_], DEFCASE(name));
  this->numPins_ += 1;
}
예제 #23
0
void defiNonDefault::addViaRule(const char* name) {
  if (numViaRules_ == viaRulesAllocated_) {
    int i;
    char** vn;

    if (viaRulesAllocated_ == 0)
      viaRulesAllocated_ = 2;
    else
      viaRulesAllocated_ *= 2;
    vn = (char**)defMalloc(sizeof(char*)* viaRulesAllocated_);
    for (i = 0; i < numViaRules_; i++) {
      vn[i] = viaRuleNames_[i];
    }
    defFree((char*)(viaRuleNames_));
    viaRuleNames_ = vn;
  } 
  viaRuleNames_[numViaRules_] = (char*)defMalloc(strlen(name)+1);
  strcpy(viaRuleNames_[numViaRules_], DEFCASE(name));
  numViaRules_ += 1;
}
예제 #24
0
void defiFPC::setName(const char* name, const char* direction) {
  int len = strlen(name) + 1;

  clear();

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

  if (*direction == 'H')
    direction_ = 'H';
  else if (*direction == 'V')
    direction_ = 'V';
  else
    defiError(0, 6030, "ERROR (DEFPARS-6030): Invalid direction specified with FPC name. The valid direction is either 'H' or 'V'. Specify a valid value and then try again.");

}
예제 #25
0
void defiTrack::addLayer(const char* layer) {
  char* l;
  int len;

  if (this->numLayers_ >= this->layersLength_) {
    int i;
    char** newl;
    this->layersLength_ = this->layersLength_ ? 2 * this->layersLength_ : 8;
    newl = (char**)defMalloc(this->layersLength_* sizeof(char*));
    for (i = 0; i < this->numLayers_; i++)
      newl[i] = this->layers_[i];
    if (this->layers_) defFree((char*)(this->layers_));
    this->layers_ = newl;
  }

  len = strlen(layer) + 1;
  l = (char*)defMalloc(len);
  strcpy(l, DEFCASE(layer));
  this->layers_[this->numLayers_++] = l;
}
예제 #26
0
void defiFPC::setName(const char* name, const char* direction) {
  int len = strlen(name) + 1;

  this->defiFPC::clear();

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

  if (*direction == 'H')
    this->direction_ = 'H';
  else if (*direction == 'V')
    this->direction_ = 'V';
  else
    defiError("ERROR (DEFPARS-6030): The direction given with FPC name is invalid.\nValid direction is either H or V");

}
예제 #27
0
void defiTrack::setup(const char* macro) {
  int i;
  int 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));

  if (this->layers_) {
    for (i = 0; i < this->numLayers_; i++)
      if (this->layers_[i]) {
        defFree(this->layers_[i]);
        this->layers_[i] = 0;
      }
  }
  this->numLayers_ = 0;
  this->x_ = 0.0;
  this->xStep_ = 0.0;
  this->xNum_ = 0.0;

}
예제 #28
0
void defiNonDefault::addLayer(const char* name) { 
  int len = strlen(name) + 1;
  if (numLayers_ == layersAllocated_) {
    int i;
    char**  newl;
    double* neww;
    double* newd;
    double* news;
    double* newe;
    char*   newhd;
    char*   newhs;
    char*   newhe;

    if (layersAllocated_ == 0)
      layersAllocated_ = 2;
    else
      layersAllocated_ *= 2;
    newl = (char**)defMalloc(sizeof(char*) * layersAllocated_);
    newe = (double*)defMalloc(sizeof(double) * layersAllocated_);
    neww = (double*)defMalloc(sizeof(double) * layersAllocated_);
    newd = (double*)defMalloc(sizeof(double) * layersAllocated_);
    news = (double*)defMalloc(sizeof(double) * layersAllocated_);
    newhe = (char*)defMalloc(sizeof(char) * layersAllocated_);
    newhd = (char*)defMalloc(sizeof(char) * layersAllocated_);
    newhs = (char*)defMalloc(sizeof(char) * layersAllocated_);
    for (i = 0; i < numLayers_; i++) {
      newl[i]  = layerName_[i];
      neww[i]  = width_[i];
      newd[i]  = diagWidth_[i];
      news[i]  = spacing_[i];
      newe[i]  = wireExt_[i];
      newhe[i]  = hasWireExt_[i];
      newhd[i]  = hasDiagWidth_[i];
      newhs[i]  = hasSpacing_[i];
    }
    if (layersAllocated_ > 2) {
      defFree((char*)(layerName_));
      defFree((char*)(width_));
      defFree((char*)(diagWidth_));
      defFree((char*)(spacing_));
      defFree((char*)(wireExt_));
      defFree((char*)(hasWireExt_));
      defFree((char*)(hasDiagWidth_));
      defFree((char*)(hasSpacing_));
    }
    layerName_ = newl;
    width_ = neww;
    diagWidth_ = newd;
    spacing_ = news;
    wireExt_ = newe;
    hasDiagWidth_ = newhd;
    hasSpacing_ = newhs;
    hasWireExt_ = newhe;
  }
  layerName_[numLayers_] = (char*)defMalloc(len);
  strcpy(layerName_[numLayers_], DEFCASE(name));
  width_[numLayers_] = 0.0;
  diagWidth_[numLayers_] = 0.0;
  spacing_[numLayers_] = 0.0;
  wireExt_[numLayers_] = 0.0;
  hasDiagWidth_[numLayers_] = '\0';
  hasSpacing_[numLayers_] = '\0';
  hasWireExt_[numLayers_] = '\0';
  numLayers_ += 1;
}
예제 #29
0
void defiFPC::addComps(const char* name) {
  addItem('C', DEFCASE(name));
}
예제 #30
0
void defiFPC::addRow(const char* name) {
  addItem('R', DEFCASE(name));
}