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

📄 oalefinpin.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
// *****************************************************************************// *****************************************************************************// LefInPin.cpp//// Functions to handle LEF MACRO PIN constructs.//// *****************************************************************************// Except as specified in the OpenAccess terms of use of Cadence or Silicon// Integration Initiative, this material may not be copied, modified,// re-published, uploaded, executed, or distributed in any way, in any medium,// in whole or in part, without prior written permission from Cadence.////                Copyright 2002-2005 Cadence Design Systems, Inc.//                           All Rights Reserved.////  $Author: mhahn $//  $Revision: 1.80 $//  $Date: 2005/01/04 03:26:23 $//  $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaLefDef.h"BEGIN_LEFDEF_NAMESPACE// *****************************************************************************// LefInPin::LefInPin()// LefInPin::~LefInPin()//// This is the constructor for the LefInPin class. // *****************************************************************************LefInPin::LefInPin(LefIn    &translator):   lefIn(translator),    term(NULL){    translator.lefInPin = this;}LefInPin::~LefInPin(){}// *****************************************************************************// LefInPin::parse()//// This function handles the MACRO 'PIN' LEF construct.// For each port geometry, a new physical 'pin' object is created // (when it makes sense) attached to the terminal;// For each port all these pins will be added to an oaStrongPinGroup// Note : Terminals with vectorBitName (like a[1]) name// need to be created with busNet object (1 bit wide) and not with the// busNetBit associated to the busNet object.// *****************************************************************************voidLefInPin::parse(lefiPin  *data){    lefPin = data;        createTerm();    parseMustJoin();    parsePorts();    parseDirection();    parseUse();    parseShape();    parseTaperRule();    parseSensitivity();    parseNetExpr();    parseProperties();    parseAntenna();}// *****************************************************************************// LefInPin::parseMustJoin()//// This function handles the mustJoin attribute.// *****************************************************************************voidLefInPin::parseMustJoin(){    if (lefPin->hasMustjoin()) {	oaSimpleName mustJoinName(lefIn.getNS(), lefPin->mustjoin());	oaTerm	*mjTerm = oaTerm::find(lefIn.topBlock(), mustJoinName);	if (!mjTerm) {	    throw LefDefError(cPinMustJoinTermNotFound, lefPin->name(),			      lefPin->mustjoin());	}	term->setMustJoin((oaBitTerm*) mjTerm);    }}// *****************************************************************************// LefInPin::parsePorts()//// This function handles the Pin ports.// Ports are represented in OA by oaStrongPinGroups.// All ports of a terminal are grouped together in an oaWeakPinGroup.// Several weakpingroups on a terminal represent LEF mustjoin pins.// *****************************************************************************voidLefInPin::parsePorts(){    if (lefIn.design()->getMode() == 'a') {	return;    }        for (int i = 0; i < lefPin->numPorts(); i++) {	oaPin		*pin = oaPin::create(term);		lefIn.getLefInGeomPin()->parse(lefPin->port(i), pin);	if (lefIn.getLefInGeomPin()->isClassCore()) {	    lefIn.setBooleanProp(pin, cLefPinClassCore, true);	}    }}// *****************************************************************************// LefInPin::parseDirection()//// This function handles the Macro Pin direction.// Note: For mustjoin pins only check if direction is the same as master pin.// *****************************************************************************voidLefInPin::parseDirection(){    if (lefPin->hasDirection()) {	oaString    direction(lefPin->direction());		if (direction == "OUTPUT") {	    term->setTermType(oacOutputTermType);	} else if (direction == "OUTPUT TRISTATE") {	    term->setTermType(oacTristateTermType);	} else if (direction == "INOUT") {	    term->setTermType(oacInputOutputTermType);	} else if (direction == "FEEDTHRU") {	    term->setTermType(oacJumperTermType);	}    }}// *****************************************************************************// LefInPin::parseUse()//// This function handles the pin use attribute. The pin use is set as sigType// on the terminals net. // *****************************************************************************voidLefInPin::parseUse(){     if (lefPin->hasUse()) {	oaNet	    *net = term->getNet();	oaString    use(lefPin->use());	if (use == "ANALOG") {	    net->setSigType(oacAnalogSigType);	} else if (use == "CLOCK") {	    net->setSigType(oacClockSigType);	} else if (use == "GROUND") {	    net->setSigType(oacGroundSigType);	    term->setRouteMethod(oacGeometricRouteMethod);	} else if (use == "POWER") {	    net->setSigType(oacPowerSigType);	    term->setRouteMethod(oacGeometricRouteMethod);	}    }}// *****************************************************************************// LefInPin::parseShape()//// This function handles the pin shape attribute// Check if mustjoin data is the same as master pin.// *****************************************************************************voidLefInPin::parseShape(){     if (lefPin->hasShape()) {	oaString shape(lefPin->shape());	if (shape == "ABUTMENT") {	    term->setPinConnectMethod(oacAbutPinConnectMethod);	} else if (shape == "RING") {	    term->setPinConnectMethod(oacRingPinConnectMethod);	} else if (shape == "FEEDTHRU") {	    term->setPinConnectMethod(oacFeedthruPinConnectMethod);	}    }}// *****************************************************************************// LefInPin::parseTaperRule()// // This function handles the TAPERRULE attribute for the specified pin.// *****************************************************************************voidLefInPin::parseTaperRule(){    if (lefPin->hasTaperRule()) {	oaConstraintGroup *cg = oaConstraintGroup::find(lefIn.tech(),							lefPin->taperRule());		if (!cg) {	    throw LefDefError(cPinCannotFindRule, lefPin->name(),			      lefPin->taperRule());	}	oaConstraintGroupMem::create(term->getNet()->getConstraintGroup(), cg);    }}// *****************************************************************************// LefInPin::parseSensitivity()// // This function handles the supply and ground sensitivity attributes for the// current pin.// *****************************************************************************voidLefInPin::parseSensitivity(){    if (lefPin->hasGroundSensitivity()) {	oaSimpleName	gndName(lefIn.getNS(), lefPin->groundSensitivity());	oaBitTerm	*gndTerm = (oaBitTerm*) oaTerm::find(lefIn.topBlock(),							     gndName);    	term->setGroundSensitivity(gndTerm);    }    if (lefPin->hasSupplySensitivity()) {	oaSimpleName	vssName(lefIn.getNS(), lefPin->supplySensitivity());	oaBitTerm	*vssTerm = (oaBitTerm*) oaTerm::find(lefIn.topBlock(),							     vssName);    	term->setSupplySensitivity(vssTerm);    }}// *****************************************************************************// LefInPin::parseNetExpr()// // This function handles the NETEXPR attribute for the specified pin.// *****************************************************************************voidLefInPin::parseNetExpr(){    if (lefPin->hasNetExpr()) {	oaString    netExpr = lefPin->netExpr();	oaUInt4	    space = netExpr.substr(" ");		if (space == netExpr.getLength()) {	    throw LefDefError(cPinInvalidNetExpr, lefPin->name(),			      lefPin->netExpr());	}	oaAssignmentDef	assign;	netExpr[space++] = 0;	assign.setAssignmentName(netExpr);		oaString    defNet(&netExpr[space]);	switch (lefIn.getNS().getType(defNet)) {	  case oacScalarNameType:	    assign.setDefaultName(oaScalarName(lefIn.getNS(), defNet));	    break;	  case oacVectorBitNameType:	    assign.setDefaultName(oaVectorBitName(lefIn.getNS(), defNet));	    break;	}	oaTermConnectDef::create((oaBitTerm*) term, assign);    }}// *****************************************************************************// LefInPin::parseProperties()// // This function handles the PROPERTY attributes for the specified pin.// *****************************************************************************voidLefInPin::parseProperties(){    LefDefProp *propDef;    for (int i = 0; i < lefPin->numProperties(); i++) {	propDef = lefIn.getProp(lefPin->propName(i), cLefDefPin);	lefIn.createProp(propDef, term, lefPin->propValue(i));    }}// *****************************************************************************// LefInPin::parseAntenna()//// This function handles the pin antenna attribute// *****************************************************************************voidLefInPin::parseAntenna(){     if (lefPin->hasAntennaSize()	|| lefPin->hasAntennaMetalArea()	|| lefPin->hasAntennaMetalLength()) {	return parseAntenna53();    }        if (lefPin->hasAntennaPartialMetalArea()	|| lefPin->hasAntennaPartialMetalSideArea()	|| lefPin->hasAntennaDiffArea()	|| lefPin->hasAntennaPartialCutArea()	|| lefPin->numAntennaModel() > 0) {	return parseAntenna54();    }}// *****************************************************************************// LefInPin::parseAntenna53()//// This function handles the pin antenna attribute, in 5.3 syntax// Values are converted according to the Wroute appnote on new antenna syntax.// *****************************************************************************voidLefInPin::parseAntenna53(){     oaAntennaData   data;    oaInt4	    i(0);    // Antenna Size

⌨️ 快捷键说明

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