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

📄 oadefinrow.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
字号:
// *****************************************************************************// *****************************************************************************// DefInRow.cpp//// Functions to handle DEF ROW 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.27 $//  $Date: 2005/07/29 13:42:23 $//  $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaLefDef.h"BEGIN_LEFDEF_NAMESPACE// *****************************************************************************// DefInRow::DefInRow()// DefInRow::~DefInRow()//// This is the constructor for the DefInRow class.// *****************************************************************************DefInRow::DefInRow(DefIn    &translator):   defIn(translator){    translator.defInRow = this;}DefInRow::~DefInRow(){}// *****************************************************************************// DefInRow::parse()//// This function is called for each "ROW" DEF construct.// This creates one row object in the DEF design.// *****************************************************************************voidDefInRow::parse(defiRow  *data){    defRow = data;    oaInt4  origX   = defIn.scaleToDBU(defRow->x());    oaInt4  origY   = defIn.scaleToDBU(defRow->y());    oaUInt4 spaceX  = defIn.scaleToDBU(defRow->xStep());    oaUInt4 spaceY  = defIn.scaleToDBU(defRow->yStep());    oaUInt4 numX    = oaRound(defRow->xNum());    oaUInt4 numY    = oaRound(defRow->yNum());    // Check site exists in tech    oaSiteDef	*siteDef = oaSiteDef::find(defIn.tech(), defRow->macro());    if (!siteDef) {        throw LefDefError(cRowCannotFindSiteDef, defRow->name(), defRow->macro());    }    oaUInt4	siteWidth   = siteDef->getWidth();    oaUInt4	siteHeight  = siteDef->getHeight();    oaBox	siteBBox    = oaBox(0, 0, siteWidth, siteHeight);    oaOrient    siteOrient  = defIn.getOrient(defRow->orient());        siteBBox.transform(oaTransform(siteOrient));    oaInt4	siteSpacing = 0;    oaUInt4	numSites = 0;    oaOrient	rowOrient(oacR0); // default is horizontal row    // Row direction    if (numX > 1 && numY == 1 || (numX == 1 && numY == 1)) {	// horizontal row	numSites = numX;	siteSpacing = spaceX - siteBBox.getWidth();   } else {	// vertical row	rowOrient = oacR90;	numSites = numY;	siteSpacing = spaceY - siteBBox.getHeight();	// Since in OA the site orient and row orient are concatenated,	// the site orientation needs to be transformed -90 degrees.	int defOrient = defRow->orient();	switch (defOrient) {	  case 0:	    siteOrient = oacR270;	    origX += siteWidth;	    break;	  case 1:	    siteOrient = oacR0;	    origX += siteHeight;	    break;	  case 2:	    siteOrient = oacR90;	    origX += siteWidth;	    break;	  case 3:	    siteOrient = oacR180;	    origX += siteHeight;	    break;	  case 4:	    siteOrient = oacMXR90;	    origX += siteWidth;	    break;	  case 5:	    siteOrient = oacMX;	    origX += siteHeight;	    break;	  case 6:	    siteOrient = oacMYR90;	    origX += siteWidth;	    break;	  case 7:	    siteOrient = oacMY;	    origX += siteHeight;	    break;	}    }        if (siteSpacing < 0) {	throw LefDefError(cRowInvalidStep, defRow->name());    }    // Row creation    oaRow   *row = oaRow::create(defIn.design()->getTopBlock(), siteDef,				 defRow->name(), oaPoint(origX, origY),				 rowOrient, numSites, siteOrient, siteSpacing);    // User properties    LefDefProp    *propDef;    for (int i = 0; i < defRow->numProps(); i++) {	propDef = defIn.getProp(defRow->propName(i), cLefDefRow);	defIn.createProp(propDef, row, oaString(defRow->propValue(i)));    }}END_LEFDEF_NAMESPACE

⌨️ 快捷键说明

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