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

📄 oadefinblockage.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
字号:
// *****************************************************************************// *****************************************************************************// DefInBlockage.cpp//// Functions to handle DEF BLOCKAGES 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.35 $//  $Date: 2005/06/14 10:42:53 $//  $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaLefDef.h"BEGIN_LEFDEF_NAMESPACE// *****************************************************************************// DefInBlockage::DefInBlockage()// DefInBlockage::~DefInBlockage()//// This is the constructor for the DefInBlockage class.// *****************************************************************************DefInBlockage::DefInBlockage(DefIn  &translator):   defIn(translator),    blockageType(oacRoutingBlockageType){    translator.defInBlockage = this;}DefInBlockage::~DefInBlockage(){}// *****************************************************************************// DefInBlockage::parse()//// This function handles a DEF BLOCKAGE construct.//// Syntax://   [BLOCKAGES numBlockages ;//	[- LAYER layerName//	    [+ COMPONENT compName | + SLOTS | + FILLS | + PUSHDOWN]//	    [+ SPACING minSpacing | + DESIGNRULEWIDTH effectiveWidth]//		{RECT pt pt | POLYGON pt pt pt ...} ...//	;] ...//	[- PLACEMENT//	    [+ COMPONENT compName | + PUSHDOWN]//		{RECT pt pt} ...//	;] ...//   END BLOCKAGES]//// The DEF BLOCKAGEs are stored in OA as oaBlockages.// *****************************************************************************voidDefInBlockage::parse(defiBlockage   *data){    defBlockage = data;        parseLayer();    parseBlockageType();    parseOwner();    parsePushDown();    parseRects();    parsePolygons();}// *****************************************************************************// DefInBlockage::parseLayer()//// These functions determines the blockage type for the DEF blockage.// *****************************************************************************voidDefInBlockage::parseLayer(){    layerNum = 0;    if (defBlockage->hasLayer()) {	layerNum = defIn.getLayerNum(defBlockage->layerName());    }}// *****************************************************************************// DefInBlockage::parseBlockageType()//// This function determines the blockage type for the DEF blockage.//// Syntax://   - LAYER//	+ SLOTS | + FILLS//   - PLACEMENT//// The blockage type is determined from the LAYER/SLOTS/FILLS/PLACEMENT// attributes as in the table below://	- LAYER	    oacRoutingBlockageType	(default)//	    +FILLS  oacFillBlockageType//	    +SLOTS  oacSlotBlockageType//	- PLACEMENT oacPlacementBlockageType// *****************************************************************************voidDefInBlockage::parseBlockageType(){    blockageType = oacRoutingBlockageType;        if (defBlockage->hasFills()) {	blockageType = oacFillBlockageType;    } else if (defBlockage->hasSlots()) {	blockageType = oacSlotBlockageType;    } else if (defBlockage->hasPlacement()) {	blockageType = oacPlacementBlockageType;    }}// *****************************************************************************// DefInBlockage::parseOwner()//// This function determines the owner for the DEF blockage.//// Syntax://   + COMPONENT compName//// The BLOCKAGE COMPONENT is stored in OA as the blockage owner.// *****************************************************************************voidDefInBlockage::parseOwner(){    owner = NULL;        if (defBlockage->hasComponent()) {		oaSimpleName	simpleInstName;	defIn.getSimpleName(defBlockage->layerComponentName(), simpleInstName);	owner = defIn.getInst(simpleInstName);    }}// *****************************************************************************// DefInBlockage::parsePushDown()//// This function determines the pushDown attribute for the DEF blockage.//// Syntax://   + PUSHDOWN//// The BLOCKAGE PUSHDOWN attribute is stored in the oaBlockage pushDown flag.// *****************************************************************************voidDefInBlockage::parsePushDown(){    pushDown = false;        if (defBlockage->hasPushdown()) {	pushDown = true;    }}// *****************************************************************************// DefInBlockage::parseRects()// DefInBlockage::parseRect()//// These functions parse the rectangles for the DEF blockage.// *****************************************************************************voidDefInBlockage::parseRects(){    for (int i = 0; i < defBlockage->numRectangles(); i++) {	parseRect(i);    }}voidDefInBlockage::parseRect(int	i){    oaUInt4 xl = defIn.scaleToDBU(defBlockage->xl(i));    oaUInt4 yl = defIn.scaleToDBU(defBlockage->yl(i));    oaUInt4 xh = defIn.scaleToDBU(defBlockage->xh(i));    oaUInt4 yh = defIn.scaleToDBU(defBlockage->yh(i));    if (xl == xh || yl == yh) {	defIn.warn(cGeomZeroSizedRect);	return;    }    oaPointArray	bBox(4);    bBox.append(oaPoint(xl, yl));    bBox.append(oaPoint(xl, yh));    bBox.append(oaPoint(xh, yh));    bBox.append(oaPoint(xh, yl));    // Create the blockage    oaBlockage	*blockage;        if (blockageType == oacPlacementBlockageType) {	blockage = oaAreaBlockage::create(defIn.topBlock(), bBox, owner);    } else {	blockage = oaLayerBlockage::create(defIn.topBlock(), blockageType,					   layerNum, bBox, owner);    }    blockage->setPushedDown(pushDown);}// *****************************************************************************// DefInBlockage::parsePolygons()// DefInBlockage::parsePolygon)//// These functions parse the polygons for the DEF blockage.// *****************************************************************************voidDefInBlockage::parsePolygons(){    for (int i = 0; i < defBlockage->numPolygons(); i++) {	parsePolygon(i);    }}voidDefInBlockage::parsePolygon(int	i){    // Get the points of the geometry    oaUInt4	    numPoints = defBlockage->getPolygon(i).numPoints;    oaPointArray    points(numPoints);    for (oaUInt4 j = 0; j < numPoints; j++) {	points[j] = oaPoint(defIn.scaleToDBU(defBlockage->getPolygon(i).x[j]),			    defIn.scaleToDBU(defBlockage->getPolygon(i).y[j]));    }    points.setNumElements(numPoints);    points.compress();    // Create the blockage    oaBlockage	*blockage;    // For 5.6 only LAYER blockages can be polygons. Error caught by parser.    // if (blockageType == oacPlacementBlockageType) {    //     blockage = oaAreaBlockage::create(defIn.topBlock(), points, owner);    //} else {    blockage = oaLayerBlockage::create(defIn.topBlock(), blockageType,				       layerNum, points, owner);    //}    blockage->setPushedDown(pushDown);}END_LEFDEF_NAMESPACE

⌨️ 快捷键说明

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