From 1e4b8b46472b52ccef502c32f2decb73b8fff825 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 13 Nov 2019 16:09:38 +0100 Subject: [PATCH] Added support for extra resistor rules in Hurricane::Technology. * New: In BasicLayer::Material, added "info" kind of material for layers that are only informationals (i.e. not real GDS one). Created to store geometric combination of layers, this is a temporary solution. Have to define a clearer semantic for that. * New: In CRL/helpers/AnalogTechno.py, new "Count" type for count numbers that must not go through DbU::Unit converter. They are plain integers, but stored in DbU::Unit (keeping track of that semantic is left to the user). --- crlcore/python/helpers/AnalogTechno.py | 12 ++++++++---- hurricane/src/hurricane/Technology.cpp | 3 ++- hurricane/src/hurricane/hurricane/BasicLayer.h | 4 +++- hurricane/src/isobar/PyMaterial.cpp | 1 + 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/crlcore/python/helpers/AnalogTechno.py b/crlcore/python/helpers/AnalogTechno.py index cc8c4170..7a42f8bf 100644 --- a/crlcore/python/helpers/AnalogTechno.py +++ b/crlcore/python/helpers/AnalogTechno.py @@ -21,7 +21,7 @@ import Hurricane from Hurricane import DbU from Hurricane import DataBase from Hurricane import Layer -from helpers.io import ErrorMessage +from helpers.io import ErrorMessage, catch from helpers import Debug @@ -32,9 +32,12 @@ Length = 0x0001 Area = 0x0002 Asymmetric = 0x0004 Unit = 0x0008 +Count = 0x0010 def valueToDbU ( value, unit, lengthType ): + if lengthType & Count: return value + length = DbU.fromPhysical( value, unit ) if lengthType & Length: return length @@ -105,9 +108,10 @@ def _loadAnalogTechno ( techno, ruleTable ): , entry[5] ) except Exception, e: - e = ErrorMessage( e ) - e.addMessage( 'In %s: at index %d.' % (technoFile,entryNo) ) - print e + catch( e ) + print ErrorMessage( 1, [ 'In %s:' % technoFile + , '"analogTechnologyTable" at index %d.' % entryNo ] ) + return diff --git a/hurricane/src/hurricane/Technology.cpp b/hurricane/src/hurricane/Technology.cpp index f2980f93..7da97db8 100644 --- a/hurricane/src/hurricane/Technology.cpp +++ b/hurricane/src/hurricane/Technology.cpp @@ -627,7 +627,8 @@ namespace Hurricane { PhysicalRules& rules = ilayer->second; PhysicalRule search ( ruleName, 0, "" ); if (rules.find(&search) != rules.end()) { - throw Error( "Technology::addPhysicalRule(): Attempt to redefine rule \"%s\"." , ruleNameStr.c_str() ); + throw Error( "Technology::addPhysicalRule(): Attempt to redefine rule \"%s\" for layer \"%s\"." + , ruleNameStr.c_str(), layerStr.c_str() ); } rules.insert( new PhysicalRule(ruleName,value,reference) ); diff --git a/hurricane/src/hurricane/hurricane/BasicLayer.h b/hurricane/src/hurricane/hurricane/BasicLayer.h index d3c475f5..9d332c06 100644 --- a/hurricane/src/hurricane/hurricane/BasicLayer.h +++ b/hurricane/src/hurricane/hurricane/BasicLayer.h @@ -59,6 +59,7 @@ namespace Hurricane { , cut , metal , blockage + , info , other }; // Constructors. @@ -181,9 +182,10 @@ inline std::string getString case Hurricane::BasicLayer::Material::cut: return "cut"; case Hurricane::BasicLayer::Material::metal: return "metal"; case Hurricane::BasicLayer::Material::blockage: return "blockage"; + case Hurricane::BasicLayer::Material::info: return "info"; case Hurricane::BasicLayer::Material::other: return "other"; } - return "abnormal"; + return "undefined"; } diff --git a/hurricane/src/isobar/PyMaterial.cpp b/hurricane/src/isobar/PyMaterial.cpp index 28057b21..9c8b518f 100644 --- a/hurricane/src/isobar/PyMaterial.cpp +++ b/hurricane/src/isobar/PyMaterial.cpp @@ -195,6 +195,7 @@ extern "C" { LoadObjectConstant(PyTypeMaterial.tp_dict,BasicLayer::Material::cut ,"cut" ); LoadObjectConstant(PyTypeMaterial.tp_dict,BasicLayer::Material::metal ,"metal" ); LoadObjectConstant(PyTypeMaterial.tp_dict,BasicLayer::Material::blockage,"blockage"); + LoadObjectConstant(PyTypeMaterial.tp_dict,BasicLayer::Material::info ,"info" ); LoadObjectConstant(PyTypeMaterial.tp_dict,BasicLayer::Material::other ,"other" ); }