示例#1
0
LayerMapCif* DataCenter::secureCifLayMap(bool import)
{
   const USMap* savedMap = _properties.getCifLayMap();
   if (NULL != savedMap) return DEBUG_NEW LayerMapCif(*savedMap);
   USMap* theMap = DEBUG_NEW USMap();
   if (import)
   {// Generate the default CIF layer map for import
      lockCIF();
      nameList cifLayers;
      CIFgetLay(cifLayers);
      unlockCIF();
      word laynum = 1;
      for ( nameList::const_iterator CCL = cifLayers.begin(); CCL != cifLayers.end(); CCL++ )
         (*theMap)[laynum] = *CCL;
   }
   else
   {// Generate the default CIF layer map for export
      lockDB(false);
      nameList tdtLayers;
      all_layers(tdtLayers);
      for ( nameList::const_iterator CDL = tdtLayers.begin(); CDL != tdtLayers.end(); CDL++ )
      {
         std::ostringstream ciflayname;
         word layno = getLayerNo( *CDL );
         ciflayname << "L" << layno;
         (*theMap)[layno] = ciflayname.str();
      }
      unlockDB();
   }
   return DEBUG_NEW LayerMapCif(*theMap);
}
示例#2
0
    Lock::DBRead::DBRead(Locker* lockState, const StringData& dbOrNs)
        : ScopedLock(lockState, 'r'),
          _ns(dbOrNs.toString()) {

        dassert(!_ns.empty());
        lockDB();
    }
示例#3
0
 Lock::DBLock::DBLock(Locker* lockState, const StringData& db, const newlm::LockMode mode)
     : ScopedLock(lockState, mode == newlm::MODE_S || mode == newlm::MODE_IS ? 'r' : 'w'),
       _id(newlm::RESOURCE_DATABASE, db),
       _mode(mode) {
     dassert(!db.empty());
     dassert(!nsIsFull(db));
     lockDB();
 }
示例#4
0
LayerMapGds* DataCenter::secureGdsLayMap(bool import)
{
   const USMap* savedMap = _properties.getGdsLayMap();
   LayerMapGds* theGdsMap;
   if (NULL == savedMap)
   {
      USMap theMap;
      if (import)
      { // generate default import GDS layer map
         lockGDS();
         GdsLayers* gdsLayers = DEBUG_NEW GdsLayers();
         gdsGetLayers(*gdsLayers);
         unlockGDS();
         for ( GdsLayers::const_iterator CGL = gdsLayers->begin(); CGL != gdsLayers->end(); CGL++ )
         {
            std::ostringstream dtypestr;
            dtypestr << CGL->first << ";";
            for ( WordList::const_iterator CDT = CGL->second.begin(); CDT != CGL->second.end(); CDT++ )
            {
               if ( CDT != CGL->second.begin() ) dtypestr << ", ";
               dtypestr << *CDT;
            }
            theMap[CGL->first] = dtypestr.str();
         }
         theGdsMap = DEBUG_NEW LayerMapGds(theMap, gdsLayers);
      }
      else
      { // generate default export GDS layer map
         lockDB(false);
         nameList tdtLayers;
         all_layers(tdtLayers);
         for ( nameList::const_iterator CDL = tdtLayers.begin(); CDL != tdtLayers.end(); CDL++ )
         {
            std::ostringstream dtypestr;
            dtypestr << DATC->getLayerNo( *CDL )<< "; 0";
            theMap[DATC->getLayerNo( *CDL )] = dtypestr.str();
         }
         DATC->unlockDB();
         theGdsMap = DEBUG_NEW LayerMapGds(theMap, NULL);
      }
   }
   else
   {
      if (import)
      {
         lockGDS();
         GdsLayers* gdsLayers = DEBUG_NEW GdsLayers();
         gdsGetLayers(*gdsLayers);
         unlockGDS();
         theGdsMap = DEBUG_NEW LayerMapGds(*savedMap, gdsLayers);
      }
      else
         theGdsMap = DEBUG_NEW LayerMapGds(*savedMap, NULL);
   }
   return theGdsMap;
}
示例#5
0
bool DataCenter::getCellNamePair(std::string name, laydata::refnamepair& striter) 
{
   laydata::tdtdesign* ATDB = lockDB();
   if (ATDB->checkcell(name))
   {
      striter = ATDB->getcellnamepair(name);
      unlockDB();
      return true;
   }
   unlockDB();
   // search the cell in the libraries because it's not in the DB
   return _TEDLIB.getLibCellRNP(name, striter);
}
示例#6
0
 Lock::DBRead::DBRead(LockState* lockState, const StringData& ns)
     : ScopedLock(lockState, 'r' ), _what(ns.toString()), _nested(false) {
     lockDB( _what );
 }
示例#7
0
 Lock::DBWrite::DBWrite(LockState* lockState, const StringData& ns)
     : ScopedLock(lockState, 'w' ), _what(ns.toString()), _nested(false) {
     lockDB( _what );
 }
示例#8
0
 void Lock::DBRead::_relock() { 
     lockDB(_what);
 }
示例#9
0
 void Lock::DBWrite::_relock() { 
     lockDB(_what);
 }
示例#10
0
 Lock::DBRead::DBRead( const StringData& ns, const string &context )
     : ScopedLock( 'r' ), _what(ns.toString()), _nested(false) {
     lockDB( _what, context );
 }
示例#11
0
 Lock::DBRead::DBRead( const StringData& ns )   
     : ScopedLock( 'r' ), _what(ns.data()), _nested(false) {
     lockDB( _what );
 }
示例#12
0
 Lock::DBWrite::DBWrite( const StringData& ns ) 
     : ScopedLock( 'w' ), _what(ns.data()), _nested(false) {
     lockDB( _what );
 }
示例#13
0
 void Lock::DBWrite::_relock() {
     lockDB();
 }