diff --git a/crlcore/CMakeLists.txt b/crlcore/CMakeLists.txt index 22859135..3ea8097b 100644 --- a/crlcore/CMakeLists.txt +++ b/crlcore/CMakeLists.txt @@ -29,6 +29,8 @@ find_package(OPENACCESS) find_package(VLSISAPD REQUIRED) find_package(HURRICANE REQUIRED) + find_package(Boost REQUIRED) + find_package(Libexecinfo REQUIRED) if(BUILD_DOC) include(UseLATEX) endif(BUILD_DOC) diff --git a/crlcore/doc/UsersGuide/SoC.css b/crlcore/doc/UsersGuide/SoC.css index 403d30e0..ec6d2f2e 100644 --- a/crlcore/doc/UsersGuide/SoC.css +++ b/crlcore/doc/UsersGuide/SoC.css @@ -4,30 +4,6 @@ html, body, th, td, tr, p, li, h1, h2, h3, h4, h5, h6 { font-family: verdana, sans-serif; } -p, li { - text-align: justify; -} - -.sc { - font-variant: small-caps; - font-size: 110%; -} - -h1, h2, h3, h4, h5, h6 { - font-family: verdana, sans-serif; -} - -h1 { text-align: left; } -h2, h3, h4, h5, h6 { text-align: left; } -h1, h2, h3 { font-family: "Liberation Serif"; - } -h1 { font-weight: normal; font-size: 170%; padding-top: 7pt; margin-top: 25pt; } -h2 { font-weight: normal; font-size: 140%; padding-top: 7pt; margin-top: 25pt; } -h3 { font-weight: bold; font-size: 118%; padding-top: 7pt; margin-top: 25pt; } -h4 { font-weight: bold; font-size: 100%; } -h5 { font-style: italic; font-size: 100%; } -h6 { font-variant: small-caps; font-size: 100%; } - body { color: black; background: white; @@ -44,6 +20,28 @@ body { margin-left: 30%; } +body.gsummary { + margin-right: 10%; + margin-left: 10%; +} + +h1, h2, h3, h4, h5, h6 { + font-family: verdana, sans-serif; +} + +h1 { text-align: left; } +h2, h3, h4, h5, h6 { text-align: left; } +h1, h2, h3 { font-family: "Liberation Serif"; + } +h1 { font-weight: normal; font-size: 170%; padding-top: 7pt; margin-top: 25pt; } +h2 { font-weight: normal; font-size: 140%; padding-top: 7pt; margin-top: 25pt; } +h3 { font-weight: bold; font-size: 118%; padding-top: 7pt; margin-top: 25pt; } +h4 { font-weight: bold; font-size: 100%; } +h5 { font-style: italic; font-size: 100%; } +h6 { font-variant: small-caps; font-size: 100%; } + +body.gsummary h1 { text-align: center; font-size: 220%; } + hr { color: #09550b; border: 1px dotted #09550b; @@ -58,6 +56,15 @@ div#centered { text-align: center; } +p, li { + text-align: justify; +} + +.sc { + font-variant: small-caps; + font-size: 110%; +} + pre, tt, code { font-family: "courrier", "andale mono", monospace; font-size: 100%; @@ -98,6 +105,32 @@ a:hover, a:focus, a:visited { border-bottom: 1px dotted #09550b; } +body.gsummary a:link, a:active { + font-size: 140%; + font-weight: bold; + text-decoration: none; + color: #09550b; + border-bottom: none; + /* + border-bottom: 1px dotted #09550b; + */ +} + +body.gsummary a:hover, a:focus, a:visited { + font-size: 120%; + font-weight: bold; + font-style: italic; + text-decoration: none; + /* + color: #A40010; + border-bottom: 1px dotted #A40010; + */ + color: #09550b; + /* + border-bottom: 1px dotted #09550b; + */ +} + p.credit { margin-left: 10%; margin-right: 10%; @@ -544,6 +577,47 @@ div.topic p.first { font-weight: bold; } +body.gsummary table { + border-collapse: collapse; + border-color: transparent; + width: 60%; + margin-left: auto; + margin-right: auto; +} + +/* +body.gsummary table th { +} +*/ + +body.gsummary table td { + border: none; +} + +/* +body.gsummary table tr td ul { + margin: 0pt; + border-left: 1px solid black; +} +*/ + +/* +body.gsummary table tr td ul li { + border-bottom: 2px dotted black; +} +*/ + +body.gsummary li { + padding: 0%; + list-style-type: none; +} + +body.gsummary ul { + padding: 0px 0px 10px 0px; + margin: 0%; + border-bottom: 1px dotted black; +} + table.wiki th, table th { color: black; background: #FFFFCC; diff --git a/crlcore/doc/general-index.html b/crlcore/doc/general-index.html index 27920d23..47bcf1a6 100644 --- a/crlcore/doc/general-index.html +++ b/crlcore/doc/general-index.html @@ -4,53 +4,65 @@ Coriolis 2 Documentation - + - +

Coriolis 2 Documentation

- +
- - - + + + + + + - - - + diff --git a/crlcore/etc/CMakeLists.txt b/crlcore/etc/CMakeLists.txt index 9b71a680..138453a3 100644 --- a/crlcore/etc/CMakeLists.txt +++ b/crlcore/etc/CMakeLists.txt @@ -1,13 +1,4 @@ - install ( FILES coriolisInit.py DESTINATION ${SYS_CONF_DIR}/coriolis2 ) - install ( FILES helpers/__init__.py DESTINATION ${SYS_CONF_DIR}/coriolis2/helpers ) - install ( FILES helpers/Configuration.py DESTINATION ${SYS_CONF_DIR}/coriolis2/helpers ) - install ( FILES helpers/Alliance.py DESTINATION ${SYS_CONF_DIR}/coriolis2/helpers ) - install ( FILES helpers/Display.py DESTINATION ${SYS_CONF_DIR}/coriolis2/helpers ) - install ( FILES helpers/Patterns.py DESTINATION ${SYS_CONF_DIR}/coriolis2/helpers ) - install ( FILES helpers/SymbolicTechnology.py DESTINATION ${SYS_CONF_DIR}/coriolis2/helpers ) - install ( FILES helpers/RealTechnology.py DESTINATION ${SYS_CONF_DIR}/coriolis2/helpers ) - install ( FILES helpers/Debug.py DESTINATION ${SYS_CONF_DIR}/coriolis2/helpers ) install ( FILES technology_symbolic.conf DESTINATION ${SYS_CONF_DIR}/coriolis2 ) install ( FILES technology_cmos130_s2r.conf DESTINATION ${SYS_CONF_DIR}/coriolis2 ) install ( FILES misc.conf DESTINATION ${SYS_CONF_DIR}/coriolis2 ) diff --git a/crlcore/etc/kite.conf b/crlcore/etc/kite.conf index 67816486..bbb26a68 100644 --- a/crlcore/etc/kite.conf +++ b/crlcore/etc/kite.conf @@ -7,7 +7,7 @@ parametersTable = \ , ("katabatic.saturateRp" ,TypeInt ,8 ) , ("kite.borderRipupLimit" ,TypeInt ,26 ) # Kite parameters. - , ("kite.edgeCapacity" ,TypePercentage,65 , { 'min':0, 'max':110 } ) + , ("kite.edgeCapacity" ,TypePercentage,75 , { 'min':0, 'max':110 } ) , ("kite.eventsLimit" ,TypeInt ,4000002) , ("kite.ripupCost" ,TypeInt ,3 , { 'min':0 } ) , ("kite.globalRipupLimit" ,TypeInt ,5 , { 'min':1 } ) diff --git a/crlcore/etc/misc.conf b/crlcore/etc/misc.conf index 1e533017..20e212ef 100644 --- a/crlcore/etc/misc.conf +++ b/crlcore/etc/misc.conf @@ -3,7 +3,8 @@ parametersTable = \ ( ('misc.catchCore' , TypeBool, False) - , ('misc.info' , TypeBool, True ) + , ('misc.info' , TypeBool, False) + , ('misc.bug' , TypeBool, False) , ('misc.logMode' , TypeBool, False) , ('misc.verboseLevel1', TypeBool, True ) , ('misc.verboseLevel2', TypeBool, False) diff --git a/crlcore/etc/stratus1.conf b/crlcore/etc/stratus1.conf index 904a156f..b5f178f3 100644 --- a/crlcore/etc/stratus1.conf +++ b/crlcore/etc/stratus1.conf @@ -5,6 +5,8 @@ parametersTable = \ ( ("stratus1.mappingName", TypeString, "./stratus2sxlib.xml", { 'flags':Cfg.Parameter.Flags.NeedRestart|Cfg.Parameter.Flags.MustExist } ) + , ("stratus1.format" , TypeString, "vst") + , ("stratus1.simulator" , TypeString, "asimut") ,) @@ -13,4 +15,6 @@ layoutTable = \ ( (TypeTab ,"Stratus1", "stratus1" ) , (TypeTitle , "Stratus1 - Netlist & Layout Capture" ) , (TypeOption, "stratus1.mappingName", "Virtual Library Translation", 0, 2 ) + , (TypeOption, "stratus1.format" , "Netlist Format (vst, vhd)" , 0, 2 ) + , (TypeOption, "stratus1.simulator" , "Simulator" , 0, 2 ) ) diff --git a/crlcore/src/CMakeLists.txt b/crlcore/src/CMakeLists.txt index 6ea83480..ef64edb9 100644 --- a/crlcore/src/CMakeLists.txt +++ b/crlcore/src/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(ccore) add_subdirectory(pyCRL) +add_subdirectory(crlcore) add_subdirectory(cyclop) add_subdirectory(x2y) diff --git a/crlcore/src/ccore/CMakeLists.txt b/crlcore/src/ccore/CMakeLists.txt index fda081a2..12e2d33a 100644 --- a/crlcore/src/ccore/CMakeLists.txt +++ b/crlcore/src/ccore/CMakeLists.txt @@ -31,7 +31,7 @@ ${CIF_INCLUDE_DIR} ${CONFIGURATION_INCLUDE_DIR} ${PYTHON_INCLUDE_PATH} - ${Boost_INCLUDE_DIRS} + ${Boost_INCLUDE_DIR} ) add_definitions ( -DCORIOLIS_TOP="${CORIOLIS_TOP}" diff --git a/crlcore/src/ccore/Utilities.cpp b/crlcore/src/ccore/Utilities.cpp index 08d08e1d..906661d3 100644 --- a/crlcore/src/ccore/Utilities.cpp +++ b/crlcore/src/ccore/Utilities.cpp @@ -61,6 +61,13 @@ namespace { } + void bugChanged ( Cfg::Parameter* p ) + { + if ( p->asBool() ) mstream::enable ( mstream::Bug ); + else mstream::disable ( mstream::Bug ); + } + + void catchCoreChanged ( Cfg::Parameter* p ) { System::setCatchCore ( p->asBool() ); @@ -110,6 +117,7 @@ mstream cmess0 ( mstream::Verbose0, std::cout ); mstream cmess1 ( mstream::Verbose1, std::cout ); mstream cmess2 ( mstream::Verbose2, std::cout ); mstream cinfo ( mstream::Info , std::cout ); +mstream cbug ( mstream::Bug , std::cout ); // ------------------------------------------------------------------- @@ -291,11 +299,14 @@ namespace CRL { // Early setting of python pathes to be able to execute configuration scripts. bfs::path pythonSitePackages = PYTHON_SITE_PACKAGES; pythonSitePackages = arguments["coriolis_top"].as() / pythonSitePackages; + _pathes.insert ( make_pair("pythonSitePackages",pythonSitePackages.string()) ); + bfs::path crlcoreDir = pythonSitePackages / "crlcore"; bfs::path stratusDir = pythonSitePackages / "stratus"; bfs::path cumulusDir = pythonSitePackages / "cumulus"; Isobar::Script::addPath ( sysConfDir.string() ); Isobar::Script::addPath ( pythonSitePackages.string() ); + Isobar::Script::addPath ( crlcoreDir.string() ); Isobar::Script::addPath ( stratusDir.string() ); Isobar::Script::addPath ( cumulusDir.string() ); @@ -306,6 +317,7 @@ namespace CRL { Cfg::getParamBool ("misc.verboseLevel1" ,true )->registerCb ( verboseLevel1Changed ); Cfg::getParamBool ("misc.verboseLevel2" ,true )->registerCb ( verboseLevel2Changed ); Cfg::getParamBool ("misc.info" ,false)->registerCb ( infoChanged ); + Cfg::getParamBool ("misc.bug" ,false)->registerCb ( bugChanged ); Cfg::getParamBool ("misc.logMode" ,false)->registerCb ( logModeChanged ); Cfg::getParamInt ("misc.traceLevel" ,1000 )->registerCb ( traceLevelChanged ); Cfg::getParamString("stratus1.mappingName","./stratus2sxlib.xml")->registerCb ( stratus1MappingNameChanged ); @@ -315,6 +327,7 @@ namespace CRL { verboseLevel1Changed ( Cfg::getParamBool("misc.verboseLevel1") ); verboseLevel2Changed ( Cfg::getParamBool("misc.verboseLevel2") ); infoChanged ( Cfg::getParamBool("misc.info" ) ); + bugChanged ( Cfg::getParamBool("misc.bug" ) ); logModeChanged ( Cfg::getParamBool("misc.logMode" ) ); traceLevelChanged ( Cfg::getParamInt ("misc.traceLevel" ) ); @@ -406,8 +419,9 @@ namespace CRL { void System::_runPythonInit () { - Cfg::Configuration* conf = Cfg::Configuration::get (); - bfs::path sysConfDir = getPath("etc"); + Cfg::Configuration* conf = Cfg::Configuration::get (); + bfs::path sysConfDir = getPath("etc"); + bfs::path pythonSitePackages = getPath("pythonSitePackages"); #if XML_NOT_DISABLED bool systemConfFound = false; @@ -422,11 +436,11 @@ namespace CRL { #endif bool systemConfFound = false; - bfs::path systemConfFile = sysConfDir / "coriolisInit.py"; + bfs::path systemConfFile = pythonSitePackages / "crlcore" / "coriolisInit.py"; if ( bfs::exists(systemConfFile) ) { systemConfFound = true; - cout << " o Reading python dot configuration:" << endl; - cout << " - <" << systemConfFile.string() << ">." << endl; + //cout << " o Reading python dot configuration:" << endl; + //cout << " - <" << systemConfFile.string() << ">." << endl; Isobar::Script* systemScript = Isobar::Script::create(systemConfFile.stem()); systemScript->runFunction("coriolisConfigure",NULL,Isobar::Script::NoScriptArgs); diff --git a/crlcore/src/ccore/alliance/ap/ApDriver.cpp b/crlcore/src/ccore/alliance/ap/ApDriver.cpp index 3df0ab6c..e0529333 100644 --- a/crlcore/src/ccore/alliance/ap/ApDriver.cpp +++ b/crlcore/src/ccore/alliance/ap/ApDriver.cpp @@ -2,14 +2,9 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | C O R I O L I S | // | Alliance / Hurricane Interface | // | | @@ -17,10 +12,7 @@ // | E-mail : Christophe.Alexandre@asim.lip6.fr | // | =============================================================== | // | C++ Header : "./ParsersDrivers.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #include @@ -40,6 +32,7 @@ using namespace std; #include "hurricane/Warning.h" #include "Ap.h" +#include "crlcore/Catalog.h" namespace { @@ -452,6 +445,7 @@ void apDriver( const string cellPath, Cell *cell, unsigned int &saveState) { DumpReference(ccell, cell); ccell << "EOF" << endl; ccell.close (); + CRL::CatalogExtension::setPhysical(cell, true); } } diff --git a/crlcore/src/ccore/alliance/ap/ApParser.cpp b/crlcore/src/ccore/alliance/ap/ApParser.cpp index ada9d7c0..1962183f 100644 --- a/crlcore/src/ccore/alliance/ap/ApParser.cpp +++ b/crlcore/src/ccore/alliance/ap/ApParser.cpp @@ -1,40 +1,8 @@ // -*- C++ -*- // -// This file is part of the Coriolis Project. -// Copyright (C) Laboratoire LIP6 - Departement ASIM -// Universite Pierre et Marie Curie -// -// Main contributors : -// Christophe Alexandre -// Sophie Belloeil -// Hugo Clément -// Jean-Paul Chaput -// Damien Dupuis -// Christian Masson -// Marek Sroka -// -// The Coriolis Project is free software; you can redistribute it -// and/or modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 of -// the License, or (at your option) any later version. -// -// The Coriolis Project is distributed in the hope that it will be -// useful, but WITHOUT ANY WARRANTY; without even the implied warranty -// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with the Coriolis Project; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA -// -// License-Tag -// Authors-Tag -// -// =================================================================== -// -// $Id$ +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -44,9 +12,6 @@ // | E-mail : Christian.Masson@lip6.fr | // | =============================================================== | // | C++ Module : "./ApParser.cpp" | -// | | -// | 05/06/2008 - Jean-Paul Chaput | -// | Complete rewrite & simplification. | // +-----------------------------------------------------------------+ diff --git a/crlcore/src/ccore/alliance/vst/VstDriver.cpp b/crlcore/src/ccore/alliance/vst/VstDriver.cpp index cdec8351..46fbd84d 100644 --- a/crlcore/src/ccore/alliance/vst/VstDriver.cpp +++ b/crlcore/src/ccore/alliance/vst/VstDriver.cpp @@ -312,9 +312,9 @@ void DumpPortList(ofstream &ccell, Cell* cell) + ": " + getNetDirection(net1) + vectorType - + index1StringStream.str() - + " to " + index2StringStream.str() + + " downto " + + index1StringStream.str() + ")" + busType); } @@ -400,9 +400,9 @@ void DumpSignalList(ofstream &ccell, Cell* cell) << name << string(biggestName - name.size() + 1, ' ') << ": bit_vector(" - << index1StringStream.str() - << " to " << index2StringStream.str() + << " downto " + << index1StringStream.str() << ");" << endl; } @@ -552,7 +552,7 @@ void DumpConnectionList(ofstream &ccell, Instance*instance) if (vectorFound) { - if (index2 < index1) + if (index2 > index1) reverse(plugConnectedVector.begin(), plugConnectedVector.end()); string connections; PlugVector::const_iterator pvit = plugConnectedVector.begin(); diff --git a/crlcore/src/ccore/crlcore/Utilities.h b/crlcore/src/ccore/crlcore/Utilities.h index af01db7a..940b375c 100644 --- a/crlcore/src/ccore/crlcore/Utilities.h +++ b/crlcore/src/ccore/crlcore/Utilities.h @@ -265,6 +265,7 @@ inline std::string tty::bgcolor ( unsigned int mask ) , Verbose1 = (1<<1) , Verbose2 = (1<<2) , Info = (1<<3) + , Bug = (1<<4) , VerboseLevel0 = Verbose0 , VerboseLevel1 = Verbose0|Verbose1 , VerboseLevel2 = Verbose0|Verbose1|Verbose2 @@ -343,6 +344,7 @@ extern mstream cmess0; extern mstream cmess1; extern mstream cmess2; extern mstream cinfo; +extern mstream cbug; // ------------------------------------------------------------------- diff --git a/crlcore/src/ccore/toolbox/ToolBox.cpp b/crlcore/src/ccore/toolbox/ToolBox.cpp index 9a909fb8..d3f94173 100644 --- a/crlcore/src/ccore/toolbox/ToolBox.cpp +++ b/crlcore/src/ccore/toolbox/ToolBox.cpp @@ -4,10 +4,6 @@ // This file is part of the Coriolis Software. // Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved // -// =================================================================== -// -// $Id$ -// // +-----------------------------------------------------------------+ // | C O R I O L I S | // | Alliance / Hurricane Interface | diff --git a/crlcore/src/crlcore/CMakeLists.txt b/crlcore/src/crlcore/CMakeLists.txt new file mode 100644 index 00000000..b4e2dd88 --- /dev/null +++ b/crlcore/src/crlcore/CMakeLists.txt @@ -0,0 +1,10 @@ + + install ( FILES coriolisInit.py DESTINATION ${PYTHON_SITE_PACKAGES}/crlcore ) + install ( FILES helpers/__init__.py DESTINATION ${PYTHON_SITE_PACKAGES}/crlcore/helpers ) + install ( FILES helpers/Configuration.py DESTINATION ${PYTHON_SITE_PACKAGES}/crlcore/helpers ) + install ( FILES helpers/Alliance.py DESTINATION ${PYTHON_SITE_PACKAGES}/crlcore/helpers ) + install ( FILES helpers/Display.py DESTINATION ${PYTHON_SITE_PACKAGES}/crlcore/helpers ) + install ( FILES helpers/Patterns.py DESTINATION ${PYTHON_SITE_PACKAGES}/crlcore/helpers ) + install ( FILES helpers/SymbolicTechnology.py DESTINATION ${PYTHON_SITE_PACKAGES}/crlcore/helpers ) + install ( FILES helpers/RealTechnology.py DESTINATION ${PYTHON_SITE_PACKAGES}/crlcore/helpers ) + install ( FILES helpers/Debug.py DESTINATION ${PYTHON_SITE_PACKAGES}/crlcore/helpers ) diff --git a/crlcore/etc/coriolisInit.py b/crlcore/src/crlcore/coriolisInit.py similarity index 100% rename from crlcore/etc/coriolisInit.py rename to crlcore/src/crlcore/coriolisInit.py diff --git a/crlcore/etc/helpers/Alliance.py b/crlcore/src/crlcore/helpers/Alliance.py similarity index 82% rename from crlcore/etc/helpers/Alliance.py rename to crlcore/src/crlcore/helpers/Alliance.py index 41c236c2..7a508fdb 100644 --- a/crlcore/etc/helpers/Alliance.py +++ b/crlcore/src/crlcore/helpers/Alliance.py @@ -43,10 +43,10 @@ def _loadAllianceConfig ( af, allianceConfig ): try: if len(entry) != 2: - raise ErrorMessage(['Malformed entry in .' - ,'Must have exactly two fields ("key", ).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Must have exactly two fields ("key", ).' + ,str(entry) + ]) key, value = entry if key == 'SYMBOLIC_TECHNOLOGY': env.setSYMBOLIC_TECHNOLOGY(value) @@ -66,10 +66,10 @@ def _loadAllianceConfig ( af, allianceConfig ): if key == 'SYSTEM_LIBRARY': for libraryEntry in value: if len(libraryEntry) != 2: - raise ErrorMessage(['Malformed system library entry in .' - ,'Must have exactly two fields ("path", ).' - ,str(libraryEntry) - ]) + raise ErrorMessage(1,['Malformed system library entry in .' + ,'Must have exactly two fields ("path", ).' + ,str(libraryEntry) + ]) libPath, mode = libraryEntry env.addSYSTEM_LIBRARY(library=libPath,mode=mode) @@ -101,16 +101,16 @@ def loadRoutingGaugesTable ( routingGaugesTable, fromFile ): try: if len(entry) != 2: - raise ErrorMessage(['Malformed entry in .' % gaugeName - ,'Must have exactly two fields ("METAL_LAYER", (parameters_list)).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' % gaugeName + ,'Must have exactly two fields ("METAL_LAYER", (parameters_list)).' + ,str(entry) + ]) if len(entry[1]) != 8: - raise ErrorMessage(['Malformed entry in .' % gaugeName - ,'Parameters list must have exactly eight fields:' - ,' (direction, type, depth, density, offset, pitch, wire_width, via_width)' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' % gaugeName + ,'Parameters list must have exactly eight fields:' + ,' (direction, type, depth, density, offset, pitch, wire_width, via_width)' + ,str(entry) + ]) gauge.addLayerGauge( RoutingLayerGauge.create( technology.getLayer(entry[0]) , entry[1][0] # Direction. @@ -142,7 +142,7 @@ def loadCellGaugesTable ( cellGaugesTable, fromFile ): try: if len(gaugeDatas) != 4: - raise ErrorMessage(['Malformed gaugeDatas in .' % gaugeName + raise ErrorMessage(1,['Malformed gaugeDatas in .' % gaugeName ,'Parameters list must have exactly four fields:' ,' (terminal_metal, xy_common_pitch, slice_height, slice_step)' ,str(gaugeDatas) diff --git a/crlcore/etc/helpers/Configuration.py b/crlcore/src/crlcore/helpers/Configuration.py similarity index 71% rename from crlcore/etc/helpers/Configuration.py rename to crlcore/src/crlcore/helpers/Configuration.py index cc4ba959..ef5de2ee 100644 --- a/crlcore/etc/helpers/Configuration.py +++ b/crlcore/src/crlcore/helpers/Configuration.py @@ -75,20 +75,20 @@ def loadParameters ( parametersData, fromFile ): try: if len(entry) < 3: - raise ErrorMessage(['Malformed entry in .' - ,'Less than three fields: (path_name, Type, default_value [,options]).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Less than three fields: (path_name, Type, default_value [,options]).' + ,str(entry) + ]) if len(entry) == 3: pathName, paramType, value = entry options = None elif len(entry) == 4: pathName, paramType, value, options = entry else: - raise ErrorMessage(['Malformed entry in .' - ,'More than four fields: (path_name, Type, default_value [,options]).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'More than four fields: (path_name, Type, default_value [,options]).' + ,str(entry) + ]) if paramType == TypeBool: param = Cfg.getParamBool(pathName) @@ -140,53 +140,53 @@ def loadLayout ( layoutData, fromFile ): try: if not isinstance(entry,tuple): - raise ErrorMessage(['Malformed entry in .' - ,'Not a tuple (a, b, c, ...) or (a,).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Not a tuple (a, b, c, ...) or (a,).' + ,str(entry) + ]) if entry[0] == TypeTab: if len(entry) != 3: - raise ErrorMessage(['Malformed entry in .' - ,'Tab must have exactly three fields: (TypeTab, tab_name, tag).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Tab must have exactly three fields: (TypeTab, tab_name, tag).' + ,str(entry) + ]) layoutType, tabName, tagName = entry layout.addTab ( tabName, tagName ) if not tabName: - raise ErrorMessage(['Bad entry order in .' - ,'First entry must be of Tab type.' - ]) + raise ErrorMessage(1,['Bad entry order in .' + ,'First entry must be of Tab type.' + ]) if entry[0] == TypeTitle: if len(entry) != 2: - raise ErrorMessage(['Malformed entry in .' - ,'Title must have exactly two fields: (TypeTitle, title).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Title must have exactly two fields: (TypeTitle, title).' + ,str(entry) + ]) layoutType, title = entry layout.addTitle ( tabName, title ) elif entry[0] == TypeSection: if len(entry) != 3: - raise ErrorMessage(['Malformed entry in .' - ,'Section must have exactly three fields: (TypeSection, section, column).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Section must have exactly three fields: (TypeSection, section, column).' + ,str(entry) + ]) layoutType, section, column = entry layout.addSection ( tabName, section, column ) elif entry[0] == TypeRule: if len(entry) != 1: - raise ErrorMessage(['Malformed entry in .' - ,'Rule must have exactly one fields: (TypeRule,).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Rule must have exactly one fields: (TypeRule,).' + ,str(entry) + ]) layout.addRule ( tabName ) elif entry[0] == TypeOption: if len(entry) < 4: - raise ErrorMessage(['Malformed entry in .' - ,'Option must have at least four fields: (TypeOption,path_name,text,column[,span,flags]).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Option must have at least four fields: (TypeOption,path_name,text,column[,span,flags]).' + ,str(entry) + ]) if len(entry) == 4: layoutType, pathName, text, column = entry layout.addParameter ( tabName, pathName, text, column ) diff --git a/crlcore/etc/helpers/Debug.py b/crlcore/src/crlcore/helpers/Debug.py similarity index 100% rename from crlcore/etc/helpers/Debug.py rename to crlcore/src/crlcore/helpers/Debug.py diff --git a/crlcore/etc/helpers/Display.py b/crlcore/src/crlcore/helpers/Display.py similarity index 73% rename from crlcore/etc/helpers/Display.py rename to crlcore/src/crlcore/helpers/Display.py index 9324ea89..2e413e82 100644 --- a/crlcore/etc/helpers/Display.py +++ b/crlcore/src/crlcore/helpers/Display.py @@ -41,7 +41,7 @@ def checkAttribute ( options, attribute, goodType ): if goodType == float and isinstance(options[attribute],int): return True if not isinstance(options[attribute],goodType): - raise ErrorMessage( + raise ErrorMessage( 1, ['The <%s> attribute of Drawing must be %s, not %s.' \ % (attribute,str(goodType).split("'")[1],helpers.stype(options[attribute])) ,str(options[attribute])]) @@ -50,7 +50,7 @@ def checkAttribute ( options, attribute, goodType ): def checkColor ( color ): if not isinstance(color,str): - raise ErrorMessage( + raise ErrorMessage( 1, ['The attribute of Drawing must be str, not %s.' % (helpers.stype(color)) ,str(options[attribute])]) @@ -61,11 +61,11 @@ def checkColor ( color ): if color[0] == '#': for digit in color[1:]: if not digit in string.hexdigits: - raise ErrorMessage( + raise ErrorMessage( 1, ['Non-hexadecimal digit \'%c\' in attribute of Drawing.' % digit ,color]) if len(color) != 7: - raise ErrorMessage( + raise ErrorMessage( 1, [' attribute of Drawing do not have exactly six digits.' % digit ,color]) return color @@ -73,19 +73,19 @@ def checkColor ( color ): # Try a RGB tuple (R,G,B). rgb = color.split(',') if len(rgb) != 3: - raise ErrorMessage( + raise ErrorMessage( 1, [' attribute of Drawing is neither hexa nor RGB nor predefined.' ,color]) for component in rgb: for digit in component: if not digit in string.digits: - raise ErrorMessage( + raise ErrorMessage( 1, ['Bad RGB component \'%s\' of Drawing, not an integer.' % component ,color]) value = int(component) if value < 0 or value > 255: - raise ErrorMessage( + raise ErrorMessage( 1, ['Bad RGB component \'%s\' of Drawing, not between 0 and 255.' % component ,color]) return color @@ -136,74 +136,74 @@ def loadStyleTuple ( styleTuple ): try: if styleEntry[0] == Style: if len(styleEntry) != 3: - raise ErrorMessage(['Malformed entry in .' - ,'Style must have exactly three fields: (Style,id,description).' - ,str(styleEntry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Style must have exactly three fields: (Style,id,description).' + ,str(styleEntry) + ]) styleType, styleId, description = styleEntry if not isinstance(styleId,str): - raise ErrorMessage(['The second Style field, must be a string, not a %s.' % helpers.stype(styleId) - ,str(styleEntry)]) + raise ErrorMessage(1,['The second Style field, must be a string, not a %s.' % helpers.stype(styleId) + ,str(styleEntry)]) if not isinstance(description,str): - raise ErrorMessage(['The third Style field, must be a string, not a %s.' % helpers.stype(styleId) - ,str(styleEntry)]) + raise ErrorMessage(1,['The third Style field, must be a string, not a %s.' % helpers.stype(styleId) + ,str(styleEntry)]) style = Viewer.DisplayStyle(styleId) style.setDescription(description) if not style: - raise ErrorMessage(['Bad entry order in .' - ,'First entry must be of Style type.' - ]) + raise ErrorMessage(1,['Bad entry order in .' + ,'First entry must be of Style type.' + ]) if styleEntry[0] == Inherit: if len(styleEntry) != 2: - raise ErrorMessage(['Malformed entry in .' - ,'Inherit must have exactly two fields: (Inherit,id).' - ,str(styleEntry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Inherit must have exactly two fields: (Inherit,id).' + ,str(styleEntry) + ]) styleType, styleId = styleEntry if not isinstance(styleId,str): - raise ErrorMessage(['The second Inherit field, must be a string, not a %s.' % helpers.stype(styleId) - ,str(styleEntry)]) + raise ErrorMessage(1,['The second Inherit field, must be a string, not a %s.' % helpers.stype(styleId) + ,str(styleEntry)]) style.inheritFrom(styleId) if styleEntry[0] == Darkening: if len(styleEntry) != 4: - raise ErrorMessage(['Malformed entry in .' - ,'Darkening (HSV color) must have exactly four fields: (Darkening,hue,value,saturation).' - ,str(styleEntry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Darkening (HSV color) must have exactly four fields: (Darkening,hue,value,saturation).' + ,str(styleEntry) + ]) styleType, hue, value, saturation = styleEntry if not isinstance(hue ,float) or \ not isinstance(value ,float) or \ not isinstance(saturation,float) : - raise ErrorMessage([', & fields of Darkening must be floats.' - ,'%s is (Type, %s, %s, %s)' % (str(styleEntry) - ,helpers.stype(hue) - ,helpers.stype(value) - ,helpers.stype(saturation)) - ]) + raise ErrorMessage(1,[', & fields of Darkening must be floats.' + ,'%s is (Type, %s, %s, %s)' % (str(styleEntry) + ,helpers.stype(hue) + ,helpers.stype(value) + ,helpers.stype(saturation)) + ]) style.setDarkening(Viewer.DisplayStyle.HSVr( hue, value, saturation )) elif styleEntry[0] == Group: if len(styleEntry) != 2: - raise ErrorMessage(['Malformed entry in .' - ,'Group must have exactly two fields: (Group,group).' - ,str(styleEntry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Group must have exactly two fields: (Group,group).' + ,str(styleEntry) + ]) styleType, group = styleEntry if not isinstance(group,str): - raise ErrorMessage(['The second Group field, must be a string, not a %s.' % helpers.stype(group) - ,str(styleEntry)]) + raise ErrorMessage(1,['The second Group field, must be a string, not a %s.' % helpers.stype(group) + ,str(styleEntry)]) elif styleEntry[0] == Drawing: if len(styleEntry) != 3: - raise ErrorMessage(['Malformed entry in .' - ,'Rule must have exactly three fields: (Drawing,dname,{dict}).' - ,str(styleEntry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Rule must have exactly three fields: (Drawing,dname,{dict}).' + ,str(styleEntry) + ]) styleType, name, options = styleEntry arguments = { 'group':group, 'name':name } for key in options.keys(): @@ -247,9 +247,9 @@ def loadStyles ( stylesTable, fromFile ): try: # Check for three levels of tuple for a correct . if not isinstance(stylesTable,tuple): - raise ErrorMessage(['Malformed , not even a one level deep tuple.']) + raise ErrorMessage(1,['Malformed , not even a one level deep tuple.']) if not isinstance(stylesTable[0],tuple): - raise ErrorMessage(['Malformed , only two level deep tuple.']) + raise ErrorMessage(1,['Malformed , only two level deep tuple.']) for styleTuple in stylesTable: loadStyleTuple( styleTuple ) diff --git a/crlcore/etc/helpers/Patterns.py b/crlcore/src/crlcore/helpers/Patterns.py similarity index 98% rename from crlcore/etc/helpers/Patterns.py rename to crlcore/src/crlcore/helpers/Patterns.py index d24cb8b5..f7fd297e 100755 --- a/crlcore/etc/helpers/Patterns.py +++ b/crlcore/src/crlcore/helpers/Patterns.py @@ -95,8 +95,8 @@ class Pattern ( object ): self._side = math.sqrt(4*len(self._hexa)) if pow(self._side,2) != 4*len(self._hexa): - raise ErrorMessage( 'The pattern is not square (%d bits).' - % (4*len(self._hexa)) ) + raise ErrorMessage( 1, 'The pattern is not square (%d bits).' + % (4*len(self._hexa)) ) return self._fromHexa() @@ -108,8 +108,8 @@ class Pattern ( object ): for line in bits: if self._side != len(line): - raise ErrorMessage( 'The pattern is not square (%dx%d bits).' - % (len(line),len(self._bits)) ) + raise ErrorMessage( 1, 'The pattern is not square (%dx%d bits).' + % (len(line),len(self._bits)) ) self._toHexa() return @@ -149,16 +149,16 @@ def loadPatterns ( patternsData, fromFile ): try: if not isinstance(entry,dict): - raise ErrorMessage(['Malformed entry in .' - ,'Not a dictionary {\'key1\':\'value1\', ...}.' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Not a dictionary {\'key1\':\'value1\', ...}.' + ,str(entry) + ]) if not entry.has_key('name'): - raise ErrorMessage(['Malformed entry in .' - ,'Pattern has no \'name\' key.' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Pattern has no \'name\' key.' + ,str(entry) + ]) arguments = { 'name':entry['name'] } if entry.has_key('bits'): diff --git a/crlcore/etc/helpers/RealTechnology.py b/crlcore/src/crlcore/helpers/RealTechnology.py similarity index 65% rename from crlcore/etc/helpers/RealTechnology.py rename to crlcore/src/crlcore/helpers/RealTechnology.py index 8fd61a95..c2bb6bf6 100644 --- a/crlcore/etc/helpers/RealTechnology.py +++ b/crlcore/src/crlcore/helpers/RealTechnology.py @@ -21,25 +21,25 @@ def loadRealLayers ( technology, basicLayersData ): try: if len(entry) != 3: - raise ErrorMessage(['Malformed entry in .' - ,'Must have exactly three fields: (symb_name,real_name,GDSII_extnb).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Must have exactly three fields: (symb_name,real_name,GDSII_extnb).' + ,str(entry) + ]) symbName, realName, gdsiiExtractNumber = entry if not isinstance(gdsiiExtractNumber,int): - raise ErrorMessage(['Incoherency in entry.' - ,'GDSII exctract number is not of int type (%s).' \ - % helpers.stype(gdsiiExtractNumber) - ,str(entry) - ]) + raise ErrorMessage(1,['Incoherency in entry.' + ,'GDSII exctract number is not of int type (%s).' \ + % helpers.stype(gdsiiExtractNumber) + ,str(entry) + ]) basicLayer = technology.getBasicLayer(symbName) if not basicLayer: - raise ErrorMessage(['Incoherency in entry.' - ,'The real layer "%s" associated to the GDSII "%s" do not exists.' \ - % (symbName,realName) - ,str(entry) - ]) + raise ErrorMessage(1,['Incoherency in entry.' + ,'The real layer "%s" associated to the GDSII "%s" do not exists.' \ + % (symbName,realName) + ,str(entry) + ]) basicLayer.setRealName ( realName ) basicLayer.setExtractNumber( gdsiiExtractNumber ) @@ -62,26 +62,26 @@ def loadTechnoConfig ( technology, technoConfig ): gridUnit != DbU.UnitPowerMilli and \ gridUnit != DbU.UnitPowerUnity and \ gridUnit != DbU.UnitPowerKilo: - raise ErrorMessage('In , invalid DbU unit power for gridUnit, reseting to Micro.') + raise ErrorMessage(1,'In , invalid DbU unit power for gridUnit, reseting to Micro.') else: - raise ErrorMessage(' has no defined, assuming Micro.') + raise ErrorMessage(1,' has no defined, assuming Micro.') elif key == 'gridValue': if technoConfig.has_key('gridValue'): gridValue = technoConfig['gridValue'] if not isinstance(gridUnit,float) and not isinstance(gridUnit,int): - raise ErrorMessage(['In , must be of type float (and not: %s).' - % helpers.stype(gridValue) - ]) + raise ErrorMessage(1,['In , must be of type float (and not: %s).' + % helpers.stype(gridValue) + ]) DbU.setPhysicalsPerGrid(gridValue,gridUnit) else: - raise ErrorMessage(' has no defined.') + raise ErrorMessage(1,' has no defined.') elif key == 'gridsPerLambda': if technoConfig.has_key('gridsPerLambda'): gridsPerLambda = technoConfig['gridsPerLambda'] if not isinstance(gridsPerLambda,int): - raise ErrorMessage(['In , must be of type int (and not: %s).' + raise ErrorMessage(1,['In , must be of type int (and not: %s).' % helpers.stype(gridsPerLambda) ]) DbU.setGridsPerLambda(gridsPerLambda) diff --git a/crlcore/etc/helpers/SymbolicTechnology.py b/crlcore/src/crlcore/helpers/SymbolicTechnology.py similarity index 70% rename from crlcore/etc/helpers/SymbolicTechnology.py rename to crlcore/src/crlcore/helpers/SymbolicTechnology.py index 264e867b..3e777978 100644 --- a/crlcore/etc/helpers/SymbolicTechnology.py +++ b/crlcore/src/crlcore/helpers/SymbolicTechnology.py @@ -86,7 +86,7 @@ class LayersLUT ( object ): layer = self._symbolicLayers[name] if not layer and flags&LayersLUT.MissingError: - raise ErrorMessage(['Layer <%s> is not defined (yet?).'%name]) + raise ErrorMessage(1,['Layer <%s> is not defined (yet?).'%name]) return layer @@ -101,22 +101,22 @@ def loadRealLayers ( technology, basicLayersData ): try: if len(entry) < 2: - raise ErrorMessage(['Malformed entry in .' - ,'Less than two fields: missing name and/or material.' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Less than two fields: missing name and/or material.' + ,str(entry) + ]) if len(entry) > 2: if entry[1] != BasicLayer.Material.blockage: - raise ErrorMessage(['Invalid entry in .' - ,'Only blockage material can have a third field.' - ,str(entry) - ]) + raise ErrorMessage(1,['Invalid entry in .' + ,'Only blockage material can have a third field.' + ,str(entry) + ]) routingLayer = technology.getBasicLayer(entry[2]) if not routingLayer: - raise ErrorMessage(['Incoherency in entry at.' - ,'The metal <%s> associated to the blockage doesn\'t exist (yet?).' % entry[2] - ,str(entry) - ]) + raise ErrorMessage(1,['Incoherency in entry at.' + ,'The metal <%s> associated to the blockage doesn\'t exist (yet?).' % entry[2] + ,str(entry) + ]) basicLayer = BasicLayer.create( technology , entry[0] @@ -137,28 +137,28 @@ def loadSymbolicLayers ( technology, symbolicLayersData ): try: if len(entry) != 3: - raise ErrorMessage(['Malformed entry in .' - ,'Must contains exactly three fields: ( name, type, (real_layers,) ).' - ,str(entry) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Must contains exactly three fields: ( name, type, (real_layers,) ).' + ,str(entry) + ]) name, layerType, realLayers = entry if not isinstance(layerType,SymbolicLayerType): - raise ErrorMessage(['Invalid entry in .' - ,'The layer type code is not valid, should be any of:' - ,' * TypeRegular' - ,' * TypeDiffusion' - ,' * TypeTransistor' - ,' * TypeContact' - ,' * TypeVia' - ,str(entry) - ]) + raise ErrorMessage(1,['Invalid entry in .' + ,'The layer type code is not valid, should be any of:' + ,' * TypeRegular' + ,' * TypeDiffusion' + ,' * TypeTransistor' + ,' * TypeContact' + ,' * TypeVia' + ,str(entry) + ]) if layerType.realLayerLength() != len(realLayers): - raise ErrorMessage(['Invalid entry in .' - ,'Layer of type <%s> contains %d real layers instead of %d.' \ - % (layerType,len(realLayers),layerType.realLayerLength()) - ,str(entry) - ]) + raise ErrorMessage(1,['Invalid entry in .' + ,'Layer of type <%s> contains %d real layers instead of %d.' \ + % (layerType,len(realLayers),layerType.realLayerLength()) + ,str(entry) + ]) realLayersArgs = [] for layerName in realLayers: @@ -198,23 +198,23 @@ def loadSymbolicRules ( technology, symbolicRulesTable ): try: if len(rule) != 2: - raise ErrorMessage(['Malformed entry in .' - ,'Must contains exactly two fields: ( rule_path, value ).' - ,str(rule) - ]) + raise ErrorMessage(1,['Malformed entry in .' + ,'Must contains exactly two fields: ( rule_path, value ).' + ,str(rule) + ]) if not isinstance(rule[1],int) and not isinstance(rule[1],float): - raise ErrorMessage(['Invalid entry in .' - ,'Rule value must be of integer or float type.' - ,str(rule) - ]) + raise ErrorMessage(1,['Invalid entry in .' + ,'Rule value must be of integer or float type.' + ,str(rule) + ]) value = DbU.fromLambda(rule[1]) elements = rule[0].split('.') if len(elements) < 3: - raise ErrorMessage(['Invalid entry in .' - ,'Rule name must contains at least three components: \"LAYER.category.dimension\".' - ,str(rule) - ]) + raise ErrorMessage(1,['Invalid entry in .' + ,'Rule name must contains at least three components: \"LAYER.category.dimension\".' + ,str(rule) + ]) ruleLayer = layersLUT.lookup( elements[0], LayersLUT.Symbolic|LayersLUT.MissingError ) subLayer = layersLUT.lookup( elements[1], LayersLUT.Real ) @@ -228,15 +228,15 @@ def loadSymbolicRules ( technology, symbolicRulesTable ): elif ruleTag == 'minimum.width': ruleLayer.setMinimalSize ( value ) elif ruleTag == 'minimum.side': ruleLayer.setMinimalSize ( value ) else: - raise ErrorMessage(['Invalid entry in .' - ,'Unknown rule kind: \".%s\", should be any of:' % ruleTag - ,' * "RULE_HEAD.extention.cap"' - ,' * "RULE_HEAD.extention.width"' - ,' * "RULE_HEAD.enclosure"' - ,' * "RULE_HEAD.minimum.width"' - ,' * "RULE_HEAD.minimum.side"' - ,str(rule) - ]) + raise ErrorMessage(1,['Invalid entry in .' + ,'Unknown rule kind: \".%s\", should be any of:' % ruleTag + ,' * "RULE_HEAD.extention.cap"' + ,' * "RULE_HEAD.extention.width"' + ,' * "RULE_HEAD.enclosure"' + ,' * "RULE_HEAD.minimum.width"' + ,' * "RULE_HEAD.minimum.side"' + ,str(rule) + ]) except Exception, e: ErrorMessage.wrapPrint(e,'In %s: at index %d.' % (symbolicFile,entryNo)) diff --git a/crlcore/etc/helpers/__init__.py b/crlcore/src/crlcore/helpers/__init__.py similarity index 62% rename from crlcore/etc/helpers/__init__.py rename to crlcore/src/crlcore/helpers/__init__.py index 3af1ebd5..c126020a 100644 --- a/crlcore/etc/helpers/__init__.py +++ b/crlcore/src/crlcore/helpers/__init__.py @@ -8,11 +8,11 @@ import sys import os import os.path +import re import traceback import Hurricane - -sysConfDir = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-2]) +sysConfDir = None xmlCompatMode = False @@ -26,12 +26,21 @@ def truncPath ( path ): class ErrorMessage ( Exception ): - def __init__ ( self, message ): - self._errors = [] + def __init__ ( self, code, *arguments ): + self._code = code + self._errors = [ 'Malformed call to ErrorMessage()' + , '%s' % str(arguments) ] - if isinstance(message,Exception): - text = str(message).split('\n') + text = None + if len(arguments) == 1: + if isinstance(arguments[0],Exception): text = str(arguments[0]).split('\n') + else: + self._errors = arguments[0] + elif len(arguments) > 1: + text = list(arguments) + if text: + self._errors = [] while len(text[0]) == 0: del text[0] lstrip = 0 @@ -43,8 +52,6 @@ class ErrorMessage ( Exception ): self._errors += [ line[lstrip:] ] else: self._errors += [ line.lstrip() ] - else: - self._errors = message return def __str__ ( self ): @@ -68,15 +75,23 @@ class ErrorMessage ( Exception ): self._errors += [ message ] return + def terminate ( self ): + print self + sys.exit(self._code) + + def _getCode ( self ): return self._code + + code = property(_getCode) + @staticmethod def wrapPrint ( e, footer=None ): showTrace = False if not isinstance(e,ErrorMessage): if isinstance(e,Hurricane.ConstructorError) or \ isinstance(e,Hurricane.HurricaneError): - ewrap = ErrorMessage(e) + ewrap = ErrorMessage(1,e) else: - ewrap = ErrorMessage('An unmanaged Python exception occurred:') + ewrap = ErrorMessage(3,'An unmanaged Python exception occurred:') ewrap.addMessage(str(e)) showTrace = True else: @@ -103,3 +118,27 @@ class WarningMessage ( Exception ): else: formatted += " %s" % self._warnings[i] if i+1 < len(self._warnings): formatted += "\n" return formatted + + +for (modulePath,moduleLine,contextType,lineContent) in traceback.extract_stack(): + if modulePath.endswith('/coriolisInit.py'): + + reSysConfDir = re.compile(r'.*etc\/coriolis2') + print ' o Locating configuration directory:' + + for path in sys.path: + if reSysConfDir.match(path): + sysConfDir = path + print ' - <%s>' % sysConfDir + break + + if not sysConfDir: + coriolisTop = os.getenv('CORIOLIS_TOP') + if coriolisTop == '/usr': + sysConfDir = '/etc/coriolis2' + elif coriolisTop: + sysConfDir = os.path.join(coriolisTop,'/etc/coriolis2') + else: + raise ErrorMessage( 1, [ 'Cannot locate the directoty holding the configuration files.' + , 'The path is something ending by <.../etc/coriolis2>.'] ) + break diff --git a/crlcore/etc/helpers/display.py b/crlcore/src/crlcore/helpers/display.py similarity index 100% rename from crlcore/etc/helpers/display.py rename to crlcore/src/crlcore/helpers/display.py diff --git a/crlcore/etc/helpers/hMetis.py b/crlcore/src/crlcore/helpers/hMetis.py similarity index 100% rename from crlcore/etc/helpers/hMetis.py rename to crlcore/src/crlcore/helpers/hMetis.py diff --git a/crlcore/etc/helpers/kite.py b/crlcore/src/crlcore/helpers/kite.py similarity index 100% rename from crlcore/etc/helpers/kite.py rename to crlcore/src/crlcore/helpers/kite.py diff --git a/crlcore/etc/helpers/mauka.py b/crlcore/src/crlcore/helpers/mauka.py similarity index 100% rename from crlcore/etc/helpers/mauka.py rename to crlcore/src/crlcore/helpers/mauka.py diff --git a/crlcore/etc/helpers/misc.py b/crlcore/src/crlcore/helpers/misc.py similarity index 83% rename from crlcore/etc/helpers/misc.py rename to crlcore/src/crlcore/helpers/misc.py index 4823aaaf..75c1ba8b 100644 --- a/crlcore/etc/helpers/misc.py +++ b/crlcore/src/crlcore/helpers/misc.py @@ -6,6 +6,7 @@ print " - Loading Misc. configuration." # Misc. parameters. Cfg.getParamBool("misc.catchCore" ).setBool(False) Cfg.getParamBool("misc.info" ).setBool(True ) +Cfg.getParamBool("misc.bug" ).setBool(False) Cfg.getParamBool("misc.logMode" ).setBool(True ) Cfg.getParamBool("misc.verboseLevel1").setBool(True ) Cfg.getParamBool("misc.verboseLevel2").setBool(False) @@ -20,6 +21,7 @@ layout.addTitle ( "Misc.", "Miscellaneous" ) layout.addParameter ( "Misc.", "misc.catchCore" , "Catch Core Dumps", 1 ) layout.addParameter ( "Misc.", "misc.verboseLevel1", "Verbose" , 0 ) layout.addParameter ( "Misc.", "misc.verboseLevel2", "Very Verbose" , 0 ) -layout.addParameter ( "Misc.", "misc.info" , "Show Info" , 0 ) +layout.addParameter ( "Misc.", "misc.info" , "Show Infos" , 0 ) +layout.addParameter ( "Misc.", "misc.bug" , "Show Bugs" , 0 ) layout.addParameter ( "Misc.", "misc.logMode" , "Output is a TTY" , 0 ) layout.addParameter ( "Misc.", "misc.traceLevel" , "Trace Level" , 1 ) diff --git a/crlcore/etc/helpers/nimbus.py b/crlcore/src/crlcore/helpers/nimbus.py similarity index 100% rename from crlcore/etc/helpers/nimbus.py rename to crlcore/src/crlcore/helpers/nimbus.py diff --git a/crlcore/etc/helpers/stratus1.py b/crlcore/src/crlcore/helpers/stratus1.py similarity index 100% rename from crlcore/etc/helpers/stratus1.py rename to crlcore/src/crlcore/helpers/stratus1.py diff --git a/crlcore/src/cyclop/CMakeLists.txt b/crlcore/src/cyclop/CMakeLists.txt index 8c41910e..73b7ce58 100644 --- a/crlcore/src/cyclop/CMakeLists.txt +++ b/crlcore/src/cyclop/CMakeLists.txt @@ -2,7 +2,7 @@ include ( ${QT_USE_FILE} ) include_directories ( ${CRLCORE_SOURCE_DIR}/src/ccore ${HURRICANE_INCLUDE_DIR} - ${Boost_INCLUDE_DIRS} + ${Boost_INCLUDE_DIR} ) set ( mocincludes Cyclop.h @@ -34,6 +34,7 @@ ${PYTHON_LIBRARIES} -lutil ${LIBXML2_LIBRARIES} + ${LIBEXECINFO_LIBRARIES} ) install ( TARGETS cyclop DESTINATION bin ) diff --git a/crlcore/src/pyCRL/CMakeLists.txt b/crlcore/src/pyCRL/CMakeLists.txt index 0d34bebb..d183a4ff 100644 --- a/crlcore/src/pyCRL/CMakeLists.txt +++ b/crlcore/src/pyCRL/CMakeLists.txt @@ -18,6 +18,7 @@ ${CIF_INCLUDE_DIR} ${CONFIGURATION_INCLUDE_DIR} ${PYTHON_INCLUDE_PATH} + ${Boost_INCLUDE_DIR} ) add_definitions ( -DCORIOLIS_TOP="${CORIOLIS_TOP}" diff --git a/crlcore/src/x2y/CMakeLists.txt b/crlcore/src/x2y/CMakeLists.txt index 1277d054..4c11bee2 100644 --- a/crlcore/src/x2y/CMakeLists.txt +++ b/crlcore/src/x2y/CMakeLists.txt @@ -10,5 +10,7 @@ link_directories ( ${CRLCORE_BINARY_DIR}/src/ccore ) add_executable ( cx2y ${cpps} ) - target_link_libraries ( cx2y crlcore ) + target_link_libraries ( cx2y crlcore + ${LIBEXECINFO_LIBRARIES} + ) install ( TARGETS cx2y DESTINATION bin )
- -
  • STRATUS
    - Netlist Capture Language (Python) -
-
-
- + +
+
  • DpGen
    Stratus Extension for Data-Pathes
+
  • CrlCore
    + Coriolis Core, Interface Documentation +
- - +
  • Unicorn
    + Coriolis Main Application +
+
-