📄 oalefinlayer.cpp
字号:
// *****************************************************************************// *****************************************************************************// LefInLayer.cpp//// Functions to handle LEF LAYER constructs for the LEF input 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.148 $// $Date: 2005/07/19 16:11:13 $// $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaLefDef.h"BEGIN_LEFDEF_NAMESPACE// *****************************************************************************// LefInLayer::LefInLayer()// LefInLayer::~LefInLayer()//// These are the constructor.destructor for the LefInLayer class. // *****************************************************************************LefInLayer::LefInLayer(LefIn& translator): lefIn(translator), layer(NULL){ translator.lefInLayer = this; }LefInLayer::~LefInLayer(){}// *****************************************************************************// LefInLayer::parse()//// This function handles a LEF LAYER.//// Syntax:// LAYER layerName//// A LAYER is stored in OA as an oaPhysicalLayer with the material attribute// set according to the LEF LAYER TYPE.// *****************************************************************************voidLefInLayer::parse(lefiLayer *data){ lefLayer = data; oaMaterial material(oacOtherMaterial); oaString layerType(lefLayer->type()); if (layerType == "MASTERSLICE") { material = oacPolyMaterial; } else if (layerType == "IMPLANT") { material = oacNImplantMaterial; } else if (layerType == "ROUTING") { material = oacMetalMaterial; } else if (layerType == "CUT") { material = oacCutMaterial; } else if (layerType == "OVERLAP") { if (lefIn.getOverlapLayer() != "" && strcmp(lefIn.getOverlapLayer(), lefLayer->name())) { throw LefDefError(cLayerOverlapExists, lefLayer->name(), (const char *) lefIn.getOverlapLayer()); } lefIn.setOverlapLayer(lefLayer->name()); } else { layer = oaPhysicalLayer::find(lefIn.tech(), lefLayer->name()); if (!layer || (layer && lefIn.getOptions()->overwriteMode())) { throw LefDefError(cLayerUnknownType, lefLayer->name(), (const char *) layerType); } material = layer->getMaterial(); } switch (material) { case oacNImplantMaterial: case oacPImplantMaterial: parseImplantLayer(); break; case oacNWellMaterial: case oacPWellMaterial: case oacNDiffMaterial: case oacPDiffMaterial: case oacPolyMaterial: parseMastersliceLayer(); break; case oacCutMaterial: parseCutLayer(); break; case oacMetalMaterial: parseRoutingLayer(); }}// *****************************************************************************// LefIn::parseMastersliceLayer()//// This function handles a layer of type MASTERSLICE.//// Syntax:// LAYER layerName// TYPE MASTERSLICE ;//// The MASTERSLICE layer is stored in OA as an oaPhysicalLayer with material// oacPolyMaterial.// *****************************************************************************voidLefInLayer::parseMastersliceLayer(){ layer = createLayer(oacPolyMaterial); parseProperties();}// *****************************************************************************// LefIn::parseImplantLayer()//// This function handles a layer of type IMPLANT.//// Syntax:// LAYER layerName// TYPE IMPLANT ;//// This IMPLANT layer is stored in OA as an oaPhysicalLayer with material// oacNImplantMaterial.// *****************************************************************************voidLefInLayer::parseImplantLayer(){ layer = createLayer(oacNImplantMaterial); parseMinWidth(); parseCutSpacing(); parseProperties();}// *****************************************************************************// LefIn::parseRoutingLayer()//// This function handles a layer of type ROUTING.//// Syntax:// LAYER layerName// TYPE ROUTING ;//// The ROUTING layer is stored in OA as an oaPhysicalLayer with material// oacMetalMaterial. The layer is also added to the oacValidRoutingLayers// constraint in the LEFDefaultRouteSpec constraint group.// *****************************************************************************voidLefInLayer::parseRoutingLayer(){ layer = createLayer(oacMetalMaterial); lefIn.addLayer(layer->getNumber()); parsePitch(); parseDiagPitch(); parseOffset(); parseWidth(); parseMinWidth(); parseMaxWidth(); parseDiagWidth(); parseMinStep(); parseMinSize(); parseArea(); parseMinEnclosedArea(); parseProtrusionWidth(); parseSpacing(); parseSpacingInfluence(); parseSpacingTable(); parseSpacingTableInfluence(); parseDiagSpacing(); parseDiagMinEdgeLength(); parseDirection(); parseWireExt(); parseMinCutMetal(); parseEnclosureMetal(); parseMinProtrusionCut(); parseRes(); parseCap(); parseHeight(); parseThickness(); parseShrinkage(); parseCapMul(); parseEdgeCap(); parseDensity(); parseFill(); parseAntenna(); parseProperties(); parseACCurDen(); parseDCCurDen();}// *****************************************************************************// LefIn::parseCutLayer()//// This function handles a layer of type CUT.//// Syntax:// LAYER layerName// TYPE CUT ;//// The CUT layer is stored in OA as an oaPhysicalLayer with material// oacCutMaterial.// *****************************************************************************voidLefInLayer::parseCutLayer(){ layer = createLayer(oacCutMaterial); parseCutSpacing(); parseWidth(); parseEnclosure(); parsePreferredEnclosure(); parseProperties(); parseACCurDen(); parseDCCurDen(); parseAntenna(); parseMinCut(); parseCutRes();}// *****************************************************************************// LefInLayer::parseDirection()//// This function handles the direction attributes for the specified layer.//// Syntax:// DIRECTION {HORIZONTAL | VERTICAL | DIAG45 | DIAG135} ;//// The DIRECTION is stored in the oaPhysicalLayer::prefRoutingDir attribute,// with the following mapping:// HORIZONTAL - oacHorzPrefRoutingDir// VERTICAL - oacVertPrefRoutingDir// DIAG45 - oacLeftDiagPrefRoutingDir// DIAG135 - oacRightDiagPrefRoutingDir// *****************************************************************************voidLefInLayer::parseDirection(){ oaString direction(lefLayer->direction()); if (direction == "HORIZONTAL") { layer->setPrefRoutingDir(oacHorzPrefRoutingDir); } else if (direction == "VERTICAL") { layer->setPrefRoutingDir(oacVertPrefRoutingDir); } else if (direction == "DIAG45") { layer->setPrefRoutingDir(oacLeftDiagPrefRoutingDir); } else if (direction == "DIAG135") { layer->setPrefRoutingDir(oacRightDiagPrefRoutingDir); }}// *****************************************************************************// LefInLayer::parsePitch()// // This function handles the PITCH attribute for the current layer.//// Syntax:// PITCH {distance | xDistance yDistance} ;// // The PITCH attribute is stored in OA using an oaIntValue for the// oacHorizontalRouteGridPitch and oacVerticalRouteGridPitch constraints in// the LEFDefaultRouteSpec constraint group. If only a single value is given,// the value is stored in both constraints.// *****************************************************************************voidLefInLayer::parsePitch(){ if (lefLayer->hasPitch() || lefLayer->hasXYPitch()) { double pitch = lefLayer->hasXYPitch() ? lefLayer->pitchX() : lefLayer->pitch(); oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(pitch)); lefIn.setConstraint(lefIn.getDefaultRules(), oacHorizontalRouteGridPitch, layer->getNumber(), v); if (lefLayer->hasXYPitch()) { pitch = lefLayer->pitchY(); } v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(pitch)); lefIn.setConstraint(lefIn.getDefaultRules(), oacVerticalRouteGridPitch, layer->getNumber(), v); }}// *****************************************************************************// LefInLayer::parseDiagPitch()// // This function handles the DIAGPITCH attribute for the current layer.//// Syntax:// [DIAGPITCH {distance | diag45Distance diag135Distance} ;]//// The DIAGPITCH attribute is stored in OA using an oaIntValue for the// oac45RouteGridPitch and oac135RouteGridPitch constraints in the// LEFDefaultRouteSpec constraint group. If only a single value is given,// the value is stored in both constraints.// *****************************************************************************voidLefInLayer::parseDiagPitch(){ if (lefLayer->hasDiagPitch() || lefLayer->hasXYDiagPitch()) { double pitch = lefLayer->hasXYDiagPitch() ? lefLayer->diagPitchX() : lefLayer->diagPitch(); oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(pitch)); lefIn.setConstraint(lefIn.getDefaultRules(), oac45RouteGridPitch, layer->getNumber(), v); if (lefLayer->hasXYDiagPitch()) { pitch = lefLayer->diagPitchY(); } v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(pitch)); lefIn.setConstraint(lefIn.getDefaultRules(), oac135RouteGridPitch, layer->getNumber(), v); }}// *****************************************************************************// LefInLayer::parseOffset()// // This function handles the OFFSET attribute for the current layer.//// Syntax:// [OFFSET {distance | xDistance yDistance} ;]//// The OFFSET attribute is stored in OA using an oaIntValue for the// oacHorizontalRouteGridOffset and oacVerticalRouteGridOffset constraints in// the LEFDefaultRouteSpec constraint group. If no OFFSET is specified, a value// of half the PITCH will be stored in the constraints.// *****************************************************************************voidLefInLayer::parseOffset(){ if (lefLayer->hasOffset() || lefLayer->hasXYOffset() || lefLayer->hasPitch() || lefLayer->hasXYPitch()) { double offset; if (lefLayer->hasXYOffset()) { offset = lefLayer->offsetX(); } else if (lefLayer->hasOffset()) { offset = lefLayer->offset(); } else if (lefLayer->hasXYPitch()) { offset = lefLayer->pitchX() / 2; } else { offset = lefLayer->pitch() / 2; } oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(offset)); lefIn.setConstraint(lefIn.getDefaultRules(), oacHorizontalRouteGridOffset, layer->getNumber(), v); if (lefLayer->hasXYOffset()) { offset = lefLayer->offsetY(); } else if (!lefLayer->hasOffset() && lefLayer->hasXYPitch()) { offset = lefLayer->pitchY() / 2; } v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(offset)); lefIn.setConstraint(lefIn.getDefaultRules(), oacVerticalRouteGridOffset, layer->getNumber(), v); } }// *****************************************************************************// LefInLayer::parseWidth()// // This function handles the WIDTH attribute for the current layer.//// Syntax:// WIDTH defaultWidth ;//// The WIDTH is stored in OA using an oaIntValue for the oacMinWidth constraint// in the LEFDefaultRouteSpec constraint group.// *****************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -