diff --git a/crlcore/etc/display.xml b/crlcore/etc/display.xml index 2d77c1bb..72579b15 100644 --- a/crlcore/etc/display.xml +++ b/crlcore/etc/display.xml @@ -28,7 +28,7 @@ - + @@ -251,5 +251,73 @@ + + Coriolis Look for Printers + 3.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crlcore/etc/technology.symbolic.xml b/crlcore/etc/technology.symbolic.xml index 92c0bd70..d62b5af2 100644 --- a/crlcore/etc/technology.symbolic.xml +++ b/crlcore/etc/technology.symbolic.xml @@ -183,7 +183,7 @@ - + @@ -257,11 +257,11 @@ - + - + - + diff --git a/crlcore/etc/tools.configuration.xml b/crlcore/etc/tools.configuration.xml index 3782a5e8..3f8937fc 100644 --- a/crlcore/etc/tools.configuration.xml +++ b/crlcore/etc/tools.configuration.xml @@ -2,10 +2,10 @@ - + - + @@ -132,7 +132,7 @@ - + diff --git a/crlcore/src/ccore/Environment.cpp b/crlcore/src/ccore/Environment.cpp index f553fbf9..2cee9ea8 100644 --- a/crlcore/src/ccore/Environment.cpp +++ b/crlcore/src/ccore/Environment.cpp @@ -535,6 +535,7 @@ namespace CRL { setGROUND ( "vss" ); setCLOCK ( "^ck$" ); setOBSTACLE ( "^obs$" ); + setPad ( "^.*_px$" ); _LIBRARIES.append ( "." ); @@ -548,6 +549,7 @@ namespace CRL { regfree ( &_GroundRegex ); regfree ( &_ClockRegex ); regfree ( &_ObstacleRegex ); + regfree ( &_padRegex ); } @@ -591,6 +593,12 @@ namespace CRL { } + bool Environment::isPad ( const char* name ) const + { + return regexec ( &_padRegex, name, 0, NULL, 0 ) == 0; + } + + void Environment::setPOWER ( const char* value ) { _POWER = value; @@ -619,6 +627,13 @@ namespace CRL { } + void Environment::setPad ( const char* value ) + { + _pad = value; + _setRegex ( &_padRegex , _pad , "Pad" ); + } + + string Environment::getPrint () const { ostringstream s; @@ -657,7 +672,9 @@ namespace CRL { << " - Power Signal := \"" << _POWER << "\"\n" << " - Ground Signal := \"" << _GROUND << "\"\n" << " - Clock Signal := \"" << _CLOCK << "\"\n" - << " - Obstacles := \"" << _OBSTACLE << "\"\n\n"; + << " - Obstacles := \"" << _OBSTACLE << "\"\n" + << " o Special Cells.\n" + << " - Pads := \"" << _pad << "\"\n\n"; return s.str(); } diff --git a/crlcore/src/ccore/Utilities.cpp b/crlcore/src/ccore/Utilities.cpp index dcc1da90..4f4a6eab 100644 --- a/crlcore/src/ccore/Utilities.cpp +++ b/crlcore/src/ccore/Utilities.cpp @@ -33,6 +33,7 @@ namespace boptions = boost::program_options; #include "vlsisapd/configuration/Configuration.h" +#include "hurricane/Backtrace.h" #include "hurricane/Warning.h" #include "hurricane/viewer/Script.h" #include "crlcore/Utilities.h" @@ -247,10 +248,19 @@ namespace CRL { if ( bfs::path::default_name_check_writable() ) bfs::path::default_name_check ( bfs::portable_posix_name ); + // Check for duplicated type_info initialization. + const boptions::variable_value& value = arguments["coriolis_top"]; + if ( value.value().type() != typeid(string) ) { + throw Error("type_info RTTI tree has been initialized twice.\n\n" + " This may be due to incorrect import of Python modules, please ensure\n" + " that the CRL module is always imported first." + ); + } + bfs::path sysConfDir ( SYS_CONF_DIR ); if ( not sysConfDir.has_root_path() ) { if ( arguments.count("coriolis_top") ) { - // const boptions::variable_value& value = arguments["coriolis_top"]; + const boptions::variable_value& value = arguments["coriolis_top"]; // cerr << "value:" // << " empty:" << boolalpha << value.empty() // << " defaulted:" << boolalpha << value.defaulted() @@ -283,7 +293,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.logMode" ,true )->registerCb ( logModeChanged ); + Cfg::getParamBool ("misc.logMode" ,false)->registerCb ( logModeChanged ); Cfg::getParamInt ("misc.traceLevel" ,1000 )->registerCb ( traceLevelChanged ); Cfg::getParamString("stratus1.mappingName","./stratus2sxlib.xml")->registerCb ( stratus1MappingNameChanged ); @@ -348,6 +358,7 @@ namespace CRL { void System::_trapSig ( int sig ) { cerr << "\n\n[CRL ERROR] System::_trapSig():\n" << endl; + cerr << "Program stack:\n" << Backtrace().textWhere() << endl; switch ( sig ) { case SIGINT: diff --git a/crlcore/src/ccore/alliance/ap/ApDriver.cpp b/crlcore/src/ccore/alliance/ap/ApDriver.cpp index 1e4b5f22..3df0ab6c 100644 --- a/crlcore/src/ccore/alliance/ap/ApDriver.cpp +++ b/crlcore/src/ccore/alliance/ap/ApDriver.cpp @@ -36,6 +36,7 @@ using namespace std; #include "hurricane/RoutingPad.h" #include "hurricane/Cell.h" #include "hurricane/Layer.h" +#include "hurricane/RegularLayer.h" #include "hurricane/Warning.h" #include "Ap.h" @@ -209,12 +210,16 @@ void DumpContacts(ofstream& ccell, Cell *cell) } else { + DbU::Unit expand = 0; + if ( not dynamic_cast(contact->getLayer()) ) + expand = DbU::lambda(1.0); + if (toMBKLayer(mbkLayer,contact->getLayer()->getName(),true)) ccell << "B " << toMBKlambda(contact->getX()) << "," << toMBKlambda(contact->getY()) << "," - << toMBKlambda(contact->getWidth()) << "," - << toMBKlambda(contact->getHeight()) << "," + << toMBKlambda(contact->getWidth () + expand) << "," + << toMBKlambda(contact->getHeight() + expand) << "," << mbkLayer << "," << toMBKName(contact->getNet()->getName()) << endl; @@ -260,6 +265,9 @@ void DumpContacts(ofstream& ccell, Cell *cell) } else continue; + const char* direction = "RIGHT"; + if ( (x1 == x2) and (y1 != y2) ) direction = "UP"; + if ( x1 > x2 ) swap ( x1, x2 ); if ( y1 > y2 ) swap ( y1, y2 ); @@ -270,8 +278,8 @@ void DumpContacts(ofstream& ccell, Cell *cell) << toMBKlambda(x2) << "," << toMBKlambda(y2) << "," << toMBKlambda(width) << "," - << toMBKName(component->getNet()->getName()) - << ",RIGHT," + << toMBKName(component->getNet()->getName()) << "," + << direction << "," << mbkLayer << endl; } diff --git a/crlcore/src/ccore/alliance/ap/ApParser.cpp b/crlcore/src/ccore/alliance/ap/ApParser.cpp index bce17885..37858e4a 100644 --- a/crlcore/src/ccore/alliance/ap/ApParser.cpp +++ b/crlcore/src/ccore/alliance/ap/ApParser.cpp @@ -59,6 +59,7 @@ #include #include "hurricane/DataBase.h" +#include "hurricane/RegularLayer.h" #include "hurricane/Technology.h" #include "hurricane/Pin.h" #include "hurricane/Contact.h" @@ -172,23 +173,30 @@ namespace { class ApParser { public: - // Methods. ApParser ( AllianceFramework* af ); void loadFromFile ( const string& cellPath, Cell* cell ); private: - // Internal: enum. - enum ParserState { StateVersion - , StateHeader - , StateBody - , StateEOF - }; - // Internal: static Attributes. + enum ParserState { StateVersion + , StateHeader + , StateBody + , StateEOF + }; + enum SegmentDirection { DirectionHorizontal=0x1 + , DirectionVertical =0x2 + , DirectionIncrease =0x4 + , DirectionDecrease =0x8 + , DirectionUndefined =0 + , DirectionUp =DirectionVertical |DirectionIncrease + , DirectionDown =DirectionVertical |DirectionDecrease + , DirectionLeft =DirectionHorizontal|DirectionDecrease + , DirectionRight =DirectionHorizontal|DirectionIncrease + }; static LayerInformations _layerInformations; - // Internal: Attributes. AllianceFramework* _framework; string _cellPath; Cell* _cell; + Catalog::State* _state; double _scaleRatio; unsigned int _anonymousId; int _parserState; @@ -204,6 +212,7 @@ namespace { Net* _getNet ( const char* apName ); Net* _getAnonymousNet (); Net* _safeGetNet ( const char* apName ); + SegmentDirection _getApSegDirection ( const char* segDir ); void _parseVersion (); void _parseHeader (); void _parseAbutmentBox (); @@ -222,13 +231,14 @@ namespace { ApParser::ApParser ( AllianceFramework* framework ) - : _framework(framework) - , _cellPath() - , _cell(NULL) - , _scaleRatio(100.0) + : _framework (framework) + , _cellPath () + , _cell (NULL) + , _state (NULL) + , _scaleRatio (100.0) , _anonymousId(0) , _parserState(StateVersion) - , _lineNumber(0) + , _lineNumber (0) { if ( _layerInformations.empty() ) { _layerInformations.setTechnology ( DataBase::getDB()->getTechnology() ); @@ -333,6 +343,19 @@ namespace { } + inline ApParser::SegmentDirection ApParser::_getApSegDirection ( const char* value ) + { + if ( *value == '\0' ) return DirectionUndefined; + + if ( string("UP" ).compare(value) == 0 ) return DirectionUp; + if ( string("DOWN" ).compare(value) == 0 ) return DirectionDown; + if ( string("LEFT" ).compare(value) == 0 ) return DirectionLeft; + if ( string("RIGHT").compare(value) == 0 ) return DirectionRight; + + return DirectionUndefined; + } + + Net* ApParser::_getNet ( const char* apName ) { string hName = apName; @@ -559,9 +582,14 @@ namespace { net = _safeGetNet ( fields[5] ); layerInfo = _getLayerInformation ( fields[4] ); - if ( layerInfo ) - Contact::create ( net, layerInfo->getLayer(), XVIA, YVIA, WIDTH, HEIGHT ); - else + + if ( layerInfo ) { + DbU::Unit shrink = 0; + if ( not dynamic_cast(layerInfo->getLayer()) ) + shrink = DbU::lambda(1.0); + + Contact::create ( net, layerInfo->getLayer(), XVIA, YVIA, WIDTH-shrink, HEIGHT-shrink ); + } else _printError ( false, "Unknown layer name %s.", fields[4] ); } } @@ -572,6 +600,7 @@ namespace { static DbU::Unit X1, Y1, X2, Y2, WIDTH; static Net* net; static LayerInformation* layerInfo; + static SegmentDirection segDir; vector fields = _splitString ( _rawLine+2, ',' ); if ( fields.size() < 8 ) @@ -583,20 +612,33 @@ namespace { Y2 = _getUnit ( fields[3] ); WIDTH = _getUnit ( fields[4] ); net = _safeGetNet ( fields[5] ); + segDir = _getApSegDirection ( fields[6] ); layerInfo = _getLayerInformation ( fields[7] ); if ( layerInfo ) { Segment* segment = NULL; - if ( X1 == X2 ) { - segment = Vertical::create ( net, layerInfo->getLayer(), X1, WIDTH, Y1, Y2 ); - } else if ( Y1 == Y2 ) { - segment = Horizontal::create ( net, layerInfo->getLayer(), Y1, WIDTH, X1, X2 ); - } else { - _printError ( false, "Segment neither horizontal nor vertical." ); + if ( (X1 == X2) and (Y1 == Y2) ) { + if ( segDir & DirectionVertical ) + segment = Vertical::create ( net, layerInfo->getLayer(), X1, WIDTH, Y1, Y2 ); + else + segment = Horizontal::create ( net, layerInfo->getLayer(), Y1, WIDTH, X1, X2 ); + } else { + if ( X1 == X2 ) { + segment = Vertical::create ( net, layerInfo->getLayer(), X1, WIDTH, Y1, Y2 ); + if ( segDir & DirectionHorizontal ) + _printWarning ( "Inconsistent direction on Horizontal segment (neither UP nor DOWN)." ); + } else if ( Y1 == Y2 ) { + segment = Horizontal::create ( net, layerInfo->getLayer(), Y1, WIDTH, X1, X2 ); + if ( segDir & DirectionVertical ) + _printWarning ( "Inconsistent direction on Horizontal segment (neither LEFT nor RIGHT)." ); + } else { + _printError ( false, "Segment neither horizontal nor vertical." ); + } } if ( layerInfo->isConnector()) { if ( not net->isExternal() ) { - _printWarning ( "External component on non-external net %s", getString(net->getName()).c_str() ); + if ( _state->isLogical() ) + _printWarning ( "External component on non-external net %s", getString(net->getName()).c_str() ); net->setExternal ( true ); } NetExternalComponents::setExternal(segment); @@ -624,6 +666,7 @@ namespace { static Name ROT_M = "ROT_M"; static Name SY_RM = "SY_RM"; static Name SY_RP = "SY_RP"; + static Name padreal = "padreal"; vector fields = _splitString ( _rawLine+2, ',' ); if ( fields.size() < 5 ) @@ -658,7 +701,7 @@ namespace { instance->setPlacementStatus ( Instance::PlacementStatus::FIXED ); } else { Catalog::State* instanceState = _framework->getCatalog()->getState ( masterCellName ); - if ( !instanceState || (!instanceState->isFeed()) ) { + if ( (masterCellName != padreal) and ( not instanceState or (not instanceState->isFeed()) ) ) { _printError ( false , "No logical instance associated to physical instance %s." , getString(instanceName).c_str() @@ -740,10 +783,9 @@ namespace { if ( catalogProperty == NULL ) throw Error ( "Missing CatalogProperty in cell %s.\n" , getString(cell->getName()).c_str() ); - Catalog::State *state = catalogProperty->getState (); - - state->setPhysical ( true ); - if ( state->isFlattenLeaf() ) _cell->setFlattenLeaf ( true ); + _state = catalogProperty->getState (); + _state->setPhysical ( true ); + if ( _state->isFlattenLeaf() ) _cell->setFlattenLeaf ( true ); IoFile fileStream ( cellPath ); fileStream.open ( "r" ); diff --git a/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy b/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy index e2af9ef8..5c1c1cf6 100644 --- a/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy +++ b/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy @@ -905,7 +905,8 @@ association_element ); for ( unsigned int i=0 ; i < __ys->_masterNets.size() ; i++ ) - if ( !__ys->_masterNets[i]->isGlobal() ) + if ( not __ys->_masterNets[i]->isGlobal() + or (__ys->_masterNets[i]->getName() != __ys->_instanceNets[i]->getName()) ) __ys->_instance->getPlug ( __ys->_masterNets[i] )->setNet ( __ys->_instanceNets[i] ); __ys->_masterPort = true; diff --git a/crlcore/src/ccore/crlcore/AllianceFramework.h b/crlcore/src/ccore/crlcore/AllianceFramework.h index 0e1f345f..49aa4112 100644 --- a/crlcore/src/ccore/crlcore/AllianceFramework.h +++ b/crlcore/src/ccore/crlcore/AllianceFramework.h @@ -29,7 +29,7 @@ #include #include - +#include "hurricane/Cell.h" #include "crlcore/Environment.h" #include "crlcore/AllianceLibrary.h" #include "crlcore/Catalog.h" @@ -38,7 +38,7 @@ namespace CRL { - + using Hurricane::Cell; class RoutingGauge; class CellGauge; @@ -68,6 +68,10 @@ namespace CRL { inline bool isOBSTACLE ( const char* name ); inline bool isOBSTACLE ( const string& name ); inline bool isOBSTACLE ( const Name& name ); + inline bool isPad ( const char* name ); + inline bool isPad ( const string& name ); + inline bool isPad ( const Name& name ); + inline bool isPad ( const Cell* ); // Accessors. inline Environment* getEnvironment (); inline Catalog* getCatalog (); @@ -138,6 +142,10 @@ namespace CRL { inline bool AllianceFramework::isOBSTACLE ( const char* name ) { return _environment.isOBSTACLE(name); } inline bool AllianceFramework::isOBSTACLE ( const string& name ) { return isOBSTACLE(name.c_str()); } inline bool AllianceFramework::isOBSTACLE ( const Name& name ) { return isOBSTACLE(getString(name)); } + inline bool AllianceFramework::isPad ( const char* name ) { return _environment.isPad(name); } + inline bool AllianceFramework::isPad ( const string& name ) { return isPad(name.c_str()); } + inline bool AllianceFramework::isPad ( const Name& name ) { return isPad(getString(name)); } + inline bool AllianceFramework::isPad ( const Cell* cell ) { return isPad(cell->getName()); } inline Environment* AllianceFramework::getEnvironment () { return &_environment; } inline Catalog* AllianceFramework::getCatalog () { return &_catalog; } inline const Name& AllianceFramework::getParentLibraryName diff --git a/crlcore/src/ccore/crlcore/Environment.h b/crlcore/src/ccore/crlcore/Environment.h index a4de9fb0..01012d64 100644 --- a/crlcore/src/ccore/crlcore/Environment.h +++ b/crlcore/src/ccore/crlcore/Environment.h @@ -62,6 +62,7 @@ namespace CRL { inline const std::string& getGROUND () const; inline const std::string& getCLOCK () const; inline const std::string& getOBSTACLE () const; + inline const std::string& getPad () const; inline const std::string& getCATALOG () const; inline SearchPath& getLIBRARIES (); @@ -70,6 +71,7 @@ namespace CRL { bool isGROUND ( const char* name ) const; bool isCLOCK ( const char* name ) const; bool isOBSTACLE ( const char* name ) const; + bool isPad ( const char* name ) const; // Modifiers. void loadFromXml ( const std::string& path="", bool warnNotFound=true ); @@ -87,6 +89,7 @@ namespace CRL { void setGROUND ( const char* value ); void setCLOCK ( const char* value ); void setOBSTACLE ( const char* value ); + void setPad ( const char* value ); inline void setCATALOG ( const char* value ); inline void setWORKING_LIBRARY ( const char* value ); void addSYSTEM_LIBRARY ( const char* value, unsigned int mode=Append ); @@ -110,12 +113,14 @@ namespace CRL { std::string _GROUND; std::string _CLOCK; std::string _OBSTACLE; + std::string _pad; std::string _CATALOG; SearchPath _LIBRARIES; regex_t _PowerRegex; regex_t _GroundRegex; regex_t _ClockRegex; regex_t _ObstacleRegex; + regex_t _padRegex; bool _inConstructor; private: @@ -140,6 +145,7 @@ namespace CRL { inline const std::string& Environment::getGROUND () const { return _GROUND; } inline const std::string& Environment::getCLOCK () const { return _CLOCK; } inline const std::string& Environment::getOBSTACLE () const { return _OBSTACLE; } + inline const std::string& Environment::getPad () const { return _pad; } inline const std::string& Environment::getCATALOG () const { return _CATALOG; } inline SearchPath& Environment::getLIBRARIES () { return _LIBRARIES; } diff --git a/crlcore/src/ccore/crlcore/Measures.h b/crlcore/src/ccore/crlcore/Measures.h index 6a432a7a..7b60ac13 100644 --- a/crlcore/src/ccore/crlcore/Measures.h +++ b/crlcore/src/ccore/crlcore/Measures.h @@ -44,6 +44,7 @@ namespace CRL { using Hurricane::Name; using Hurricane::StandardPrivateProperty; using Hurricane::DBo; + using Hurricane::Record; // ------------------------------------------------------------------- @@ -110,19 +111,29 @@ namespace CRL { class MeasuresDatas { public: - MeasuresDatas (); + MeasuresDatas (); + inline std::string _getTypeName () const; + inline std::string _getString () const; + inline Record* _getRecord () const; public: MeasuresSet _measures; + private: + MeasuresDatas ( const MeasuresDatas& ); }; + inline std::string MeasuresDatas::_getTypeName () const { return "MeasuresDatas"; } + inline std::string MeasuresDatas::_getString () const { return ""; } + inline Record* MeasuresDatas::_getRecord () const { return NULL; } + + // ------------------------------------------------------------------- // Class : "CRL::Measures". class Measures { public: - typedef StandardPrivateProperty Extension; + typedef StandardPrivateProperty Extension; public: template friend inline void addMeasure ( DBo*, const Name&, const Data&, unsigned int width=8 ); template friend inline const Measure* getMeasure ( DBo*, const Name& ); @@ -136,7 +147,7 @@ namespace CRL { inline void addMeasure ( DBo* object, const Name& name, const Data& data, unsigned int width ) { Measures::Extension* extension = Measures::_getOrCreate ( object ); - extension->getValue()._measures.insert ( std::make_pair(name,new Measure(name,data,width)) ); + extension->getValue()->_measures.insert ( std::make_pair(name,new Measure(name,data,width)) ); } @@ -144,9 +155,9 @@ namespace CRL { inline const Measure* getMeasure ( DBo* object, const Name& name ) { Measures::Extension* extension = Measures::_getOrCreate ( object ); - MeasuresSet::iterator imeasure = extension->getValue()._measures.find(name); + MeasuresSet::iterator imeasure = extension->getValue()->_measures.find(name); - if ( imeasure != extension->getValue()._measures.end() ) + if ( imeasure != extension->getValue()->_measures.end() ) return static_cast< Measure* >( (*imeasure).second ); return NULL; @@ -156,4 +167,7 @@ namespace CRL { } // End of CRL namespace. +INSPECTOR_P_SUPPORT(CRL::MeasuresDatas); + + #endif // __STATISTICS_PROPERTY__ diff --git a/crlcore/src/ccore/crlcore/RoutingLayerGauge.h b/crlcore/src/ccore/crlcore/RoutingLayerGauge.h index aff2ca6e..a9052db8 100644 --- a/crlcore/src/ccore/crlcore/RoutingLayerGauge.h +++ b/crlcore/src/ccore/crlcore/RoutingLayerGauge.h @@ -207,6 +207,18 @@ inline std::string getString } +template<> +inline std::string getString + ( Constant::Direction direction ) +{ + switch ( direction ) { + case Constant::Horizontal: return "Horizontal"; + case Constant::Vertical: return "Vertical"; + } + return ( "Unknown Constant::Direction" ); +} + + IOSTREAM_POINTER_SUPPORT(Constant::Direction); diff --git a/crlcore/src/ccore/properties/Measures.cpp b/crlcore/src/ccore/properties/Measures.cpp index c61049d3..c7832465 100644 --- a/crlcore/src/ccore/properties/Measures.cpp +++ b/crlcore/src/ccore/properties/Measures.cpp @@ -54,7 +54,7 @@ namespace CRL { template<> - Name StandardPrivateProperty::_name = "CRL::Measures"; + Name StandardPrivateProperty::_name = "CRL::Measures"; // ------------------------------------------------------------------- @@ -120,7 +120,7 @@ namespace CRL { { Extension* extension = Extension::get ( object ); if ( extension != NULL ) - return &extension->getValue()._measures; + return &extension->getValue()->_measures; return NULL; } @@ -130,7 +130,7 @@ namespace CRL { { Extension* extension = Extension::get ( object ); if ( extension == NULL ) { - extension = Extension::create (); + extension = Extension::create ( new MeasuresDatas() ); object->put ( extension ); } return extension;