⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oadefin.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
📖 第 1 页 / 共 4 页
字号:
		pinName.get(getNS(), pinStr);		instTermNet->getName(getNS(), netStr);		net->getName(getNS(), net2Str);		throw LefDefError(cPinUpdateCannotChangeConnect,				  (const char*) pinStr,				  (const char*) netStr,				  (const char*) net2Str);	    }	}    } else {	if (net && isUpdate() && visibility != oacExcludeFromModuleDomain) {	    oaString    netStr;	    oaString    instStr;	    oaString    pinStr;	    net->getName(getNS(), netStr);	    inst->getName(getNS(), instStr);	    pinName.get(getNS(), pinStr);	    throw LefDefError(cNetConnectUpdateNotFound,			      (const char*) netStr,			      (const char*) instStr,			      (const char*) pinStr);	}		// Create the oaInstTerm.	if (term) {	    if (inst->usesTermPositions()) {		instTerm = oaInstTerm::create(net, inst, term->getPosition(), visibility);	    } else {		instTerm = oaInstTerm::create(net, inst, term, visibility);	    }	} else {    	    instTerm = oaInstTerm::create(net, inst, pinName, visibility);	}    }    instTerm->setRouteMethod(routeMethod);    return instTerm;}// *****************************************************************************// DefIn::getNet()//// This function creates a net in the DEF design if it does not exist.// *****************************************************************************oaBitNet*DefIn::getNet(const oaSimpleName	&netName,	      oaSigType			sigType,	      oaBlockDomainVisibility	visibility){    oaNet   *net = oaNet::find(topBlock(), netName);    if (net) {	return (oaBitNet*) net;    }    switch (netName.getType()) {      case oacScalarNameType:	{	    oaScalarName    *scalarNetName = netName.getScalar();	    if (netName.getNumMembers() == 1) {		return oaScalarNet::create(topBlock(), *scalarNetName, sigType,				           false, visibility);	    }	    getDefInModHier()->getScalarNet(*scalarNetName, sigType);	}	break;      case oacVectorBitNameType:	{	    oaVectorBitName	*vectorNetName = netName.getVectorBit();	    if (netName.getNumMembers() == 1) {		return oaBusNetBit::create(topBlock(), *vectorNetName, sigType,					   false, visibility);	    }	    getDefInModHier()->getBusNetBit(*vectorNetName, sigType);	}    }     return (oaBitNet*) oaNet::find(topBlock(), netName);}// *****************************************************************************// DefIn::getDefInModHier()// DefIn::getDefInBlockage()// DefIn::getDefInComponent()// DefIn::getDefInGroup()// DefIn::getDefInNDR()// DefIn::getDefInNet()// DefIn::getDefInPin()// DefIn::getDefInRegion()// DefIn::getDefInRow()// DefIn::getDefInScanChain()// DefIn::getDefInStyle()// DefIn::getDefInVia()//// These functions return the helper classes. If they do not exist, they are// created here.// *****************************************************************************DefInModHier*DefIn::getDefInModHier(){    if (!defInModHier) {	defInModHier = new DefInModHier(*this);    }    return defInModHier;}DefInBlockage*DefIn::getDefInBlockage(){    if (!defInBlockage) {	defInBlockage = new DefInBlockage(*this);    }    return defInBlockage;}DefInComponent*DefIn::getDefInComponent(){    if (!defInComponent) {	defInComponent = new DefInComponent(*this);    }    return defInComponent;}DefInGroup*DefIn::getDefInGroup(){    if (!defInGroup) {	defInGroup = new DefInGroup(*this);    }    return defInGroup;}DefInNDR*DefIn::getDefInNDR(){    if (!defInNDR) {	defInNDR = new DefInNDR(*this);    }    return defInNDR;}DefInNet*DefIn::getDefInNet(){    if (!defInNet) {	defInNet = new DefInNet(*this);    }    return defInNet;}DefInPin*DefIn::getDefInPin(){    if (!defInPin) {	defInPin = new DefInPin(*this);    }    return defInPin;}DefInRegion*DefIn::getDefInRegion(){    if (!defInRegion) {	defInRegion = new DefInRegion(*this);    }    return defInRegion;}DefInRow*DefIn::getDefInRow(){    if (!defInRow) {	defInRow = new DefInRow(*this);    }    return defInRow;}DefInScanChain*DefIn::getDefInScanChain(){    if (!defInScanChain) {	defInScanChain = new DefInScanChain(*this);    }    return defInScanChain;}DefInStyle*DefIn::getDefInStyle(){    if (!defInStyle) {	defInStyle = new DefInStyle(*this);    }    return defInStyle;}DefInTrack*DefIn::getDefInTrack(){    if (!defInTrack) {	defInTrack = new DefInTrack(*this);    }    return defInTrack;}DefInVia*DefIn::getDefInVia(){    if (!defInVia) {	defInVia = new DefInVia(*this);    }    return defInVia;}// *****************************************************************************// DefIn::init()//// This function initializes the helper objects. If none exist they are// allocated here.// *****************************************************************************voidDefIn::init(){    LefDefIn::init();    getDefInNet()->init();    getDefInRegion()->init();    getDefInStyle()->init();    getDefInVia()->init();    designs.setNumElements(0);}// *****************************************************************************// DefIn::initCallbacks()//// This function initializes the DEF parser and registers all the callbacks// functions before launching the parser. Each function will be automatically// called when the parser finds the corresponding DEF construct in the DEF file.// *****************************************************************************voidDefIn::initCallbacks(){    if (defrInit()) {	throw LefDefError(cParserInitializeFailed);    }    defrSetCaseSensitiveCbk(cbCaseSensitive);    defrSetBusBitCbk(cbBusBitChars);    defrSetDividerCbk(cbDividerChar);    defrSetDesignCbk(cbDesign);    defrSetTechnologyCbk(cbTechnology);    defrSetUnitsCbk(cbUnits);    defrSetPropCbk(cbPropDef);    defrSetDieAreaCbk(cbDieArea);    defrSetRowCbk(cbRow);    defrSetTrackCbk(cbTrack);    defrSetGcellGridCbk(cbGCellGrid);    defrSetViaCbk(cbVia);    defrSetStylesCbk(cbStyle);    defrSetNonDefaultCbk(cbNDR);    defrSetRegionCbk(cbRegion);    defrSetComponentCbk(cbComponent);    defrSetPinCbk(cbPins);    defrSetPinPropCbk(cbPinPropDef);    defrSetSNetCbk(cbSNet);    defrSetNetCbk(cbNet);    defrSetScanchainCbk(cbScanChain);    defrSetGroupNameCbk(cbGroupName);    defrSetGroupMemberCbk(cbGroupMember);    defrSetGroupCbk(cbGroup);    defrSetBlockageCbk(cbBlockages);    defrSetFillCbk(cbFill);    defrSetDesignEndCbk(cbDesignEnd);    // Make the paths be part of the nets so they are returned with the nets.    // That way we can add the paths as we add the nets.    defrSetAddPathToNet();}// *****************************************************************************// DefIn::parse()//// This function opens the DEF file and launches the DEF parser.// The callback functions will create the design data.// *****************************************************************************voidDefIn::parse(FILE   *file){     defrReset();    unresolvedMasters = false;    if (defrReadGZip(file, "", this)) {	throw LefDefError(cParseError);    }}// *****************************************************************************// DefIn::parseCaseSensitive()//// This function handles the "NAMESCASESENSITIVE" DEF construct.//// Syntax://   NAMESCASESENSITIVE {OFF | ON} ;//// The NAMECASESENSITIVE option is not supported in OA. An error is output if// the DEF data is not case sensitive.// *****************************************************************************voidDefIn::parseCaseSensitive(int	data){    if (!data) {	throw LefDefError(cCaseSensitiveOnly);    }}// *****************************************************************************// DefIn::parseBusBitChars()//// This function handles the "BUSBITCHARS" DEF construct.//// Syntax://   BUSBITCHARS "delimiterPair" ;//// The BUSBITCHARS statement is not persistently stored in OA. It is stored in// the temporary oaDefNS namespace for use during parsing of the DEF file. // *****************************************************************************voidDefIn::parseBusBitChars(const char  *data){    oaString	busBitChars(data);    if (busBitChars.getLength() != 2) {	throw LefDefError(cInvalidBusBitChars, data);    }    defNS.setOpenBusChar(busBitChars[(oaUInt4)0]);    defNS.setCloseBusChar(busBitChars[(oaUInt4)1]);}// *****************************************************************************// DefIn::parseDividerChar()//// This function handles the "DIVIDERCHAR" DEF construct.//// Syntax://   DIVIDERCHAR "character" ;//// The DIVIDERCHAR statement is not persistently stored in OA. It is stored in// the temporary oaDefNS namespace for use during parsing of the DEF file. // *****************************************************************************voidDefIn::parseDividerChar(const char  *data){    oaString	hierCharString(data);    if (hierCharString.getLength() != 1) {	throw LefDefError(cInvalidHierChar, data);    }    defNS.setHierDelimiter(hierCharString[(oaUInt4)0]);}// *****************************************************************************// DefIn::parseDesign()//// This function creates the design.//// Syntax://   DESIGN designName ;//// The DESIGN specifies the cell name for the oaDesign that is created. If a// cell name is specified in the translator options, the DESIGN statement is// ignored.// *****************************************************************************voidDefIn::parseDesign(const char	*data){    // Determine cell name.    oaScalarName    cellName(getNS(), data);    if (options->getNumFileNames() == 1 && !options->getCellName().isEmpty()) {	cellName = options->getCellName();    }    // Open or create the design.    if (oaDesign::exists(options->getLibName(), cellName, options->getViewName())	&& !getOptions()->doOverwrite()) {	update = true;	design() = oaDesign::open(options->getLibName(),				  cellName,				  options->getViewName(),				  oaViewType::get(oacMaskLayout), 'a');	design()->scalarize();    } else {	update = false;	design() = oaDesign::open(options->getLibName(),				  cellName,				  options->getViewName(),				  oaViewType::get(oacMaskLayout), 'w');    }    if (!topBlock()) {	oaBlock::create(design());    }    design()->setCellType(oacSoftMacroCellType);}// *****************************************************************************// DefIn::parseTechnology()//// This function handles the "TECHNOLOGY" DEF construct.//// Syntax://   [TECHNOLOGY technologyName ;]//// The TECHNOLOGY statement is stored in OA as a property on the oaDesign.// *****************************************************************************voidDefIn::parseTechnology(const char   *data){    setProp(design(), cDefTechnology, data);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -