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

📄 oadefingroup.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
字号:
// *****************************************************************************// *****************************************************************************// DefInGroup.cpp//// Functions to handle DEF GROUPS constructs for the 'def2oa' translator.//// *****************************************************************************// 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: nitters $//  $Revision: 1.40 $//  $Date: 2005/04/28 12:02:14 $//  $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaLefDef.h"BEGIN_LEFDEF_NAMESPACE// *****************************************************************************// DefInGroup::DefInGroup()// DefInGroup::~DefInGroup()//// This is the constructors for the DefInGroup class. // *****************************************************************************DefInGroup::DefInGroup(DefIn	&translator):   defIn(translator){    translator.defInGroup = this;}DefInGroup::~DefInGroup(){}// *****************************************************************************// DefInGroup::getGroupName()//// This function returns a new group name that is not yet used.// *****************************************************************************voidDefInGroup::getGroupName(oaString &name){    oaCluster *group = oaCluster::find(defIn.topBlock(), name);    if (group) {	name += "_group";	getGroupName(name);    }}// *****************************************************************************// DefInGroup::parse()//// This function is called for each group defined in the "GROUPS" DEF construct.// A cluster object is created in the DEF design.// *****************************************************************************voidDefInGroup::parse(const oaString    &data){    currentGroup = oaCluster::find(defIn.topBlock(), data);    groupName = data;    if (currentGroup) {	if (!currentGroup->getBoundaries().getCount()) {	    return;	}		getGroupName(groupName);	defIn.warn(cGroupRegionAlreadyExists, (const char *) data,		   (const char *) groupName);    }    // Creates a new group    currentGroup = oaCluster::create(defIn.topBlock(), groupName,				     oacClusterTypeInclusive);}// *****************************************************************************// DefInGroup::parseAttributes()//// This function is called for each group found in the "GROUPS" DEF construct.// Note : When it's called, the associated cluster object has already been// created.// *****************************************************************************voidDefInGroup::parseAttributes(defiGroup	*data){    defGroup = data;        oaCluster	*region = NULL;        if (defGroup->hasRegionName()) {	region = defIn.getDefInRegion()->find(defGroup->regionName());	if (region) { 	    currentGroup->addToCluster(region);	} else { 	    defIn.error(cGroupCannotFindRegion, (const char *) groupName,			defGroup->regionName());	}    } else if (defGroup->hasRegionBox()) {	// Create an anonymous region	region = defIn.getDefInRegion()->create("", defGroup, NULL, false, false);	currentGroup->addToCluster(region);    }    // User properties    LefDefProp     *propDef;    for (int i = 0; i < defGroup->numProps(); i++) {	propDef = defIn.getProp(defGroup->propName(i), cLefDefGroup);	defIn.createProp(propDef, currentGroup, defGroup->propValue(i));    }}// *****************************************************************************// DefInGroup::addMember()//// This function is called for each component of the current handled DEF group.// It adds the component as a member of the group.// If the component is already assigned to a cluster (ie group or region member)// it won't be reassigned as a member of the current group// => An instance can't belong today to a region and a group (API).// *****************************************************************************voidDefInGroup::addMember(const oaString	&instName){    oaSimpleName    simpleInstName;        defIn.getSimpleName(instName, simpleInstName);    oaInst	*inst    = defIn.getInst(simpleInstName);    oaCluster	*cluster = inst->getCluster();        if (cluster) {	defIn.error(cGroupInstAlreadyAssigned, (const char*) groupName,		    (const char *) instName);	return;    }	    inst->addToCluster(currentGroup); }END_LEFDEF_NAMESPACE

⌨️ 快捷键说明

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