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); }
Lock::DBRead::DBRead(Locker* lockState, const StringData& dbOrNs) : ScopedLock(lockState, 'r'), _ns(dbOrNs.toString()) { dassert(!_ns.empty()); lockDB(); }
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(); }
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; }
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); }
Lock::DBRead::DBRead(LockState* lockState, const StringData& ns) : ScopedLock(lockState, 'r' ), _what(ns.toString()), _nested(false) { lockDB( _what ); }
Lock::DBWrite::DBWrite(LockState* lockState, const StringData& ns) : ScopedLock(lockState, 'w' ), _what(ns.toString()), _nested(false) { lockDB( _what ); }
void Lock::DBRead::_relock() { lockDB(_what); }
void Lock::DBWrite::_relock() { lockDB(_what); }
Lock::DBRead::DBRead( const StringData& ns, const string &context ) : ScopedLock( 'r' ), _what(ns.toString()), _nested(false) { lockDB( _what, context ); }
Lock::DBRead::DBRead( const StringData& ns ) : ScopedLock( 'r' ), _what(ns.data()), _nested(false) { lockDB( _what ); }
Lock::DBWrite::DBWrite( const StringData& ns ) : ScopedLock( 'w' ), _what(ns.data()), _nested(false) { lockDB( _what ); }
void Lock::DBWrite::_relock() { lockDB(); }