diff --git a/anabatic/CMakeLists.txt b/anabatic/CMakeLists.txt index ce2e393b..4d6c97d7 100644 --- a/anabatic/CMakeLists.txt +++ b/anabatic/CMakeLists.txt @@ -3,7 +3,7 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0) project(ANABATIC) - set(ignoreVariables "${BUILD_DOC}") + set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") option(BUILD_DOC "Build the documentation (doxygen)" OFF) option(CHECK_DATABASE "Run database in full check mode (very slow)" OFF) diff --git a/anabatic/src/AnabaticEngine.cpp b/anabatic/src/AnabaticEngine.cpp index 475cee37..c147e1b5 100644 --- a/anabatic/src/AnabaticEngine.cpp +++ b/anabatic/src/AnabaticEngine.cpp @@ -910,7 +910,7 @@ namespace Anabatic { { openSession(); - DbU::Unit pitch3 = Session::getPitch( 2 ); + //DbU::Unit pitch3 = Session::getPitch( 2 ); AutoSegment::IdSet constraineds; AutoSegment::IdSet processeds; @@ -1071,8 +1071,8 @@ namespace Anabatic { printMeasures( "load" ); - addMeasure( getCell(), "Globals", AutoSegment::getGlobalsCount() ); - addMeasure( getCell(), "Edges" , AutoSegment::getAllocateds() ); + addMeasure( "Globals", AutoSegment::getGlobalsCount() ); + addMeasure( "Edges" , AutoSegment::getAllocateds() ); } diff --git a/anabatic/src/AutoHorizontal.cpp b/anabatic/src/AutoHorizontal.cpp index 083250d1..d37638ff 100644 --- a/anabatic/src/AutoHorizontal.cpp +++ b/anabatic/src/AutoHorizontal.cpp @@ -833,9 +833,8 @@ namespace Anabatic { upLayer = (depth+1 <= Session::getConfiguration()->getAllowedDepth()); } - size_t doglegDepth = depth + ((upLayer)?1:-1); - Layer* contactLayer = Session::getRoutingGauge()->getContactLayer( depth + ((upLayer)?0:-1) ); - const Layer* doglegLayer = Session::getRoutingGauge()->getRoutingLayer( doglegDepth ); + size_t doglegDepth = depth + ((upLayer)?1:-1); + Layer* contactLayer = Session::getRoutingGauge()->getContactLayer( depth + ((upLayer)?0:-1) ); Session::dogleg( this ); targetDetach(); diff --git a/anabatic/src/AutoSegment.cpp b/anabatic/src/AutoSegment.cpp index 59727746..17cf9e39 100644 --- a/anabatic/src/AutoSegment.cpp +++ b/anabatic/src/AutoSegment.cpp @@ -349,21 +349,23 @@ namespace Anabatic { deltaUnit = lhs->getLength() - rhs->getLength(); if ( deltaUnit > 0 ) return true; // Longest first. - if ( deltaUnit < 0 ) return true; + if ( deltaUnit < 0 ) return false; deltaUnit = lhs->getAxis() - rhs->getAxis(); if ( deltaUnit < 0 ) return true; // Smallest axis first. if ( deltaUnit > 0 ) return false; - // if ( lhs->isCanonical () xor rhs->isCanonical () ) return lhs->isCanonical(); - // if ( lhs->isCollapsed () xor rhs->isCollapsed () ) return rhs->isCollapsed(); - // if ( lhs->isSlackenStrap() xor rhs->isSlackenStrap() ) return lhs->isSlackenStrap(); +#if THIS_IS_DISABLED + if ( lhs->isCanonical () xor rhs->isCanonical () ) return lhs->isCanonical(); + if ( lhs->isCollapsed () xor rhs->isCollapsed () ) return rhs->isCollapsed(); + if ( lhs->isSlackenStrap() xor rhs->isSlackenStrap() ) return lhs->isSlackenStrap(); - // if ( lhs->isGlobal () xor rhs->isGlobal () ) return lhs->isGlobal(); - // if ( lhs->isTerminal () xor rhs->isTerminal () ) return rhs->isTerminal(); - // if ( lhs->isHorizontal() xor rhs->isHorizontal() ) return lhs->isHorizontal(); + if ( lhs->isGlobal () xor rhs->isGlobal () ) return lhs->isGlobal(); + if ( lhs->isTerminal () xor rhs->isTerminal () ) return rhs->isTerminal(); + if ( lhs->isHorizontal() xor rhs->isHorizontal() ) return lhs->isHorizontal(); - // if ( lhs->isFixed() xor rhs->isFixed() ) return lhs->isFixed(); + if ( lhs->isFixed() xor rhs->isFixed() ) return lhs->isFixed(); +#endif return lhs->getId() < rhs->getId(); } @@ -459,7 +461,7 @@ namespace Anabatic { //cerr << " viaToBottomCap: " << DbU::getValueString(*viaToBottomCap) << endl; //cerr << " viaToSameCap: " << DbU::getValueString(*viaToSameCap ) << endl; - _extensionCaps.push_back( std::array( { viaToTopCap, viaToBottomCap, viaToSameCap } ) ); + _extensionCaps.push_back( std::array( {{ viaToTopCap, viaToBottomCap, viaToSameCap }} ) ); } } diff --git a/anabatic/src/AutoVertical.cpp b/anabatic/src/AutoVertical.cpp index 69dd551c..774b7fb0 100644 --- a/anabatic/src/AutoVertical.cpp +++ b/anabatic/src/AutoVertical.cpp @@ -714,9 +714,8 @@ namespace Anabatic { upLayer = (depth+1 <= Session::getConfiguration()->getAllowedDepth()); } - size_t doglegDepth = depth + ((upLayer)?1:-1); - Layer* contactLayer = Session::getRoutingGauge()->getContactLayer ( depth + ((upLayer)?0:-1) ); - const Layer* doglegLayer = Session::getRoutingGauge()->getRoutingLayer ( doglegDepth ); + size_t doglegDepth = depth + ((upLayer)?1:-1); + Layer* contactLayer = Session::getRoutingGauge()->getContactLayer ( depth + ((upLayer)?0:-1) ); Session::dogleg( this ); targetDetach(); diff --git a/anabatic/src/Configuration.cpp b/anabatic/src/Configuration.cpp index bdf31511..b265663a 100644 --- a/anabatic/src/Configuration.cpp +++ b/anabatic/src/Configuration.cpp @@ -533,6 +533,7 @@ namespace Anabatic { cout << " o Configuration of ToolEngine for Cell <" << cell->getName() << ">" << endl; cout << Dots::asIdentifier(" - Routing Gauge" ,getString(_rg->getName())) << endl; cout << Dots::asString (" - Top routing layer" ,topLayerName) << endl; + cout << Dots::asUInt (" - Maximum GR iterations" ,_globalIterations) << endl; } diff --git a/anabatic/src/Edge.cpp b/anabatic/src/Edge.cpp index ba7c6ae0..007559f8 100644 --- a/anabatic/src/Edge.cpp +++ b/anabatic/src/Edge.cpp @@ -355,9 +355,8 @@ namespace Anabatic { size_t Edge::ripup () { - AnabaticEngine* anabatic = getAnabatic(); - DbU::Unit globalThreshold = Session::getSliceHeight()*3; - size_t netCount = 0; + AnabaticEngine* anabatic = getAnabatic(); + size_t netCount = 0; sort( _segments.begin(), _segments.end(), SortSegmentByLength() ); @@ -379,6 +378,7 @@ namespace Anabatic { anabatic->ripup( _segments[truncate], Flags::Propagate ); } + // DbU::Unit globalThreshold = Session::getSliceHeight()*3; // for ( size_t i=0 ; i<_segments.size() ; ) { // if (_segments[i]->getLength() >= globalThreshold) { // NetData* netData = anabatic->getNetData( _segments[i]->getNet() ); diff --git a/anabatic/src/GCell.cpp b/anabatic/src/GCell.cpp index 6bdd2945..bc95462b 100644 --- a/anabatic/src/GCell.cpp +++ b/anabatic/src/GCell.cpp @@ -1346,11 +1346,17 @@ namespace Anabatic { size_t begin = 0; for ( ; begin < end ; begin++ ) { + if (not _hsegments[begin]) + cerr << Bug( "GCell::removeHSegment(): In %s, NULL segment at [%u/%u]." + , _getString().c_str(), begin, _hsegments.size() ) << endl; + if (_hsegments[begin] == segment) std::swap( _hsegments[begin], _hsegments[--end] ); + cdebug_log(9000,0) << "GCell::removeHSegment() " << this << endl; + cdebug_log(9000,0) << " " << segment << endl; } if (_hsegments.size() == end) { - cerr << Bug( "%s do not go through %s." + cerr << Bug( "GCell::removeHSegment(): %s do not go through %s." , getString(segment).c_str(), _getString().c_str() ) << endl; return; } @@ -1398,11 +1404,6 @@ namespace Anabatic { _flags.reset( Flags::Saturated ); - for ( size_t i=0 ; i<_vsegments.size() ; i++ ) { - if ( _vsegments[i] == NULL ) - cerr << "NULL Autosegment at index " << i << endl; - } - sort( _hsegments.begin(), _hsegments.end(), AutoSegment::CompareByDepthLength() ); sort( _vsegments.begin(), _vsegments.end(), AutoSegment::CompareByDepthLength() ); diff --git a/anabatic/src/LayerAssign.cpp b/anabatic/src/LayerAssign.cpp index a21b2609..0ac9dd45 100644 --- a/anabatic/src/LayerAssign.cpp +++ b/anabatic/src/LayerAssign.cpp @@ -527,8 +527,8 @@ namespace Anabatic { vector southBounds; DbU::Unit leftBound; DbU::Unit rightBound; - bool hasNorth = false; - bool hasSouth = false; + //bool hasNorth = false; + //bool hasSouth = false; AutoSegment::getTopologicalInfos( horizontal , collapseds diff --git a/anabatic/src/NetBuilderHV.cpp b/anabatic/src/NetBuilderHV.cpp index 82a4705d..17ce88b3 100644 --- a/anabatic/src/NetBuilderHV.cpp +++ b/anabatic/src/NetBuilderHV.cpp @@ -186,7 +186,7 @@ namespace Anabatic { if (flags & HAccess) { cdebug_log(145,0) << "case: HAccess" << endl; - if ( ((flags & VSmall) and not ((flags & UseNonPref)) or (flags & Punctual)) ) { + if ( ((flags & VSmall) and not ((flags & UseNonPref))) or (flags & Punctual) ) { cdebug_log(145,0) << "case: VSmall and *not* UseNonPref" << endl; AutoContact* subContact1 = AutoContactTurn::create( gcell, rp->getNet(), Session::getContactLayer(1) ); @@ -1319,6 +1319,8 @@ namespace Anabatic { AutoContact* targetContact = ( getSegmentHookType(getFromHook()) & (NorthBound|EastBound) ) ? getNorthEastContact() : getSouthWestContact() ; + if (not getFromHook()) cerr << "getFromHook() is NULL !" << endl; + AutoSegment* globalSegment = AutoSegment::create( getSourceContact() , targetContact , static_cast( getFromHook()->getComponent() ) diff --git a/bootstrap/CMakeLists.txt b/bootstrap/CMakeLists.txt index 39082d2d..4f32de56 100644 --- a/bootstrap/CMakeLists.txt +++ b/bootstrap/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.4.0) - set(ignoreVariables "${BUILD_DOC}") + set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") add_subdirectory(cmake_modules) diff --git a/bootstrap/build.conf b/bootstrap/build.conf index da0558b7..f0b94d6c 100644 --- a/bootstrap/build.conf +++ b/bootstrap/build.conf @@ -15,16 +15,16 @@ projects = [ , 'tools' : [ "bootstrap" , "lefdef" , "flute" + , "coloquinte" , "vlsisapd" , "hurricane" , "crlcore" + , "etesian" , "anabatic" , "katana" , "knik" , "katabatic" , "kite" - , "coloquinte" - , "etesian" , "equinox" , "solstice" , "oroshi" diff --git a/bootstrap/builder/Builder.py b/bootstrap/builder/Builder.py index 4e97b8af..6c199377 100644 --- a/bootstrap/builder/Builder.py +++ b/bootstrap/builder/Builder.py @@ -38,6 +38,7 @@ class Builder: self._noSystemBoost = False self._macports = False self._devtoolset = 0 + self._llvmtoolset = 0 self._qt5 = False self._openmp = False self._enableShared = "ON" @@ -69,6 +70,8 @@ class Builder: elif attribute == "devtoolset": self._devtoolset = value if value: self._noSystemBoost = True + elif attribute == "llvmtoolset": + self._llvmtoolset = value elif attribute == "qt5": self._qt5 = value elif attribute == "openmp": self._openmp = value elif attribute == "enableDoc": self._enableDoc = value @@ -132,17 +135,24 @@ class Builder: def _execute ( self, command, error ): + collections = [] if self._devtoolset: - print 'Using devtoolset-%(v)d (scl enable devtoolset-%(v)d ...)' % {'v':self._devtoolset} - commandAsString = '' - for i in range(len(command)): - if i: commandAsString += ' ' - if ' ' in command[i]: commandAsString += '"'+command[i]+'"' - else: commandAsString += command[i] - command = [ 'scl', 'enable', 'devtoolset-%d' % self._devtoolset - , commandAsString ] + collections.append( 'devtoolset-%d' % self._devtoolset ) + print 'Using devtoolset-%(v)d (scl enable devtoolset-%(v)d ...)' % {'v':self._devtoolset} + if self._llvmtoolset: + collections.append( 'llvm-toolset-%d' % self._llvmtoolset ) + print 'Using llvm-toolset-%(v)d (scl enable llvm-toolset-%(v)d ...)' % {'v':self._llvmtoolset} + + if collections: + commandAsString = '' + for i in range(len(command)): + if i: commandAsString += ' ' + if ' ' in command[i]: commandAsString += '"'+command[i]+'"' + else: commandAsString += command[i] + command = [ 'scl', 'enable' ] + command += collections + command.append( commandAsString ) - #print command sys.stdout.flush () sys.stderr.flush () child = subprocess.Popen ( command, env=self._environment, stdout=None ) @@ -175,9 +185,10 @@ class Builder: command = [ 'cmake' ] if self._ninja: command += [ "-G", "Ninja" ] + if self._macports: command += [ "-D", "WITH_MACPORTS:STRING=TRUE" ] if self._noSystemBoost: command += [ "-D", "Boost_NO_SYSTEM_PATHS:STRING=TRUE" - , "-D", "BOOST_INCLUDEDIR:STRING=/usr/include/boost157" - , "-D", "BOOST_LIBRARYDIR:STRING=/usr/lib/boost157" + , "-D", "BOOST_INCLUDEDIR:STRING=/usr/include/boost169" + , "-D", "BOOST_LIBRARYDIR:STRING=/usr/lib64/boost169" ] if self._qt5: command += [ "-D", "WITH_QT5:STRING=TRUE" ] if self._openmp: command += [ "-D", "WITH_OPENMP:STRING=TRUE" ] @@ -210,8 +221,6 @@ class Builder: if self._checkDeterminism == 'ON': command += [ "-D", "CHECK_DETERMINISM:STRING=ON" ] command += [ toolSourceDir ] - print self._noSystemBoost - print command self._execute ( command, "Second CMake failed" ) if self._doBuild: @@ -299,8 +308,8 @@ class Builder: def _commandTemplate ( self, tools, projects, command ): if self._clang: - self._environment[ 'CC' ] = '/usr/bin/clang' - self._environment[ 'CXX' ] = '/usr/bin/clang++' + self._environment[ 'CC' ] = 'clang' + self._environment[ 'CXX' ] = 'clang++' if self._devtoolset: self._environment[ 'BOOST_INCLUDEDIR' ] = '/opt/rh/devtoolset-%d/root/usr/include' % self._devtoolset self._environment[ 'BOOST_LIBRARYDIR' ] = '/opt/rh/devtoolset-%d/root/usr/lib' % self._devtoolset diff --git a/bootstrap/ccb.py b/bootstrap/ccb.py index db7f2223..030360ad 100755 --- a/bootstrap/ccb.py +++ b/bootstrap/ccb.py @@ -208,7 +208,8 @@ parser.add_option ( "--no-build" , action="store_true" , parser.add_option ( "--no-cache" , action="store_true" , dest="noCache" , help="Remove previous CMake cache before building." ) parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove previous build directoty before building." ) parser.add_option ( "--macports" , action="store_true" , dest="macports" , help="Build against MacPorts." ) -parser.add_option ( "--devtoolset" , action="store" , type="int" , dest="devtoolset" , help="Build against TUV Dev Toolset 8." ) +parser.add_option ( "--devtoolset" , action="store" , type="int" , dest="devtoolset" , help="Build against TUV Dev Toolset N." ) +parser.add_option ( "--llvm-toolset" , action="store" , type="int" , dest="llvmtoolset" , help="Build against TUV Dev LLVM Toolset N." ) parser.add_option ( "--qt5" , action="store_true" , dest="qt5" , help="Build against Qt 5 (default: Qt 4)." ) parser.add_option ( "--openmp" , action="store_true" , dest="openmp" , help="Enable the use of OpenMP in Gcc." ) parser.add_option ( "--ninja" , action="store_true" , dest="ninja" , help="Use Ninja instead of UNIX Makefile." ) @@ -271,27 +272,28 @@ else: builder.showConfiguration () sys.exit(0) - if options.quiet: builder.quiet = True - if options.release: builder.buildMode = "Release" - if options.debug: builder.buildMode = "Debug" - if options.static: builder.enableShared = "OFF" - if options.doc: builder.enableDoc = "ON" - if options.checkDb: builder.checkDatabase = "ON" - if options.checkDeterminism: builder.checkDeterminism = "ON" - if options.verboseMakefile: builder.verboseMakefile = "ON" - if options.rootDir: builder.rootDir = options.rootDir - if options.noBuild: builder.doBuild = False - if options.noCache: builder.noCache = True - if options.rmBuild: builder.rmBuild = True - if options.ninja: builder.ninja = True - if options.clang: builder.clang = True - if options.macports: builder.macports = True - if options.devtoolset: builder.devtoolset = options.devtoolset - if options.qt5: builder.qt5 = True - if options.openmp: builder.openmp = True - if options.makeArguments: builder.makeArguments = options.makeArguments - #if options.svnMethod: builder.svnMethod = options.svnMethod - #if options.svnTag: builder.svnTag = options.svnTag + if options.quiet: builder.quiet = True + if options.release: builder.buildMode = "Release" + if options.debug: builder.buildMode = "Debug" + if options.static: builder.enableShared = "OFF" + if options.doc: builder.enableDoc = "ON" + if options.checkDb: builder.checkDatabase = "ON" + if options.checkDeterminism: builder.checkDeterminism = "ON" + if options.verboseMakefile: builder.verboseMakefile = "ON" + if options.rootDir: builder.rootDir = options.rootDir + if options.noBuild: builder.doBuild = False + if options.noCache: builder.noCache = True + if options.rmBuild: builder.rmBuild = True + if options.ninja: builder.ninja = True + if options.clang or options.llvmtoolset: builder.clang = True + if options.macports: builder.macports = True + if options.devtoolset: builder.devtoolset = options.devtoolset + if options.llvmtoolset: builder.llvmtoolset = options.llvmtoolset + if options.qt5: builder.qt5 = True + if options.openmp: builder.openmp = True + if options.makeArguments: builder.makeArguments = options.makeArguments + #if options.svnMethod: builder.svnMethod = options.svnMethod + #if options.svnTag: builder.svnTag = options.svnTag #if options.svnStatus: builder.svnStatus ( tools=options.tools, projects=options.projects ) #elif options.svnUpdate: builder.svnUpdate ( tools=options.tools, projects=options.projects ) diff --git a/bootstrap/cmake_modules/FindBootstrap.cmake b/bootstrap/cmake_modules/FindBootstrap.cmake index c2aabb44..94db395b 100644 --- a/bootstrap/cmake_modules/FindBootstrap.cmake +++ b/bootstrap/cmake_modules/FindBootstrap.cmake @@ -85,10 +85,10 @@ set(ADDTIONAL_FLAGS "") set(CXX_STANDARD "c++11") endif() - set(CMAKE_C_FLAGS_DEBUG " -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE) - set(CMAKE_C_FLAGS_RELEASE " -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE) - set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE) - set(CMAKE_CXX_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE) + set(CMAKE_C_FLAGS_DEBUG " -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE) + set(CMAKE_C_FLAGS_RELEASE " -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE) + set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE) + set(CMAKE_CXX_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE) # @@ -178,15 +178,28 @@ # # Find Boost, checking different versions. # + if(WITH_MACPORTS) + set(Boost_PYVER "27") + else() + set(Boost_PYVER "") + endif() + macro(setup_boost) #set(Boost_USE_STATIC_LIBS ON) #message(STATUS "Always uses Boost static libraries.") if(ARGC LESS 1) - find_package(Boost 1.33.1 REQUIRED) + find_package(Boost 1.35.0 REQUIRED) else(ARGC LESS 1) - find_package(Boost 1.35.0 COMPONENTS ${ARGV} system) + foreach(component ${ARGV}) + if(${component} EQUAL "python") + set(component ${component}${Boost_PYVER}) + endif() + set(components ${components} ${component}) + endforeach() + + find_package(Boost 1.35.0 COMPONENTS ${components} system) if(NOT Boost_FOUND) - find_package(Boost 1.33.1 COMPONENTS ${ARGV} REQUIRED) + find_package(Boost 1.35.0 COMPONENTS ${components} REQUIRED) endif(NOT Boost_FOUND) endif(ARGC LESS 1) message(STATUS "Found Boost includes ${Boost_LIB_VERSION} in ${Boost_INCLUDE_DIR}") diff --git a/bora/CMakeLists.txt b/bora/CMakeLists.txt index 857382bd..a5964191 100644 --- a/bora/CMakeLists.txt +++ b/bora/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 2.8.9) - set(ignoreVariables "${BUILD_DOC}") + set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) diff --git a/bora/src/HVSetState.cpp b/bora/src/HVSetState.cpp index 68978cef..ae354df0 100644 --- a/bora/src/HVSetState.cpp +++ b/bora/src/HVSetState.cpp @@ -153,8 +153,7 @@ namespace Bora { // Notes: Set the next combination. See notes above. cdebug_log(535,0) << "HVSetState::next(): counter_:" << _counter << endl; - Symmetry symmetry; - vector::iterator itpair = _nextSet.begin(); + Symmetry symmetry; const VSlicingNodes& children = _HVSnode->getChildren(); for ( size_t ichild=0 ; ichild::Measure ( const Name& name, Histogram* data ) + Measure::Measure ( const Name& name ) : BaseMeasure(name,0) - , _data(data) + , _datas () { } Measure::~Measure () - { delete _data; } + { for ( auto item : _datas ) delete item.second; } bool Measure::isSimpleData () const { return false; } - Histogram* Measure::getData () const - { return _data; } + Histogram* Measure::getData ( size_t index ) const + { return (index < _datas.size()) ? _datas[index].second : NULL; } - void Measure::setData ( Histogram* data ) - { _data=data; } + void Measure::setData ( size_t index, Histogram* data ) + { + while ( _datas.size() <= index ) _datas.push_back( std::make_pair(0,(Histogram*)NULL) ); + delete _datas[index].second; + _datas[index].second = data; + _datas[index].first |= BaseMeasure::Set; + } - std::string Measure::toString () const + std::string Measure::toString ( size_t ) const { return "Unsupported"; } - void Measure::toGnuplot ( std::string basename ) const - { _data->toGnuplot ( basename ); } + void Measure::toGnuplot ( size_t index, const std::string& basename ) const + { + Histogram* h = getData( index ); + ostringstream passName; + passName << basename << "." << setw(2) << setfill('0') << index; + if (h) h->toGnuplot( passName.str() ); + } std::string Measure::_getString () const @@ -268,7 +281,7 @@ namespace CRL { { Record* record = new Record ( _getString() ); if ( record ) { - record->add ( getSlot("_data",_data) ); + record->add ( getSlot("_datas",_datas) ); } return record; } diff --git a/crlcore/src/ccore/ToolEngine.cpp b/crlcore/src/ccore/ToolEngine.cpp index c8e68e70..7f1fb86d 100644 --- a/crlcore/src/ccore/ToolEngine.cpp +++ b/crlcore/src/ccore/ToolEngine.cpp @@ -198,6 +198,7 @@ namespace CRL { , _routingModificationFlag (0) , _inRelationDestroy (false) , _timer () + , _passNumber (0) { } diff --git a/crlcore/src/ccore/alliance/ap/ApDriver.cpp b/crlcore/src/ccore/alliance/ap/ApDriver.cpp index f6295f9b..24bf32d1 100644 --- a/crlcore/src/ccore/alliance/ap/ApDriver.cpp +++ b/crlcore/src/ccore/alliance/ap/ApDriver.cpp @@ -233,11 +233,11 @@ void DumpContacts(ofstream& ccell, Cell *cell) void DumpSegments ( ofstream& ccell, Cell* cell ) { - const char* mbkLayer = NULL; + const char* mbkLayer = NULL; DbU::Unit x1, x2, y1, y2, width; - Segment* segment = NULL; - RoutingPad* rp = NULL; - bool external = false; + Segment* segment = NULL; + RoutingPad* rp = NULL; + bool external = false; for ( Net* net : cell->getNets() ) { string netName = toMBKName( net->getName() ); @@ -249,16 +249,16 @@ void DumpContacts(ofstream& ccell, Cell *cell) if (not cell->isRouted()) continue; external = true; - segment = dynamic_cast(rp->getOccurrence().getEntity()); + segment = dynamic_cast( rp->getOccurrence().getEntity() ); if (segment) { - x1 = rp->getSourceX(); - x2 = rp->getTargetX(); - y1 = rp->getSourceY(); - y2 = rp->getTargetY(); - width = segment->getWidth(); + x1 = rp->getSourceX(); + x2 = rp->getTargetX(); + y1 = rp->getSourceY(); + y2 = rp->getTargetY(); + width = segment->getWidth(); } else { - Pin* pin = dynamic_cast(rp->getOccurrence().getEntity()); - if (pin) { + Pin* pin = dynamic_cast( rp->getOccurrence().getEntity() ); + if (pin and (rp->getOccurrence().getPath().getHeadInstance() != NULL)) { Box bb ( pin->getBoundingBox() ); rp->getOccurrence().getPath().getTransformation().applyOn( bb ); if (bb.getWidth() > bb.getHeight()) { @@ -278,7 +278,7 @@ void DumpContacts(ofstream& ccell, Cell *cell) continue; } } else if ( (segment = dynamic_cast(component)) ) { - external = NetExternalComponents::isExternal(component); + external = NetExternalComponents::isExternal( component ); x1 = segment->getSourceX(); x2 = segment->getTargetX(); y1 = segment->getSourceY(); @@ -290,10 +290,10 @@ void DumpContacts(ofstream& ccell, Cell *cell) const char* direction = "RIGHT"; if ( (x1 == x2) and (y1 != y2) ) direction = "UP"; - if ( x1 > x2 ) swap ( x1, x2 ); - if ( y1 > y2 ) swap ( y1, y2 ); + if (x1 > x2) std::swap( x1, x2 ); + if (y1 > y2) std::swap( y1, y2 ); - if ( toMBKLayer(mbkLayer,component->getLayer()->getName(),false,external) ) + if (toMBKLayer(mbkLayer,component->getLayer()->getName(),false,external)) ccell << "S " << toMBKlambda(x1) << "," << toMBKlambda(y1) << "," diff --git a/crlcore/src/ccore/crlcore/Histogram.h b/crlcore/src/ccore/crlcore/Histogram.h index b8640dea..2da33230 100644 --- a/crlcore/src/ccore/crlcore/Histogram.h +++ b/crlcore/src/ccore/crlcore/Histogram.h @@ -69,20 +69,29 @@ namespace CRL { template<> class Measure : public BaseMeasure { public: - Measure ( const Name&, Histogram* ); + Measure ( const Name& ); virtual ~Measure (); virtual bool isSimpleData () const; - Histogram* getData () const; - void setData ( Histogram* ); - virtual std::string toString () const; - virtual void toGnuplot ( std::string basename ) const; + inline bool hasDataAt ( size_t index ) const; + inline size_t getSize () const; + Histogram* getData ( size_t index ) const; + void setData ( size_t index, Histogram* ); + virtual std::string toString ( size_t index ) const; + virtual void toGnuplot ( size_t index, const std::string& basename ) const; virtual std::string _getString () const; virtual Record* _getRecord () const; private: - Histogram* _data; + std::vector< std::pair > _datas; }; + inline bool Measure::hasDataAt ( size_t index ) const + { return (index < _datas.size()) ? _datas[index].first & BaseMeasure::Set : 0; } + + inline size_t Measure::getSize () const + { return _datas.size(); } + + } // CRL namespace. diff --git a/crlcore/src/ccore/crlcore/Measures.h b/crlcore/src/ccore/crlcore/Measures.h index 009cf4ab..b7cd8f3f 100644 --- a/crlcore/src/ccore/crlcore/Measures.h +++ b/crlcore/src/ccore/crlcore/Measures.h @@ -43,14 +43,16 @@ namespace CRL { class BaseMeasure { + public: + const uint32_t Set = (1<<0); public: inline BaseMeasure ( const Name&, unsigned int width ); virtual ~BaseMeasure (); virtual bool isSimpleData () const; inline const Name& getName () const; inline unsigned int getFieldWidth () const; - virtual std::string toString () const = 0; - virtual void toGnuplot ( const std::string& basename ) const; + virtual std::string toString ( size_t index ) const = 0; + virtual void toGnuplot ( size_t index, const std::string& basename ) const; virtual std::string _getString () const; virtual Record* _getRecord () const; private: @@ -67,41 +69,58 @@ namespace CRL { template class Measure : public BaseMeasure { public: - inline Measure ( const Name&, const Data&, unsigned int width ); - inline const Data& getData () const; - inline void setData ( const Data& ); - virtual std::string toString () const; + inline Measure ( const Name&, unsigned int width ); + inline bool hasDataAt ( size_t index ) const; + inline size_t getSize () const; + inline const Data& getData ( size_t index ) const; + inline void setData ( size_t index, const Data& ); + virtual std::string toString ( size_t index ) const; virtual std::string _getString () const; virtual Record* _getRecord () const; private: - Data _data; + Data _blankData; + std::vector< std::pair > _datas; }; template - inline Measure::Measure ( const Name& name, const Data& data, unsigned int width ) - : BaseMeasure(name,width), _data(data) { } + inline Measure::Measure ( const Name& name, unsigned int width ) + : BaseMeasure(name,width), _blankData(), _datas() { } template - inline const Data& Measure::getData () const { return _data; } + inline bool Measure::hasDataAt ( size_t index ) const + { return (index < _datas.size()) ? _datas[index].first & BaseMeasure::Set : 0; } template - inline void Measure::setData ( const Data& data ) { _data=data; } + inline size_t Measure::getSize () const + { return _datas.size(); } template - std::string Measure::toString () const - { std::ostringstream s; s << std::fixed << std::setprecision(2) << _data; return s.str(); } + inline const Data& Measure::getData ( size_t index ) const + { return (index < _datas.size()) ? _datas[index].second : _blankData; } + + template + inline void Measure::setData ( size_t index, const Data& data ) + { + while ( _datas.size() <= index ) _datas.push_back( std::make_pair(0,Data()) ); + _datas[index].second = data; + _datas[index].first |= BaseMeasure::Set; + } + + template + std::string Measure::toString ( size_t index ) const + { std::ostringstream s; s << std::fixed << std::setprecision(2) << getData(index); return s.str(); } template std::string Measure::_getString () const - { return ""; } + { return ""; } template Record* Measure::_getRecord () const { Record* record = new Record ( _getString() ); if ( record ) { - record->add ( getSlot("_data",&_data) ); + record->add ( getSlot("_datas",&_datas) ); } return record; } @@ -111,8 +130,8 @@ namespace CRL { public: ~MeasuresSet (); std::string toStringHeaders ( const std::vector& ) const; - std::string toStringDatas ( const std::vector& ) const; - void toGnuplot ( Name, const std::string& ) const; + std::string toStringDatas ( const std::vector&, size_t index ) const; + void toGnuplot ( Name, size_t index, const std::string& ) const; std::string _getString () const; Record* _getRecord () const; }; @@ -147,9 +166,9 @@ namespace CRL { public: typedef StandardPrivateProperty Extension; public: - template friend inline void addMeasure ( DBo*, const Name&, const Data&, unsigned int width ); - template friend inline void addMeasure ( DBo*, const Name&, const Data& ); - template friend inline void addMeasure ( DBo*, const Name&, Data* ); + template friend inline void addMeasure ( DBo*, const Name&, size_t index, const Data&, unsigned int width ); + template friend inline void addMeasure ( DBo*, const Name&, size_t index, const Data& ); + template friend inline void addMeasure ( DBo*, const Name&, size_t index, Data* ); template friend inline const Measure* getMeasure ( DBo*, const Name& ); static const MeasuresSet* get ( const DBo* ); private: @@ -158,35 +177,41 @@ namespace CRL { template - inline void addMeasure ( DBo* object, const Name& name, const Data& data, unsigned int width ) - { - Measures::Extension* extension = Measures::_getOrCreate( object ); - MeasuresSet::iterator imeasure = extension->getValue()._measures.find(name); - - if (imeasure == extension->getValue()._measures.end()) { - extension->getValue()._measures.insert ( std::make_pair(name,new Measure(name,data,width)) ); - } else { - static_cast< Measure* >( (*imeasure).second )->setData( data ); - } - } - - - template - inline void addMeasure ( DBo* object, const Name& name, const Data& data ) - { return addMeasure(object,name,data,8); } - - - template - inline void addMeasure ( DBo* object, const Name& name, Data* data ) + inline void addMeasure ( DBo* object, const Name& name, size_t index, const Data& data, unsigned int width ) { Measures::Extension* extension = Measures::_getOrCreate( object ); MeasuresSet::iterator imeasure = extension->getValue()._measures.find(name); + Measure* measure = NULL; if (imeasure == extension->getValue()._measures.end()) { - extension->getValue()._measures.insert( std::make_pair(name,new Measure(name,data)) ); + measure = new Measure( name, width ); + extension->getValue()._measures.insert ( std::make_pair(name,measure) ); } else { - static_cast< Measure* >( (*imeasure).second )->setData( data ); + measure = static_cast< Measure* >( (*imeasure).second ); } + measure->setData( index, data ); + } + + + template + inline void addMeasure ( DBo* object, const Name& name, size_t index, const Data& data ) + { return ::CRL::addMeasure(object,name,index,data,8); } + + + template + inline void addMeasure ( DBo* object, const Name& name, size_t index, Data* data ) + { + Measures::Extension* extension = Measures::_getOrCreate( object ); + MeasuresSet::iterator imeasure = extension->getValue()._measures.find(name); + + Measure* measure = NULL; + if (imeasure == extension->getValue()._measures.end()) { + measure = new Measure( name ); + extension->getValue()._measures.insert( std::make_pair(name,measure) ); + } else { + measure = static_cast< Measure* >( (*imeasure).second ); + } + measure->setData( index, data ); } diff --git a/crlcore/src/ccore/crlcore/ParsersDrivers.h b/crlcore/src/ccore/crlcore/ParsersDrivers.h index bf904cbe..d99bf42b 100644 --- a/crlcore/src/ccore/crlcore/ParsersDrivers.h +++ b/crlcore/src/ccore/crlcore/ParsersDrivers.h @@ -15,7 +15,7 @@ // +-----------------------------------------------------------------+ -#ifndef CRL_PARSERS_DRIVERS_H_ +#ifndef CRL_PARSERS_DRIVERS_H #define CRL_PARSERS_DRIVERS_H #include diff --git a/crlcore/src/ccore/crlcore/ToolEngine.h b/crlcore/src/ccore/crlcore/ToolEngine.h index 695034eb..4535879b 100644 --- a/crlcore/src/ccore/crlcore/ToolEngine.h +++ b/crlcore/src/ccore/crlcore/ToolEngine.h @@ -19,7 +19,6 @@ #define CRL_TOOL_ENGINE_H #include -#include #include "hurricane/Commons.h" #include "hurricane/Timer.h" #include "hurricane/DBo.h" @@ -30,13 +29,12 @@ namespace Hurricane { class Cell; } +#include "crlcore/Measures.h" #include "crlcore/ToolEngines.h" namespace CRL { - using std::string; - using std::vector; using Hurricane::Timer; using Hurricane::Record; using Hurricane::Name; @@ -58,17 +56,28 @@ namespace CRL { public: virtual const Name& getName () const = 0; inline Cell* getCell () const; + inline uint32_t getPassNumber () const; bool placementModificationFlagHasChanged (); bool routingModificationFlagHasChanged (); inline void setInRelationDestroy ( bool ); inline const Timer& getTimer () const; + inline void setPassNumber ( uint32_t ); + inline std::string getMeasureLabel ( std::string ) const; void startMeasures (); void stopMeasures (); void suspendMeasures (); void resumeMeasures (); void printMeasures () const; - virtual string _getTypeName () const; - virtual string _getString () const; + template + inline void addMeasure ( std::string, const Data&, unsigned int width ) const; + template + inline void addMeasure ( std::string, const Data& ) const; + template + inline void addMeasure ( std::string, Data* ) const; + template + inline const Data& getMeasure ( std::string ) const; + virtual std::string _getTypeName () const; + virtual std::string _getString () const; virtual Record* _getRecord () const; private: static bool _inDestroyAll; @@ -79,6 +88,7 @@ namespace CRL { unsigned int _routingModificationFlag; bool _inRelationDestroy; Timer _timer; + uint32_t _passNumber; protected: ToolEngine ( Cell* cell ); virtual void _postCreate (); @@ -95,9 +105,30 @@ namespace CRL { // Inline Functions. - inline Cell* ToolEngine::getCell () const { return _cell; } - inline void ToolEngine::setInRelationDestroy ( bool state ) { _inRelationDestroy = state; } - inline const Timer& ToolEngine::getTimer () const { return _timer; } + inline Cell* ToolEngine::getCell () const { return _cell; } + inline void ToolEngine::setInRelationDestroy ( bool state ) { _inRelationDestroy = state; } + inline const Timer& ToolEngine::getTimer () const { return _timer; } + inline uint32_t ToolEngine::getPassNumber () const { return _passNumber; } + inline void ToolEngine::setPassNumber ( uint32_t n ) { _passNumber = n; } + + inline std::string ToolEngine::getMeasureLabel ( std::string label ) const + { return _getTypeName() + "." + label; } + + template + inline void ToolEngine::addMeasure ( std::string name, const Data& data, unsigned int width ) const + { ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data, width ); } + + template + inline void ToolEngine::addMeasure ( std::string name, const Data& data ) const + { ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data ); } + + template + inline void ToolEngine::addMeasure ( std::string name, Data* data ) const + { ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data ); } + + template + inline const Data& ToolEngine::getMeasure ( std::string name ) const + { return ::CRL::getMeasure( getCell(), getMeasureLabel(name) )->getData( getPassNumber() ); } } // CRL namespace. diff --git a/crlcore/src/ccore/gds/GdsDriver.cpp b/crlcore/src/ccore/gds/GdsDriver.cpp index 74c492e9..ab8e3752 100644 --- a/crlcore/src/ccore/gds/GdsDriver.cpp +++ b/crlcore/src/ccore/gds/GdsDriver.cpp @@ -131,7 +131,7 @@ namespace { static const uint16_t BitArray = 0x0001; static const uint16_t TwoByteInteger = 0x0002; // Signed, 16 bits. static const uint16_t FourByteInteger = 0x0003; // Signed, 32 bits. - static const uint16_t FourByteReal = 0x0004; // Unused. + //static const uint16_t FourByteReal = 0x0004; // Unused. static const uint16_t EightByteReal = 0x0005; static const uint16_t String = 0x0006; // Record Types. @@ -144,55 +144,55 @@ namespace { static const uint16_t STRNAME = 0x0600 | String; static const uint16_t ENDSTR = 0x0700 | NoData; static const uint16_t BOUNDARY = 0x0800 | NoData; - static const uint16_t PATH = 0x0900 | NoData; + //static const uint16_t PATH = 0x0900 | NoData; static const uint16_t SREF = 0x0a00 | NoData; - static const uint16_t AREF = 0x0b00 | NoData; - static const uint16_t TEXT = 0x0c00 | NoData; + //static const uint16_t AREF = 0x0b00 | NoData; + //static const uint16_t TEXT = 0x0c00 | NoData; static const uint16_t LAYER = 0x0d00 | TwoByteInteger; static const uint16_t DATATYPE = 0x0e00 | TwoByteInteger; - static const uint16_t WIDTH = 0x0f00 | FourByteInteger; + //static const uint16_t WIDTH = 0x0f00 | FourByteInteger; static const uint16_t XY = 0x1000 | FourByteInteger; static const uint16_t ENDEL = 0x1100 | NoData; static const uint16_t SNAME = 0x1200 | String; - static const uint16_t COLROW = 0x1300 | TwoByteInteger; - static const uint16_t TEXTNODE = 0x1400 | NoData; // Unused. - static const uint16_t NODE = 0x1500 | NoData; - static const uint16_t TEXTTYPE = 0x1600 | TwoByteInteger; - static const uint16_t PRESENTATION = 0x1700 | BitArray; - static const uint16_t SPACING = 0x1800 | NoData; // Discontinued. - static const uint16_t STRING = 0x1900 | String; + //static const uint16_t COLROW = 0x1300 | TwoByteInteger; + //static const uint16_t TEXTNODE = 0x1400 | NoData; // Unused. + //static const uint16_t NODE = 0x1500 | NoData; + //static const uint16_t TEXTTYPE = 0x1600 | TwoByteInteger; + //static const uint16_t PRESENTATION = 0x1700 | BitArray; + //static const uint16_t SPACING = 0x1800 | NoData; // Discontinued. + //static const uint16_t STRING = 0x1900 | String; static const uint16_t STRANS = 0x1a00 | BitArray; - static const uint16_t MAG = 0x1b00 | EightByteReal; + //static const uint16_t MAG = 0x1b00 | EightByteReal; static const uint16_t ANGLE = 0x1c00 | EightByteReal; - static const uint16_t REFLIBS = 0x1f00 | String; - static const uint16_t FONTS = 0x2000 | String; - static const uint16_t PATHTYPE = 0x2100 | TwoByteInteger; - static const uint16_t GENERATIONS = 0x2200 | TwoByteInteger; - static const uint16_t ATTRTABLE = 0x2300 | String; - static const uint16_t STYPTABLE = 0x2400 | String; // Unreleased. - static const uint16_t STRTYPE = 0x2500 | TwoByteInteger; // Unreleased. - static const uint16_t ELFLAGS = 0x2600 | BitArray; - static const uint16_t ELKEY = 0x2700 | FourByteInteger; // Unreleased. - static const uint16_t LINKTYPE = 0x2800 | TwoByteInteger; // Unreleased. - static const uint16_t LINKKEYS = 0x2900 | FourByteInteger; // Unreleased. - static const uint16_t NODETYPE = 0x2a00 | TwoByteInteger; + //static const uint16_t REFLIBS = 0x1f00 | String; + //static const uint16_t FONTS = 0x2000 | String; + //static const uint16_t PATHTYPE = 0x2100 | TwoByteInteger; + //static const uint16_t GENERATIONS = 0x2200 | TwoByteInteger; + //static const uint16_t ATTRTABLE = 0x2300 | String; + //static const uint16_t STYPTABLE = 0x2400 | String; // Unreleased. + //static const uint16_t STRTYPE = 0x2500 | TwoByteInteger; // Unreleased. + //static const uint16_t ELFLAGS = 0x2600 | BitArray; + //static const uint16_t ELKEY = 0x2700 | FourByteInteger; // Unreleased. + //static const uint16_t LINKTYPE = 0x2800 | TwoByteInteger; // Unreleased. + //static const uint16_t LINKKEYS = 0x2900 | FourByteInteger; // Unreleased. + //static const uint16_t NODETYPE = 0x2a00 | TwoByteInteger; static const uint16_t PROPATTR = 0x2b00 | TwoByteInteger; static const uint16_t PROPVALUE = 0x2c00 | String; - static const uint16_t BOX = 0x2d00 | NoData; - static const uint16_t BOXTYPE = 0x2e00 | TwoByteInteger; - static const uint16_t PLEX = 0x2f00 | FourByteInteger; - static const uint16_t BGNEXTN = 0x3000 | FourByteInteger; // CustomPlus. - static const uint16_t ENDEXTN = 0x3100 | FourByteInteger; // CustomPlus. - static const uint16_t TAPENUM = 0x3200 | TwoByteInteger; - static const uint16_t TAPECODE = 0x3300 | TwoByteInteger; - static const uint16_t STRCLASS = 0x3400 | BitArray; // CustomPlus. - static const uint16_t RESERVED = 0x3500 | FourByteInteger; // Future use. - static const uint16_t FORMAT = 0x3600 | TwoByteInteger; - static const uint16_t MASK = 0x3700 | String; // Filtered format. - static const uint16_t ENDMASKS = 0x3800 | NoData; // Filtered format. - static const uint16_t LIBDIRSIZE = 0x3900 | TwoByteInteger; - static const uint16_t SRFNAME = 0x3a00 | String; - static const uint16_t LIBSECUR = 0x3b00 | TwoByteInteger; + //static const uint16_t BOX = 0x2d00 | NoData; + //static const uint16_t BOXTYPE = 0x2e00 | TwoByteInteger; + //static const uint16_t PLEX = 0x2f00 | FourByteInteger; + //static const uint16_t BGNEXTN = 0x3000 | FourByteInteger; // CustomPlus. + //static const uint16_t ENDEXTN = 0x3100 | FourByteInteger; // CustomPlus. + //static const uint16_t TAPENUM = 0x3200 | TwoByteInteger; + //static const uint16_t TAPECODE = 0x3300 | TwoByteInteger; + //static const uint16_t STRCLASS = 0x3400 | BitArray; // CustomPlus. + //static const uint16_t RESERVED = 0x3500 | FourByteInteger; // Future use. + //static const uint16_t FORMAT = 0x3600 | TwoByteInteger; + //static const uint16_t MASK = 0x3700 | String; // Filtered format. + //static const uint16_t ENDMASKS = 0x3800 | NoData; // Filtered format. + //static const uint16_t LIBDIRSIZE = 0x3900 | TwoByteInteger; + //static const uint16_t SRFNAME = 0x3a00 | String; + //static const uint16_t LIBSECUR = 0x3b00 | TwoByteInteger; public: GdsRecord ( uint16_t type ); GdsRecord ( uint16_t type, int16_t ); @@ -324,7 +324,7 @@ namespace { ostream& operator<< ( ostream& o, const GdsRecord& r ) { r .toStream( o ); return o; } - ostream& operator<< ( ostream& o, const GdsRecord* r ) { r->toStream( o ); return o; } +//ostream& operator<< ( ostream& o, const GdsRecord* r ) { r->toStream( o ); return o; } // ------------------------------------------------------------------- @@ -413,7 +413,7 @@ namespace { // Generate a GDSII which coordinates are relatives to the um. // Bug correction courtesy of M. Koefferlein (KLayout). - double gridPerUu = DbU::getPhysicalsPerGrid() / 1e-6; + //double gridPerUu = DbU::getPhysicalsPerGrid() / 1e-6; record = GdsRecord( GdsRecord::UNITS ); record.push( _dbuPerUu ); diff --git a/crlcore/src/ccore/gds/GdsParser.cpp b/crlcore/src/ccore/gds/GdsParser.cpp index f2ced79d..ad87f780 100644 --- a/crlcore/src/ccore/gds/GdsParser.cpp +++ b/crlcore/src/ccore/gds/GdsParser.cpp @@ -64,7 +64,7 @@ namespace { static const uint16_t BitArray = 0x0001; static const uint16_t TwoByteInteger = 0x0002; // Signed, 16 bits. static const uint16_t FourByteInteger = 0x0003; // Signed, 32 bits. - static const uint16_t FourByteReal = 0x0004; // Unused. + //static const uint16_t FourByteReal = 0x0004; // Unused. static const uint16_t EightByteReal = 0x0005; static const uint16_t String = 0x0006; // Record Types. @@ -634,7 +634,6 @@ namespace { Component* _component; string _text; DbU::Unit _scale; - int64_t _netCount; int64_t _SREFCount; bool _validSyntax; bool _skipENDEL; @@ -683,7 +682,6 @@ namespace { , _component (NULL) , _text () , _scale (1) - , _netCount (0) , _SREFCount (0) , _validSyntax (true) , _skipENDEL (false) diff --git a/crlcore/src/ccore/properties/Measures.cpp b/crlcore/src/ccore/properties/Measures.cpp index 7dcc2e3e..c0aa336e 100644 --- a/crlcore/src/ccore/properties/Measures.cpp +++ b/crlcore/src/ccore/properties/Measures.cpp @@ -44,7 +44,7 @@ namespace CRL { BaseMeasure::~BaseMeasure () {} bool BaseMeasure::isSimpleData () const { return true; } - void BaseMeasure::toGnuplot ( const string& ) const {} + void BaseMeasure::toGnuplot ( size_t, const string& ) const {} string BaseMeasure::_getString () const { return ""; } Record* BaseMeasure::_getRecord () const { return NULL; } @@ -67,45 +67,48 @@ namespace CRL { out << "#"; for ( size_t i=0 ; iisSimpleData() ) - out << setw(measure->getFieldWidth()) << right << measure->getName(); + if (measure->isSimpleData()) { + string label = getString( measure->getName() ); + label.erase( 0, label.find_last_of('.')+1 ); + out << setw(measure->getFieldWidth()) << right << label; + } } return out.str(); } - string MeasuresSet::toStringDatas ( const vector& names ) const + string MeasuresSet::toStringDatas ( const vector& names, size_t index ) const { ostringstream out; out << " "; for ( size_t i=0 ; iisSimpleData() ) - out << setw(measure->getFieldWidth()) << right << measure->toString(); + if (measure->isSimpleData()) + out << setw(measure->getFieldWidth()) << right << measure->toString(index); } return out.str(); } - void MeasuresSet::toGnuplot ( Name name, const string& basename ) const + void MeasuresSet::toGnuplot ( Name name, size_t index, const string& basename ) const { - const_iterator imeasure = find ( name ); - if ( imeasure == end() ) return; + const_iterator imeasure = find( name ); + if (imeasure == end()) return; const BaseMeasure* measure = (*imeasure).second; - if ( measure->isSimpleData() ) return; + if (measure->isSimpleData()) return; - measure->toGnuplot ( basename ); + measure->toGnuplot( index, basename ); } diff --git a/crlcore/src/pyCRL/PyGds.cpp b/crlcore/src/pyCRL/PyGds.cpp index de3eaaa1..383b37a8 100644 --- a/crlcore/src/pyCRL/PyGds.cpp +++ b/crlcore/src/pyCRL/PyGds.cpp @@ -64,8 +64,6 @@ extern "C" { { cdebug_log(30,0) << "PyGds_save()" << endl; - Cell* cell = NULL; - HTRY PyObject* pyCell = NULL; if (PyArg_ParseTuple( args, "O:Gds.save", &pyCell )) { @@ -89,8 +87,7 @@ extern "C" { { cdebug_log(30,0) << "PyGds_load()" << endl; - Library* library = NULL; - char* path = NULL; + char* path = NULL; HTRY PyObject* pyLibrary = NULL; diff --git a/crlcore/src/pyCRL/PyToolEngine.cpp b/crlcore/src/pyCRL/PyToolEngine.cpp index 99691101..0a73853c 100644 --- a/crlcore/src/pyCRL/PyToolEngine.cpp +++ b/crlcore/src/pyCRL/PyToolEngine.cpp @@ -2,7 +2,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2019, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -125,8 +125,10 @@ extern "C" { GetNameMethod(ToolEngine, tool) - DirectGetBoolAttribute(PyToolEngine_getPlacementFlag,placementModificationFlagHasChanged,PyToolEngine,ToolEngine) - DirectGetBoolAttribute(PyToolEngine_getRoutingFlag ,routingModificationFlagHasChanged ,PyToolEngine,ToolEngine) + DirectGetBoolAttribute (PyToolEngine_getPlacementFlag,placementModificationFlagHasChanged,PyToolEngine,ToolEngine) + DirectGetBoolAttribute (PyToolEngine_getRoutingFlag ,routingModificationFlagHasChanged ,PyToolEngine,ToolEngine) + DirectGetUIntAttribute (PyToolEngine_getPassNumber ,getPassNumber ,PyToolEngine,ToolEngine) + DirectSetUInt32Attribute(PyToolEngine_setPassNumber ,setPassNumber ,PyToolEngine,ToolEngine) // Standart destroy (Attribute). @@ -140,6 +142,10 @@ extern "C" { , "Returns the name of the ToolEngine (class attribute)." } , { "getCell" , (PyCFunction)PyToolEngine_getCell , METH_NOARGS , "Returns the Cell on which this ToolEngine is attached." } + , { "getPassNumber" , (PyCFunction)PyToolEngine_getPassNumber , METH_NOARGS + , "Returns the pass number to tool is into (iteration)." } + , { "setPassNumber" , (PyCFunction)PyToolEngine_setPassNumber , METH_VARARGS + , "Sets the pass number to tool is to be." } , { "placementModificationFlagHasChanged" , (PyCFunction)PyToolEngine_getPlacementFlag , METH_NOARGS , "Returns the state of the placement modification flag." } diff --git a/cumulus/CMakeLists.txt b/cumulus/CMakeLists.txt index 6ef959f1..d2e192d7 100644 --- a/cumulus/CMakeLists.txt +++ b/cumulus/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.4.0) - set(ignoreVariables "${BUILD_DOC}") + set(ignoreVariables "${BUILD_DOC}" "${CMAKE_INSTALL_DIR}") list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) diff --git a/cumulus/src/CMakeLists.txt b/cumulus/src/CMakeLists.txt index b5604e75..27fc5404 100644 --- a/cumulus/src/CMakeLists.txt +++ b/cumulus/src/CMakeLists.txt @@ -5,16 +5,21 @@ ${CMAKE_CURRENT_SOURCE_DIR}/Alliance.py ) set ( pyPlugins ${CMAKE_CURRENT_SOURCE_DIR}/plugins/__init__.py + #${CMAKE_CURRENT_SOURCE_DIR}/plugins/VChannelsPlugin.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/ClockTreePlugin.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/CoreToChip_cmos.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/CoreToChip_phlib80.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/ChipPlace.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/ChipRoute.py + ${CMAKE_CURRENT_SOURCE_DIR}/plugins/ConductorPlugin.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/RSavePlugin.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/RSavePluginAll.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/S2R.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/AboutWindow.py ) + #set ( pyPluginBlock ${CMAKE_CURRENT_SOURCE_DIR}/plugins/block/__init__.py + # ${CMAKE_CURRENT_SOURCE_DIR}/plugins/block/VChannels.py + # ) set ( pyPluginCT ${CMAKE_CURRENT_SOURCE_DIR}/plugins/clocktree/__init__.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/clocktree/RSMT.py ${CMAKE_CURRENT_SOURCE_DIR}/plugins/clocktree/ClockTree.py @@ -34,6 +39,7 @@ install ( FILES ${pySources} DESTINATION ${PYTHON_SITE_PACKAGES}/cumulus ) install ( FILES ${pyPlugins} DESTINATION ${PYTHON_SITE_PACKAGES}/cumulus/plugins ) + #install ( FILES ${pyPluginBlock} DESTINATION ${PYTHON_SITE_PACKAGES}/cumulus/plugins/block ) install ( FILES ${pyPluginCT} DESTINATION ${PYTHON_SITE_PACKAGES}/cumulus/plugins/clocktree ) install ( FILES ${pyPluginC2C} DESTINATION ${PYTHON_SITE_PACKAGES}/cumulus/plugins/core2chip ) install ( FILES ${pyPluginChip} DESTINATION ${PYTHON_SITE_PACKAGES}/cumulus/plugins/chip ) diff --git a/cumulus/src/plugins/ClockTreePlugin.py b/cumulus/src/plugins/ClockTreePlugin.py old mode 100755 new mode 100644 diff --git a/cumulus/src/plugins/ConductorPlugin.py b/cumulus/src/plugins/ConductorPlugin.py new file mode 100644 index 00000000..f4325681 --- /dev/null +++ b/cumulus/src/plugins/ConductorPlugin.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python +# +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | C u m u l u s - P y t h o n T o o l s | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +# | =============================================================== | +# | Python : "./plugins/ConductorPlugin.py" | +# +-----------------------------------------------------------------+ + +try: + import sys + import traceback + import os.path + import math + import Cfg + import Hurricane + from Hurricane import Breakpoint + from Hurricane import UpdateSession + import Viewer + import CRL + from CRL import RoutingLayerGauge + import helpers + from helpers import trace + from helpers.io import ErrorMessage, catch + from helpers import l, u, n + import Anabatic + import Etesian + import Katana + import Unicorn + import plugins +except Exception, e: + catch( e ) + sys.exit(2) + + +# -------------------------------------------------------------------- +# Plugin hook functions, unicornHook:menus, ScritMain:call + +def unicornHook ( **kw ): + kw['beforeAction'] = 'placeAndRoute.conductor' + + plugins.kwAddMenu ( 'placeAndRoute', 'P&&R', **kw ) + plugins.kwUnicornHook( 'misc.beta.conductor' + , 'P&&R Conductor' + , 'Perform a placement driven by global routing, then detailed routing' + , sys.modules[__name__].__file__ + , **kw + ) + return + + +def ScriptMain ( **kw ): + try: + #helpers.setTraceLevel( 550 ) + + errorCode = 0 + + stopLevel = 1 + if Cfg.hasParameter('conductor.stopLevel'): + stopLevel = Cfg.getParamInt('conductor.stopLevel').asInt() + Breakpoint.setStopLevel( stopLevel ) + + maxPlaceIteration = 2 + if Cfg.hasParameter('conductor.maxPlaceIterations'): + maxPlaceIteration = Cgf.getParamInt('conductor.maxPlaceIterations') + + cell = None + if kw.has_key('cell') and kw['cell']: + cell = kw['cell'] + + editor = None + if kw.has_key('editor') and kw['editor']: + editor = kw['editor'] + print ' o Editor found, running in graphic mode.' + if cell == None: cell = editor.getCell() + + if cell == None: + raise ErrorMessage( 3, 'Conductor: No cell loaded yet.' ) + + success = False + etesian = None + katana = None + iteration = 0 + + while iteration < maxPlaceIteration: + print '\n o P&R Conductor iteration: %d' % iteration + + if not (katana is None): + print ' o Global routing has failed, re-place design.' + katana.resetRouting() + katana.destroy () + katana = None + if editor: + editor.setShowSelection( False ) + + etesian = Etesian.EtesianEngine.create( cell ) + etesian.setPassNumber( iteration ) + if editor: etesian.setViewer( editor ) + if iteration: etesian.resetPlacement() + etesian.place() + etesian.destroy() + etesian = None + if editor: + editor.refresh() + editor.fit() + + katana = Katana.KatanaEngine.create( cell ) + katana.setPassNumber( iteration ) + if editor: katana.setViewer( editor ) + katana.digitalInit () + katana.runGlobalRouter( Katana.Flags.ShowBloatedInstances ) + Breakpoint.stop( 1, 'After routing iteration %d' % iteration ) + + if katana.isGlobalRoutingSuccess(): break + iteration += 1 + + if not (katana is None): + katana.loadGlobalRouting( Anabatic.EngineLoadGrByNet ) + katana.layerAssign ( Anabatic.EngineNoNetLayerAssign ) + katana.runNegociate ( Katana.Flags.NoFlags ) + success = katana.isDetailedRoutingSuccess() + + Breakpoint.stop( 1, 'Before finalizing & destroying Katana.' ) + katana.finalizeLayout() + katana.dumpMeasures() + katana.destroy() + katana = None + + #plugins.RSavePlugin.ScriptMain( **kw ) + + except Exception, e: + catch( e ) + + return 0 diff --git a/cumulus/src/plugins/__init__.py b/cumulus/src/plugins/__init__.py index f39ebb18..a8d077ed 100644 --- a/cumulus/src/plugins/__init__.py +++ b/cumulus/src/plugins/__init__.py @@ -18,6 +18,7 @@ import os import sys import Cfg import helpers +from helpers.io import vprint from helpers.io import ErrorMessage from helpers.io import WarningMessage from Hurricane import Contact @@ -228,7 +229,7 @@ def loadPlugins ( pluginsDir ): for moduleName in moduleNames: try: - print ' - "%s"' % moduleName + vprint( 2, ' - "%s"' % moduleName ) module = __import__( moduleName, globals(), locals() ) except ErrorMessage, e: print e @@ -244,16 +245,16 @@ def staticInitialization (): if loaded: return try: - print ' o Preload standard plugins.' + vprint( 1, ' o Preload standard plugins.' ) pluginsDir = os.path.dirname(__file__) loadPlugins( pluginsDir ) if helpers.ndaTopDir: - print ' o Preload NDA protected plugins.' + vprint( 1, ' o Preload NDA protected plugins.' ) pluginsDir = os.path.join( helpers.ndaTopDir, 'python2.7/site-packages/cumulus/plugins' ) loadPlugins( pluginsDir ) else: - print ' o No NDA protected plugins.' + vprint( 1, ' o No NDA protected plugins.' ) except Exception, e: helpers.showPythonTrace( __file__, e ) diff --git a/cumulus/src/plugins/chip/Chip.py b/cumulus/src/plugins/chip/Chip.py index 5e3b1a03..1c793096 100644 --- a/cumulus/src/plugins/chip/Chip.py +++ b/cumulus/src/plugins/chip/Chip.py @@ -233,7 +233,7 @@ class PlaceRoute ( object ): #katana.printConfiguration () katana.digitalInit () #katana.runNegociatePreRouted() - katana.runGlobalRouter () + katana.runGlobalRouter ( Katana.Flags.NoFlags ) katana.loadGlobalRouting ( Anabatic.EngineLoadGrByNet ) katana.layerAssign ( Anabatic.EngineNoNetLayerAssign ) katana.runNegociate ( Katana.Flags.NoFlags ) diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index e9bfbb84..23815537 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.4.0) - set(ignoreVariables "${LIB_SUFFIX}") + set(ignoreVariables "${LIB_SUFFIX} ${CMAKE_INSTALL_DIR}") option(BUILD_DOC "Build the documentation (html+pdf)" OFF) diff --git a/documentation/examples/scripts/rectilinear.py b/documentation/examples/scripts/rectilinear.py new file mode 100644 index 00000000..64480a9f --- /dev/null +++ b/documentation/examples/scripts/rectilinear.py @@ -0,0 +1,82 @@ +#!/usr/bin/python + +import sys +from Hurricane import * +from CRL import * + + +def toDbU ( l ): return DbU.fromLambda(l) +def toMicron ( u ): return DbU.toPhysical( u, DbU.UnitPowerMicro ) + + +def doBreak ( level, message ): + UpdateSession.close() + Breakpoint.stop( level, message ) + UpdateSession.open() + + +def buildRectilinear ( editor ): + UpdateSession.open() + + cell = AllianceFramework.get().createCell( 'Rectilinear' ) + cell.setTerminal( True ) + + cell.setAbutmentBox( Box( toDbU(-5.0), toDbU(-5.0), toDbU(65.0), toDbU(75.0) ) ) + #cell.setAbutmentBox( Box( toDbU(-5.0), toDbU(-5.0), toDbU(21.0), toDbU(35.0) ) ) + + if editor: + UpdateSession.close() + editor.setCell( cell ) + editor.fit() + UpdateSession.open() + + technology = DataBase.getDB().getTechnology() + metal1 = technology.getLayer( "METAL1" ) + metal2 = technology.getLayer( "METAL2" ) + metal3 = technology.getLayer( "METAL3" ) + metal4 = technology.getLayer( "METAL4" ) + poly = technology.getLayer( "POLY" ) + ptrans = technology.getLayer( "PTRANS" ) + ntrans = technology.getLayer( "NTRANS" ) + pdif = technology.getLayer( "PDIF" ) + ndif = technology.getLayer( "NDIF" ) + contdifn = technology.getLayer( "CONT_DIF_N" ) + contdifp = technology.getLayer( "CONT_DIF_P" ) + nwell = technology.getLayer( "NWELL" ) + contpoly = technology.getLayer( "CONT_POLY" ) + ntie = technology.getLayer( "NTIE" ) + + + net = Net.create( cell, 'my_net' ) + net.setExternal( True ) + + points = [ Point( toDbU( 0.0), toDbU( 0.0) ) + , Point( toDbU( 0.0), toDbU( 10.0) ) + , Point( toDbU( 20.0), toDbU( 30.0) ) + , Point( toDbU( 30.0), toDbU( 30.0) ) + , Point( toDbU( 30.0), toDbU( 20.0) ) + , Point( toDbU( 10.0), toDbU( 0.0) ) ] + r = Rectilinear.create( net, metal2, points ) + + + #print 'Normalized and manhattanized contour:' + #i = 0 + #for point in p.getMContour(): + # print '| %d '%i, point \ + # , '[%fum %fum]' % ( toMicron(point.getX()) \ + # , toMicron(point.getY()) ) + # i += 1 + + UpdateSession.close() + + Gds.save( cell ) + return + + +def ScriptMain ( **kw ): + editor = None + if kw.has_key('editor') and kw['editor']: + editor = kw['editor'] + + buildRectilinear( editor ) + return True diff --git a/equinox/CMakeLists.txt b/equinox/CMakeLists.txt index 1903c6e9..7299ec43 100644 --- a/equinox/CMakeLists.txt +++ b/equinox/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.8.9) - set(ignoreVariables "${BUILD_DOC}") + set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) diff --git a/etesian/CMakeLists.txt b/etesian/CMakeLists.txt index 6fd8df07..eb832f03 100644 --- a/etesian/CMakeLists.txt +++ b/etesian/CMakeLists.txt @@ -3,6 +3,8 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0) project(ETESIAN) + set(ignoreVariables "${CMAKE_INSTALL_DIR}") + option(BUILD_DOC "Build the documentation (doxygen)" OFF) cmake_minimum_required(VERSION 2.8.9) @@ -19,9 +21,9 @@ find_package(PythonSitePackages REQUIRED) find_package(VLSISAPD REQUIRED) find_package(HURRICANE REQUIRED) - find_package(KATABATIC REQUIRED) +#find_package(KATABATIC REQUIRED) find_package(CORIOLIS REQUIRED) - find_package(KITE REQUIRED) +#find_package(KITE REQUIRED) find_package(COLOQUINTE REQUIRED) find_package(Libexecinfo REQUIRED) find_package(Doxygen) diff --git a/etesian/src/BloatCells.cpp b/etesian/src/BloatCells.cpp index 651d8944..5b953350 100644 --- a/etesian/src/BloatCells.cpp +++ b/etesian/src/BloatCells.cpp @@ -17,6 +17,7 @@ #include "hurricane/Error.h" #include "hurricane/Warning.h" #include "hurricane/Cell.h" +#include "etesian/BloatProperty.h" #include "etesian/EtesianEngine.h" @@ -172,9 +173,22 @@ namespace Etesian { } - Box BloatCells::getAb ( const Cell* cell ) + Box BloatCells::getAb ( Occurrence instanceOcc ) { - DbU::Unit dx = _selected->getDx( cell, _etesian ); + Instance* instance = dynamic_cast( instanceOcc.getEntity() ); + if (not instance) { + cerr << Error( "BloatCells::getAb(): Occurrence argument do not refer an Instance (skipped).\n" + "(%s)" + , getString(instanceOcc).c_str() ) << endl; + return Box(); + } + + DbU::Unit dx = 0; + Cell* cell = instance->getMasterCell(); + BloatState* state = BloatExtension::get( instanceOcc ); + + if (state) dx = state->getTracksCount() * _etesian->getSliceStep(); + else dx = _selected->getDx( cell, _etesian ); _dxSpace += dx; Box ab = cell->getAbutmentBox(); diff --git a/etesian/src/BloatProperty.cpp b/etesian/src/BloatProperty.cpp new file mode 100644 index 00000000..bc1ef3e7 --- /dev/null +++ b/etesian/src/BloatProperty.cpp @@ -0,0 +1,215 @@ +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC 2019-2019, All Rights Reserved +// +// +-----------------------------------------------------------------+ +// | C O R I O L I S | +// | E t e s i a n - A n a l y t i c P l a c e r | +// | | +// | Author : Jean-Paul CHAPUT | +// | E-mail : Jean-Paul.Chaput@lip6.fr | +// | =============================================================== | +// | C++ Module : "./BloatProperty.cpp" | +// +-----------------------------------------------------------------+ + + +#include "hurricane/Initializer.h" +#include "hurricane/Error.h" +#include "hurricane/Cell.h" +#include "etesian/BloatProperty.h" + + +namespace Etesian { + + using namespace std; + using Hurricane::Property; + using Hurricane::Initializer; + using Hurricane::JsonTypes; + using Hurricane::Error; + + +// ------------------------------------------------------------------- +// Class : "BloatState" + + string BloatState::_getString () const + { + string s; + s += getString(_tracksCount); + return s; + } + + + Record* BloatState::_getRecord () const + { + Record* record = new Record ( "" ); + if (record != NULL) { + record->add( getSlot("_tracksCount", _tracksCount) ); + } + return record; + } + + +// ------------------------------------------------------------------- +// Class : "BloatProperty" + + Name BloatProperty::_name = "Hurricane Bloat State"; + + + BloatProperty* BloatProperty::create () + { + BloatProperty *property = new BloatProperty(); + + property->_postCreate (); + return property; + } + + + void BloatProperty::onReleasedBy ( DBo* owner ) + { + PrivateProperty::onReleasedBy( owner ); + } + + + Name BloatProperty::getPropertyName () + { return _name; } + + + Name BloatProperty::getName () const + { return getPropertyName(); } + + + string BloatProperty::_getTypeName () const + { return "BloatProperty"; } + + + string BloatProperty::_getString () const + { + string s = PrivateProperty::_getString (); + s.insert ( s.length() - 1 , " " + getString(&_state) ); + + return s; + } + + + Record* BloatProperty::_getRecord () const + { + Record* record = PrivateProperty::_getRecord(); + if ( record ) { + record->add( getSlot("_name" , _name ) ); + record->add( getSlot("_state",&_state) ); + } + return record; + } + + + bool BloatProperty::hasJson () const + { return true; } + + + void BloatProperty::toJson ( JsonWriter* w, const DBo* ) const + { + w->startObject(); + jsonWrite( w, "@typename", _getTypeName() ); + jsonWrite( w, "_state" , _state._getString() ); + w->endObject(); + } + + +// ------------------------------------------------------------------- +// Class : "JsonBloatProperty" + + Initializer jsonBloatPropertyInit ( 20 ); + + + JsonBloatProperty::JsonBloatProperty ( unsigned long flags ) + : JsonObject(flags) + { + add( "_state", typeid(string) ); + } + + + string JsonBloatProperty::getTypeName () const + { return "BloatProperty"; } + + + void JsonBloatProperty::initialize () + { JsonTypes::registerType( new JsonBloatProperty (JsonWriter::RegisterMode) ); } + + + JsonBloatProperty* JsonBloatProperty::clone ( unsigned long flags ) const + { return new JsonBloatProperty ( flags ); } + + + void JsonBloatProperty::toData ( JsonStack& stack ) + { + check( stack, "JsonBloatProperty::toData" ); + + uint32_t tracksCount = get( stack, "_state" ); + BloatProperty* property = NULL; + DBo* dbo = stack.back_dbo(); + + if (dbo) { + Cell* cell = dynamic_cast( dbo ); + if (cell) { + property = dynamic_cast( cell->getProperty( BloatProperty::getPropertyName() ) ); + if (property) { + cerr << Error( "JsonBloatProperty::toData(): %s has already a BloatProperty (overwrite)." + , getString(cell).c_str() + ) << endl; + BloatState* state = property->getState(); + state->setTracksCount( tracksCount ); + } else { + property = BloatProperty::create(); + property->getState()->setTracksCount( tracksCount ); + cell->put( property ); + } + } else { + cerr << Error( "JsonBloatProperty::toData(): %s must be a Cell." + , getString(dbo).c_str() + ) << endl; + } + } else { + cerr << Error( "JsonBloatProperty::toData(): No DBo in stack to attach to." ) << endl; + } + + update( stack, property ); + } + + +// ------------------------------------------------------------------- +// Class : "BloatExtension" + + + Occurrence BloatExtension::_owner; + BloatState* BloatExtension::_cache = NULL; + + + BloatState* BloatExtension::get ( Occurrence o ) + { + if (o == _owner) return _cache; + _owner = o; + + Property* property = _owner.getProperty( BloatProperty::getPropertyName() ); + if (property) _cache = static_cast(property)->getState(); + else _cache = NULL; + + return _cache; + } + + + BloatState* BloatExtension::create ( Occurrence o, size_t tracksCount ) + { + get( o ); + if (not _cache) { + BloatProperty* property = new BloatProperty(); + o.put( property ); + + _cache = property->getState(); + } + _cache->setTracksCount( tracksCount ); + return _cache; + } + + +} // Etesian namespace. diff --git a/etesian/src/CMakeLists.txt b/etesian/src/CMakeLists.txt index 14e0fb84..bb4d21d4 100644 --- a/etesian/src/CMakeLists.txt +++ b/etesian/src/CMakeLists.txt @@ -13,6 +13,7 @@ set( includes etesian/Configuration.h etesian/FeedCells.h etesian/BloatCells.h + etesian/BloatProperty.h etesian/EtesianEngine.h etesian/GraphicEtesianEngine.h ) @@ -24,6 +25,7 @@ AddFeeds.cpp FeedCells.cpp BloatCells.cpp + BloatProperty.cpp EtesianEngine.cpp GraphicEtesianEngine.cpp ) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 0deb8901..221a023c 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -42,9 +42,6 @@ #include "hurricane/UpdateSession.h" #include "hurricane/viewer/CellWidget.h" #include "hurricane/viewer/CellViewer.h" -#include "katabatic/GCellGrid.h" -#include "katabatic/KatabaticEngine.h" -#include "kite/KiteEngine.h" #include "crlcore/Utilities.h" #include "crlcore/Measures.h" #include "crlcore/AllianceFramework.h" @@ -257,7 +254,6 @@ namespace Etesian { : Super (cell) , _configuration(new Configuration()) , _block (NULL) - , _placed (false) , _ySpinSet (false) , _flatDesign (false) , _surface () @@ -269,6 +265,9 @@ namespace Etesian { , _viewer (NULL) , _feedCells (this) , _bloatCells (this) + , _yspinSlice0 (0) + , _sliceHeight (0) + , _fixedAbHeight(0) { } @@ -317,6 +316,8 @@ namespace Etesian { EtesianEngine* EtesianEngine::create ( Cell* cell ) { + if (not cell) throw Error( "EtesianEngine::create(): NULL cell argument." ); + EtesianEngine* etesian = new EtesianEngine ( cell ); etesian->_postCreate(); @@ -378,15 +379,25 @@ namespace Etesian { continue; } - cellLength += DbU::toLambda( _bloatCells.getAb( masterCell ).getWidth() ); + cellLength += DbU::toLambda( _bloatCells.getAb( occurrence ).getWidth() ); instanceNb += 1; } + if (cellLength < 0) + throw Error( "EtesianEngine::setDefaultAb(): Negative surface area computed for \"%s\" (bad bloat profile?)." + , getString(getCell()->getName()).c_str() + ); + double bloatLength = DbU::toLambda( _bloatCells.getDxSpace() ); double bloatMargin = ( cellLength / (cellLength - bloatLength) ) - 1.0; double gcellLength = cellLength*(1.0+spaceMargin) / DbU::toLambda( getSliceHeight() ); - double rows = std::ceil( sqrt( gcellLength/aspectRatio ) ); + + double rows = 0.0; + setFixedAbHeight( 0 ); + if (getFixedAbHeight()) rows = getFixedAbHeight() / getSliceHeight(); + else rows = std::ceil( sqrt( gcellLength/aspectRatio ) ); + double columns = std::ceil( gcellLength / rows ); UpdateSession::open(); @@ -421,7 +432,7 @@ namespace Etesian { { //cerr << "EtesianEngine::resetPlacement()" << endl; - if (not _placed) return; + if (not getBlockCell()->isPlaced()) return; _flatDesign = true; Dots dots ( cmess2, " ", 80, 1000 ); @@ -442,23 +453,23 @@ namespace Etesian { Cell* masterCell = instance->getMasterCell(); string instanceName = occurrence.getCompactString(); - if (CatalogExtension::isFeed(masterCell)) { + if (CatalogExtension::isFeed(masterCell)) feedOccurrences.push_back( occurrence ); - } } for ( auto ioccurrence : feedOccurrences ) { - cerr << " Destroy: " << ioccurrence.getCompactString() << endl; Instance* instance = static_cast(ioccurrence.getEntity()); instance->destroy(); } + if (not getBlockCell()->getAbutmentBox().isEmpty() ) + setFixedAbHeight( getBlockCell()->getAbutmentBox().getHeight() ); + getBlockCell()->setAbutmentBox( Box() ); + getBlockCell()->resetFlags( Cell::Flags::Placed ); UpdateSession::close(); dots.finish( Dots::Reset ); if (_viewer) _viewer->getCellWidget()->refresh(); - - _placed = false; } @@ -477,10 +488,7 @@ namespace Etesian { Dots dots ( cmess2, " ", 80, 1000 ); if (not cmess2.enabled()) dots.disable(); - size_t instancesNb = 1; // One dummy fixed instance at the end - for ( Occurrence occurrence : getCell()->getLeafInstanceOccurrences(getBlockInstance()) ) { - ++instancesNb; - } + size_t instancesNb = getCell()->getLeafInstanceOccurrences(getBlockInstance()).getSize() + 1; // One dummy fixed instance at the end // Coloquinte circuit description data-structures. vector idsToTransf ( instancesNb ); @@ -543,7 +551,7 @@ namespace Etesian { continue; } - Box instanceAb = _bloatCells.getAb( masterCell ); + Box instanceAb = _bloatCells.getAb( occurrence ); Transformation instanceTransf = instance->getTransformation(); occurrence.getPath().getTransformation().applyOn( instanceTransf ); @@ -678,6 +686,7 @@ namespace Etesian { _placementUB = _placementLB; } + void EtesianEngine::adjustSliceHeight () { /* @@ -715,6 +724,7 @@ namespace Etesian { } } + void EtesianEngine::preplace () { using namespace coloquinte::gp; @@ -764,51 +774,6 @@ namespace Etesian { } - void EtesianEngine::feedRoutingBack () - { - using namespace Katabatic; - using namespace Kite; - /* - * If routing information is present, use it to - * * artificially expand the areas given to coloquinte - * * add placement dentity constraints - */ - DbU::Unit hpitch = getHorizontalPitch(); - DbU::Unit vpitch = getSliceStep(); - const float densityThreshold = 0.9; - - KiteEngine* routingEngine = KiteEngine::get( getCell() ); - if(routingEngine == NULL) - throw Error("No routing information was found when performing routing-driven placement\n"); - - GCellGrid * grid = routingEngine->getGCellGrid(); - // Get information about the GCells - // Create different densities - - _densityLimits.clear(); - for(GCell* gc : grid->getGCells()){ - float density = gc->getMaxHVDensity(); - if(density >= densityThreshold){ - - coloquinte::density_limit cur; - cur.box_ = coloquinte::box( - gc->getX() / vpitch, - gc->getXMax() / vpitch, - gc->getY() / hpitch, - gc->getYMax() / hpitch - ); - cur.density_ = densityThreshold/density; - _densityLimits.push_back(cur); - } - } - - // TODO: Careful to keep the densities high enough - // Will just fail later if the densities are too high - - // Expand areas: TODO - } - - void EtesianEngine::globalPlace ( float initPenalty , float minDisruption , float targetImprovement @@ -968,7 +933,6 @@ namespace Etesian { Effort placementEffort = getPlaceEffort(); GraphicUpdate placementUpdate = getUpdateConf(); Density densityConf = getSpreadingConf(); - bool routingDriven = getRoutingDriven(); double sliceHeight = getSliceHeight() / getHorizontalPitch(); cmess1 << " o Running Coloquinte." << endl; @@ -1026,30 +990,6 @@ namespace Etesian { cmess1 << " o Detailed Placement." << endl; detailedPlace(detailedIterations, detailedEffort, detailedOptions); - if(routingDriven){ - bool success = false; - int routingDrivenIteration = 0; - using namespace Kite; - while(true){ - cmess2 << "Routing-driven placement iteration " << routingDrivenIteration << endl; - KiteEngine* kiteE = KiteEngine::create(_cell); - kiteE->runGlobalRouter(0); - kiteE->loadGlobalRouting(Katabatic::EngineLoadGrByNet); - kiteE->balanceGlobalDensity(); - kiteE->layerAssign(Katabatic::EngineNoNetLayerAssign); - kiteE->runNegociate(); - success = kiteE->getToolSuccess(); - feedRoutingBack(); - kiteE->destroy(); - KiteEngine::wipeoutRouting(_cell); - if(success){ - cmess2 << "The design is routable; exiting" << endl; - break; - } - detailedPlace(detailedIterations, detailedEffort, detailedOptions); - } - } - cmess2 << " o Adding feed cells." << endl; addFeeds(); @@ -1061,8 +1001,6 @@ namespace Etesian { cmess1 << ::Dots::asString ( " - RMST", DbU::getValueString( (DbU::Unit)coloquinte::gp::get_RSMT_wirelength(_circuit,_placementUB )*getSliceStep() ) ) << endl; - _placed = true; - UpdateSession::open(); for ( Net* net : getCell()->getNets() ) { for ( RoutingPad* rp : net->getComponents().getSubSet() ) { diff --git a/etesian/src/PyEtesianEngine.cpp b/etesian/src/PyEtesianEngine.cpp index cbac3131..7d78bcc0 100644 --- a/etesian/src/PyEtesianEngine.cpp +++ b/etesian/src/PyEtesianEngine.cpp @@ -68,6 +68,7 @@ extern "C" { DirectVoidMethod(EtesianEngine,etesian,setDefaultAb) + DirectVoidMethod(EtesianEngine,etesian,resetPlacement) static PyObject* PyEtesianEngine_get ( PyObject*, PyObject* args ) @@ -207,6 +208,8 @@ extern "C" { , "Set the sub-block (Instance) to place." } , { "setDefaultAb" , (PyCFunction)PyEtesianEngine_setDefaultAb , METH_NOARGS , "Compute and set the abutment box using the aspect ratio and the space margin." } + , { "resetPlacement" , (PyCFunction)PyEtesianEngine_resetPlacement , METH_NOARGS + , "Compute and set the abutment box using the aspect ratio and the space margin." } , { "place" , (PyCFunction)PyEtesianEngine_place , METH_NOARGS , "Run the placer (Etesian)." } , { "destroy" , (PyCFunction)PyEtesianEngine_destroy , METH_NOARGS diff --git a/etesian/src/etesian/BloatCells.h b/etesian/src/etesian/BloatCells.h index 6d9cb6d4..8bce2c13 100644 --- a/etesian/src/etesian/BloatCells.h +++ b/etesian/src/etesian/BloatCells.h @@ -26,6 +26,7 @@ namespace Etesian { using Hurricane::Box; using Hurricane::Cell; + using Hurricane::Occurrence; class EtesianEngine; @@ -105,7 +106,7 @@ namespace Etesian { inline BloatCells ( EtesianEngine* ); inline ~BloatCells (); bool select ( std::string ); - Box getAb ( const Cell* ); + Box getAb ( Occurrence ); inline DbU::Unit getDxSpace () const; inline void resetDxSpace (); private: diff --git a/etesian/src/etesian/BloatProperty.h b/etesian/src/etesian/BloatProperty.h new file mode 100644 index 00000000..518f48f6 --- /dev/null +++ b/etesian/src/etesian/BloatProperty.h @@ -0,0 +1,147 @@ +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC 2019-2019, All Rights Reserved +// +// +-----------------------------------------------------------------+ +// | C O R I O L I S | +// | E t e s i a n - A n a l y t i c P l a c e r | +// | | +// | Author : Jean-Paul CHAPUT | +// | E-mail : Jean-Paul.Chaput@lip6.fr | +// | =============================================================== | +// | C++ Header : "./katabatic/BloatProperty.h" | +// +-----------------------------------------------------------------+ + + +#ifndef HURRICANE_BLOAT_PROPERTY_H +#define HURRICANE_BLOAT_PROPERTY_H + +#include +#include +#include "hurricane/Name.h" +#include "hurricane/Property.h" +#include "hurricane/Occurrence.h" +#include "hurricane/Slot.h" + + +namespace Etesian { + + using Hurricane::Name; + using Hurricane::DBo; + using Hurricane::Cell; + using Hurricane::Record; + using Hurricane::PrivateProperty; + using Hurricane::JsonObject; + using Hurricane::JsonStack; + using Hurricane::Occurrence; + class BloatProperty; + class JsonBloatProperty; + + +// ------------------------------------------------------------------- +// Class : "Etesian::BloatState". + + class BloatState { + friend class BloatProperty; + friend class BloatExtension; + friend class JsonBloatProperty; + public: + inline void setTracksCount ( size_t ); + inline size_t getTracksCount () const; + std::string _getString () const; + Record* _getRecord () const; + private: + inline BloatState ( size_t ); + BloatState ( const BloatState& ) = delete; + private: + size_t _tracksCount; + }; + + + inline BloatState::BloatState ( size_t tracksCount ) : _tracksCount(tracksCount) { } + + inline void BloatState::setTracksCount ( size_t tracksCount ) { _tracksCount=tracksCount; } + inline size_t BloatState::getTracksCount () const { return _tracksCount; } + + +// ------------------------------------------------------------------- +// Class : "Etesian::BloatProperty". + + class BloatProperty : public PrivateProperty { + friend class BloatExtension; + public: + static Name _name; + public: + static BloatProperty* create (); + static Name getPropertyName (); + virtual Name getName () const; + inline BloatState* getState (); + virtual void onReleasedBy ( DBo* owner ); + virtual bool hasJson () const; + virtual void toJson ( JsonWriter*, const DBo* ) const; + virtual std::string _getTypeName () const; + virtual std::string _getString () const; + virtual Record* _getRecord () const; + protected: + // Attributes. + BloatState _state; + protected: + // Constructor. + inline BloatProperty (); + }; + + + inline BloatProperty::BloatProperty () : PrivateProperty(), _state(0) { } + inline BloatState* BloatProperty::getState () { return &_state; } + + +// ------------------------------------------------------------------- +// Class : "Etesian::JsonBloatProperty". + + class JsonBloatProperty : public JsonObject { + public: + static void initialize (); + JsonBloatProperty ( unsigned long ); + virtual std::string getTypeName () const; + virtual JsonBloatProperty* clone ( unsigned long ) const; + virtual void toData ( JsonStack& ); + }; + + +// ------------------------------------------------------------------- +// Class : "Etesian::BloatExtension". + + class BloatExtension { + public: + static inline size_t getTracksCount ( Occurrence ); + static inline void setTracksCount ( Occurrence, size_t ); + static BloatState* get ( Occurrence ); + static BloatState* create ( Occurrence, size_t tracksCount=0 ); + private: + static Occurrence _owner; + static BloatState* _cache; + }; + + + inline size_t BloatExtension::getTracksCount ( Occurrence o ) + { + BloatState* state = get( o ); + return (state) ? state->getTracksCount() : 0; + } + + + inline void BloatExtension::setTracksCount ( Occurrence o, size_t tracksCount ) + { + BloatState* state = get( o ); + if (state) state->setTracksCount( tracksCount ); + } + + +} // Etesian namespace. + + +INSPECTOR_P_SUPPORT(Etesian::BloatState); + + +#endif // HURRICANE_BLOAT_PROPERTY_H diff --git a/etesian/src/etesian/EtesianEngine.h b/etesian/src/etesian/EtesianEngine.h index 4f3e72b9..ee35e595 100644 --- a/etesian/src/etesian/EtesianEngine.h +++ b/etesian/src/etesian/EtesianEngine.h @@ -69,10 +69,10 @@ namespace Etesian { inline DbU::Unit getVerticalPitch () const; inline DbU::Unit getSliceHeight () const; inline DbU::Unit getSliceStep () const; + inline DbU::Unit getFixedAbHeight () const; inline Effort getPlaceEffort () const; inline GraphicUpdate getUpdateConf () const; inline Density getSpreadingConf () const; - inline bool getRoutingDriven () const; inline double getSpaceMargin () const; inline double getAspectRatio () const; inline const FeedCells& getFeedCells () const; @@ -81,6 +81,7 @@ namespace Etesian { inline Cell* getBlockCell () const; inline Instance* getBlockInstance () const; inline void setBlock ( Instance* ); + inline void setFixedAbHeight ( DbU::Unit ); void setDefaultAb (); void adjustSliceHeight (); void resetPlacement (); @@ -89,7 +90,6 @@ namespace Etesian { void roughLegalize ( float minDisruption, unsigned options ); void globalPlace ( float initPenalty, float minDisruption, float targetImprovement, float minInc, float maxInc, unsigned options=0 ); void detailedPlace ( int iterations, int effort, unsigned options=0 ); - void feedRoutingBack (); void place (); inline void useFeed ( Cell* ); size_t findYSpin (); @@ -119,6 +119,7 @@ namespace Etesian { BloatCells _bloatCells; size_t _yspinSlice0; DbU::Unit _sliceHeight; + DbU::Unit _fixedAbHeight; protected: // Constructors & Destructors. @@ -145,10 +146,10 @@ namespace Etesian { inline DbU::Unit EtesianEngine::getVerticalPitch () const { return getGauge()->getVerticalPitch(); } inline DbU::Unit EtesianEngine::getSliceHeight () const { return _sliceHeight; } inline DbU::Unit EtesianEngine::getSliceStep () const { return getCellGauge()->getSliceStep(); } + inline DbU::Unit EtesianEngine::getFixedAbHeight () const { return _fixedAbHeight; } inline Effort EtesianEngine::getPlaceEffort () const { return getConfiguration()->getPlaceEffort(); } inline GraphicUpdate EtesianEngine::getUpdateConf () const { return getConfiguration()->getUpdateConf(); } inline Density EtesianEngine::getSpreadingConf () const { return getConfiguration()->getSpreadingConf(); } - inline bool EtesianEngine::getRoutingDriven () const { return getConfiguration()->getRoutingDriven(); } inline double EtesianEngine::getSpaceMargin () const { return getConfiguration()->getSpaceMargin(); } inline double EtesianEngine::getAspectRatio () const { return getConfiguration()->getAspectRatio(); } inline void EtesianEngine::useFeed ( Cell* cell ) { _feedCells.useFeed(cell); } @@ -157,7 +158,8 @@ namespace Etesian { inline Cell* EtesianEngine::getBlockCell () const { return (_block) ? _block->getMasterCell() : getCell(); } inline Instance* EtesianEngine::getBlockInstance () const { return _block; } - inline void EtesianEngine::setBlock ( Instance* block ) { _block = block; } + inline void EtesianEngine::setBlock ( Instance* block ) { _block = block; _placed = _block->getMasterCell()->isPlaced(); } + inline void EtesianEngine::setFixedAbHeight ( DbU::Unit abHeight ) { _fixedAbHeight = abHeight; } // Variables. extern const char* missingEtesian; diff --git a/flute/CMakeLists.txt b/flute/CMakeLists.txt index b876818e..5710a536 100644 --- a/flute/CMakeLists.txt +++ b/flute/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required( VERSION 2.8.9 ) - set( ignoreVariables "${BUILD_DOC}" ) + set( ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}" ) list( INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/" ) find_package( Bootstrap REQUIRED ) diff --git a/hurricane/CMakeLists.txt b/hurricane/CMakeLists.txt index 7b44959e..e875ab64 100644 --- a/hurricane/CMakeLists.txt +++ b/hurricane/CMakeLists.txt @@ -3,6 +3,8 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0) project(HURRICANE) + set(ignoreVariables "${CMAKE_INSTALL_DIR}") + option(BUILD_DOC "Build the documentation (doxygen)" OFF) cmake_minimum_required(VERSION 2.8.9) diff --git a/hurricane/src/analog/AnalogCellExtension.cpp b/hurricane/src/analog/AnalogCellExtension.cpp index b967b1d6..5c8ed3cf 100644 --- a/hurricane/src/analog/AnalogCellExtension.cpp +++ b/hurricane/src/analog/AnalogCellExtension.cpp @@ -24,6 +24,14 @@ #include "hurricane/analog/AnalogCellExtension.h" +namespace Hurricane { + + template<> + Name StandardPrivateProperty::_name = "Analog::CellExtension"; + +} // Hurricane namespace. + + namespace Analog { using namespace std; @@ -43,10 +51,6 @@ namespace Analog { string AnalogData::_getString () const { return ""; } - - - template<> - Name StandardPrivateProperty::_name = "Analog::CellExtension"; AnalogCellExtensionDatas::AnalogCellExtensionDatas () diff --git a/hurricane/src/analog/CapacitorFamily.cpp b/hurricane/src/analog/CapacitorFamily.cpp index c8cc0c6f..14eaea7c 100644 --- a/hurricane/src/analog/CapacitorFamily.cpp +++ b/hurricane/src/analog/CapacitorFamily.cpp @@ -24,8 +24,6 @@ namespace Analog { : Super(library,name) , _type (type) , _referenceCapacitor(NULL) - , _operatorIndex (0) - , _row (0) { } diff --git a/hurricane/src/analog/PyMatrix.cpp b/hurricane/src/analog/PyMatrix.cpp index 90773cd4..fce55f02 100644 --- a/hurricane/src/analog/PyMatrix.cpp +++ b/hurricane/src/analog/PyMatrix.cpp @@ -42,7 +42,6 @@ extern "C" { { unsigned int rows = 0; unsigned int columns = 0; - Matrix* matrix = NULL; PyMatrix* pyMatrix = NULL; HTRY @@ -168,6 +167,14 @@ extern "C" { PyTypeObjectDefinitions(Matrix) +#endif // End of Shared Library Code Part. + +} // extern "C". + + +#if !defined(__PYTHON_MODULE__) + + extern Matrix Matrix_FromListOfList ( PyObject* pyLoList ) { Matrix matrix; @@ -218,9 +225,6 @@ extern "C" { return matrix; } - -#endif // End of Shared Library Code Part. - -} // extern "C". +#endif } // Isobar namespace. diff --git a/hurricane/src/analog/hurricane/analog/AnalogCellExtension.h b/hurricane/src/analog/hurricane/analog/AnalogCellExtension.h index 4ac7be55..a6d993b9 100644 --- a/hurricane/src/analog/hurricane/analog/AnalogCellExtension.h +++ b/hurricane/src/analog/hurricane/analog/AnalogCellExtension.h @@ -117,4 +117,13 @@ namespace Analog { } // Analog namespace. + +namespace Hurricane { + + template<> + Name StandardPrivateProperty::_name; + +} // Hurricane namespace. + + #endif // ANALOG_CELL_EXTENSION_H diff --git a/hurricane/src/analog/hurricane/analog/CapacitorFamily.h b/hurricane/src/analog/hurricane/analog/CapacitorFamily.h index 97de2546..465d7b97 100644 --- a/hurricane/src/analog/hurricane/analog/CapacitorFamily.h +++ b/hurricane/src/analog/hurricane/analog/CapacitorFamily.h @@ -58,8 +58,6 @@ namespace Analog { private: const Type _type; MetaCapacitor* _referenceCapacitor; - int _operatorIndex; - int _row; }; inline MetaCapacitor* CapacitorFamily::getReferenceCapacitor () { return _referenceCapacitor; } diff --git a/hurricane/src/analog/hurricane/analog/PyMatrix.h b/hurricane/src/analog/hurricane/analog/PyMatrix.h index 1855f338..b017490a 100644 --- a/hurricane/src/analog/hurricane/analog/PyMatrix.h +++ b/hurricane/src/analog/hurricane/analog/PyMatrix.h @@ -41,7 +41,6 @@ extern "C" { extern PyMethodDef PyMatrix_Methods[]; extern void PyMatrix_LinkPyType (); - extern Analog::Matrix Matrix_FromListOfList ( PyObject* ); #define IsPyMatrix(v) ( (v)->ob_type == &PyTypeMatrix ) @@ -51,6 +50,8 @@ extern "C" { } // extern "C". + extern Analog::Matrix Matrix_FromListOfList ( PyObject* ); + } // Isobar namespace. #endif // ANALOG_PY_MATRIX_H diff --git a/hurricane/src/hurricane/Breakpoint.cpp b/hurricane/src/hurricane/Breakpoint.cpp index eaefc80a..46b7701f 100644 --- a/hurricane/src/hurricane/Breakpoint.cpp +++ b/hurricane/src/hurricane/Breakpoint.cpp @@ -23,8 +23,7 @@ // // $Id$ // -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -32,10 +31,7 @@ // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Module : "./Breakpoint.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ # include "hurricane/Breakpoint.h" @@ -133,7 +129,7 @@ namespace Hurricane { bool Breakpoint::_stop ( unsigned int level, const string& message ) { - if ( _stopCb && ( level >= _stopLevel ) ) + if ( _stopCb && ( level <= _stopLevel ) ) return _stopCb ( message ); return false; diff --git a/hurricane/src/hurricane/DBo.cpp b/hurricane/src/hurricane/DBo.cpp index 382828a9..f24c9cba 100644 --- a/hurricane/src/hurricane/DBo.cpp +++ b/hurricane/src/hurricane/DBo.cpp @@ -142,7 +142,7 @@ namespace Hurricane { } - DBo::~DBo () + DBo::~DBo () throw(Error) { } diff --git a/hurricane/src/hurricane/DeepNet.cpp b/hurricane/src/hurricane/DeepNet.cpp index 86f78c15..ba9cf57b 100644 --- a/hurricane/src/hurricane/DeepNet.cpp +++ b/hurricane/src/hurricane/DeepNet.cpp @@ -89,7 +89,7 @@ namespace Hurricane { HyperNet hyperNet ( _netOccurrence ); RoutingPad* currentRp = NULL; bool createRp = true; - unsigned int rpFlags = (flags & Cell::Flags::StayOnPlugs) ? 0 : RoutingPad::BiggestArea; + //unsigned int rpFlags = (flags & Cell::Flags::StayOnPlugs) ? 0 : RoutingPad::BiggestArea; for ( Occurrence occurrence : hyperNet.getComponentOccurrences() ) { RoutingPad* rp = dynamic_cast(occurrence.getEntity()); diff --git a/hurricane/src/hurricane/Entity.cpp b/hurricane/src/hurricane/Entity.cpp index f8c1a5d8..c00674e6 100644 --- a/hurricane/src/hurricane/Entity.cpp +++ b/hurricane/src/hurricane/Entity.cpp @@ -38,6 +38,10 @@ namespace Hurricane { { } + Entity::~Entity() throw(Error) + { } + + void Entity::_postCreate() { Inherit::_postCreate(); diff --git a/hurricane/src/hurricane/Go.cpp b/hurricane/src/hurricane/Go.cpp index 8f2c26d6..913b170e 100644 --- a/hurricane/src/hurricane/Go.cpp +++ b/hurricane/src/hurricane/Go.cpp @@ -38,6 +38,9 @@ Go::Go() { } +Go::~Go() throw(Error) +{ } + bool Go::autoMaterializationIsDisabled() // ************************************* { diff --git a/hurricane/src/hurricane/Hook.cpp b/hurricane/src/hurricane/Hook.cpp index cadca6ae..afa4890b 100644 --- a/hurricane/src/hurricane/Hook.cpp +++ b/hurricane/src/hurricane/Hook.cpp @@ -196,8 +196,8 @@ Hook::Hook() { } -Hook::~Hook() -// ********** +Hook::~Hook() throw(Error) +// *********************** { if (_nextHook != this) throw Error("Abnormal deletion of hook : always attached"); diff --git a/hurricane/src/hurricane/Rectilinear.cpp b/hurricane/src/hurricane/Rectilinear.cpp index de8109c3..e43d0062 100644 --- a/hurricane/src/hurricane/Rectilinear.cpp +++ b/hurricane/src/hurricane/Rectilinear.cpp @@ -62,9 +62,12 @@ namespace Hurricane { for ( size_t i=0 ; igetLayer(_basicLayer->getMask()); } - DbU::Unit RegularLayer::getEnclosure () const + DbU::Unit RegularLayer::getEnclosure ( uint32_t ) const { return _enclosure; } @@ -247,7 +247,7 @@ namespace Hurricane { { return _extentionWidth; } - DbU::Unit RegularLayer::getEnclosure ( const BasicLayer* layer ) const + DbU::Unit RegularLayer::getEnclosure ( const BasicLayer* layer, uint32_t ) const { return (layer == _basicLayer) ? _enclosure : 0; } @@ -284,7 +284,7 @@ namespace Hurricane { } - void RegularLayer::setEnclosure ( const BasicLayer* layer, DbU::Unit enclosure ) + void RegularLayer::setEnclosure ( const BasicLayer* layer, DbU::Unit enclosure, uint32_t ) { if ( _basicLayer == layer ) _enclosure = enclosure; } diff --git a/hurricane/src/hurricane/Technology.cpp b/hurricane/src/hurricane/Technology.cpp index 7da97db8..56ee3ccf 100644 --- a/hurricane/src/hurricane/Technology.cpp +++ b/hurricane/src/hurricane/Technology.cpp @@ -64,6 +64,8 @@ namespace { inline string quote ( Name field ) { return "'"+getString(field)+"'"; } +#if THIS_IS_DISABLED + void printRule ( const PhysicalRule* rule ) { cout << " - name = " << rule->getName() @@ -79,6 +81,8 @@ namespace { void printRules ( const Technology::TwoLayersRulesSet& rules ) { for ( TwoLayersPhysicalRule* rule : rules ) printRule( rule ); } +#endif + } // Anonymous namespace. diff --git a/hurricane/src/hurricane/hurricane/Commons.h b/hurricane/src/hurricane/hurricane/Commons.h index c2f7d4f3..b8ba0601 100644 --- a/hurricane/src/hurricane/hurricane/Commons.h +++ b/hurricane/src/hurricane/hurricane/Commons.h @@ -163,10 +163,8 @@ namespace Hurricane { // Forward declaration of "getSlot<>()" template. -template inline Hurricane::Slot* getSlot ( std::string& name, Data ); -template inline Hurricane::Slot* getSlot ( std::string& name, Data* ); -template inline Hurricane::Slot* getSlot ( const std::string& name, Data ); -template inline Hurricane::Slot* getSlot ( const std::string& name, Data* ); +template inline Hurricane::Slot* getSlot ( std::string name, Data ); +template inline Hurricane::Slot* getSlot ( std::string name, Data* ); // ------------------------------------------------------------------- @@ -344,8 +342,8 @@ inline Hurricane::Record* getRecord ( const std::pair& p ) { Hurricane::Record* record = NULL; record = new Hurricane::Record ( "const std::pair" ); - record->add( getSlot("first" , &p.first ) ); - record->add( getSlot("second", &p.second) ); + record->add( getSlot(std::string("first" ), &p.first ) ); + record->add( getSlot(std::string("second"), &p.second) ); return record; } @@ -362,8 +360,8 @@ inline Hurricane::Record* getRecord ( std::pair& p ) { Hurricane::Record* record = NULL; record = new Hurricane::Record ( "std::pair" ); - record->add( getSlot("first" , &p.first ) ); - record->add( getSlot("second", &p.second) ); + record->add( getSlot(std::string("first" ), &p.first ) ); + record->add( getSlot(std::string("second"), &p.second) ); return record; } diff --git a/hurricane/src/hurricane/hurricane/DBo.h b/hurricane/src/hurricane/hurricane/DBo.h index 4a4096d4..1bdd6c00 100644 --- a/hurricane/src/hurricane/hurricane/DBo.h +++ b/hurricane/src/hurricane/hurricane/DBo.h @@ -32,6 +32,7 @@ #ifndef HURRICANE_DBO_H #define HURRICANE_DBO_H +#include "hurricane/Error.h" #include "hurricane/DBos.h" #include "hurricane/Name.h" #include "hurricane/Properties.h" @@ -81,12 +82,12 @@ namespace Hurricane { void toJsonSignature ( JsonWriter* ) const; protected: DBo (); - virtual ~DBo (); + virtual ~DBo () throw(Error); virtual void _postCreate (); virtual void _preDestroy (); private: - DBo ( const DBo& ); - DBo& operator= ( const DBo& ); + DBo ( const DBo& ) = delete; + DBo& operator= ( const DBo& ) = delete; private: static unsigned int _memoryLimit; static unsigned long _flags; @@ -97,7 +98,8 @@ namespace Hurricane { mutable set _propertySet; public: struct CompareById : public std::binary_function { - inline bool operator() ( const DBo* lhs, const DBo* rhs ) const; + template + inline bool operator() ( const Key* lhs, const Key* rhs ) const; }; }; @@ -107,7 +109,8 @@ namespace Hurricane { inline bool DBo::hasProperty () const { return !_propertySet.empty(); } inline unsigned int DBo::getId () const { return _id; } - inline bool DBo::CompareById::operator() ( const DBo* lhs, const DBo* rhs ) const + template + inline bool DBo::CompareById::operator() ( const Key* lhs, const Key* rhs ) const { return ((lhs)?lhs->getId():0) < ((rhs)?rhs->getId():0); } diff --git a/hurricane/src/hurricane/hurricane/Entity.h b/hurricane/src/hurricane/hurricane/Entity.h index 02e206ed..3316a36b 100644 --- a/hurricane/src/hurricane/hurricane/Entity.h +++ b/hurricane/src/hurricane/hurricane/Entity.h @@ -48,6 +48,7 @@ namespace Hurricane { Quark* _getQuark ( SharedPath* sharedPath = NULL ) const; protected: Entity (); + virtual ~Entity () throw(Error); virtual void _postCreate (); virtual void _preDestroy (); }; diff --git a/hurricane/src/hurricane/hurricane/Go.h b/hurricane/src/hurricane/hurricane/Go.h index 8ac80c12..fc253a44 100644 --- a/hurricane/src/hurricane/hurricane/Go.h +++ b/hurricane/src/hurricane/hurricane/Go.h @@ -56,6 +56,7 @@ class Go : public Entity { // ************ protected: Go(); + protected: virtual ~Go() throw(Error); // Predicates // ********** diff --git a/hurricane/src/hurricane/hurricane/Hook.h b/hurricane/src/hurricane/hurricane/Hook.h index 240902d3..ebafd20d 100644 --- a/hurricane/src/hurricane/hurricane/Hook.h +++ b/hurricane/src/hurricane/hurricane/Hook.h @@ -20,6 +20,7 @@ #ifndef HURRICANE_HOOK #define HURRICANE_HOOK +#include "hurricane/Error.h" #include "hurricane/Hooks.h" namespace Hurricane { @@ -53,7 +54,7 @@ class Hook { // Destructor // ********** - protected: virtual ~Hook(); + protected: virtual ~Hook() throw(Error); // Operators // ********* diff --git a/hurricane/src/hurricane/hurricane/RbTree.h b/hurricane/src/hurricane/hurricane/RbTree.h index 5e527a6e..ef9d3cc2 100644 --- a/hurricane/src/hurricane/hurricane/RbTree.h +++ b/hurricane/src/hurricane/hurricane/RbTree.h @@ -63,7 +63,7 @@ namespace Hurricane { class Node { public: inline Node ( const Data& value, Node* parent ); - inline ~Node (); + virtual ~Node (); inline bool isRed () const; inline bool isBlack () const; inline bool isRoot () const; @@ -205,7 +205,7 @@ namespace Hurricane { { } template< typename Data, typename Compare > - inline RbTree::Node::~Node () + RbTree::Node::~Node () { } template< typename Data, typename Compare >inline bool RbTree::Node::isRed () const { return not isBlack(); } @@ -1027,7 +1027,7 @@ namespace Hurricane { template< typename Data, typename Compare > inline void RbTree::write ( std::string path ) const - { RbTreeToDot(this).write( path ); } + { RbTreeToDot< Data, Compare, RbTree >(this).write( path ); } } // Hurricane namespace. diff --git a/hurricane/src/hurricane/hurricane/RegularLayer.h b/hurricane/src/hurricane/hurricane/RegularLayer.h index a6a236d5..9faf65a9 100644 --- a/hurricane/src/hurricane/hurricane/RegularLayer.h +++ b/hurricane/src/hurricane/hurricane/RegularLayer.h @@ -59,15 +59,15 @@ namespace Hurricane { virtual const Layer* getTop () const; virtual const Layer* getBottom () const; virtual const Layer* getOpposite ( const Layer* ) const; - virtual DbU::Unit getEnclosure () const; + virtual DbU::Unit getEnclosure ( uint32_t flags=0 ) const; virtual DbU::Unit getExtentionCap () const; virtual DbU::Unit getExtentionWidth () const; - virtual DbU::Unit getEnclosure ( const BasicLayer* layer ) const; + virtual DbU::Unit getEnclosure ( const BasicLayer* layer, uint32_t flags=0 ) const; virtual DbU::Unit getExtentionCap ( const BasicLayer* layer ) const; virtual DbU::Unit getExtentionWidth ( const BasicLayer* layer ) const; // Updators void setBasicLayer ( BasicLayer* layer ); - virtual void setEnclosure ( const BasicLayer* layer, DbU::Unit enclosure ); + virtual void setEnclosure ( const BasicLayer* layer, DbU::Unit enclosure, uint32_t flags=0 ); virtual void setExtentionCap ( const BasicLayer* layer, DbU::Unit cap ); virtual void setExtentionWidth ( const BasicLayer* layer, DbU::Unit width ); // Hurricane Managment. diff --git a/hurricane/src/hurricane/hurricane/Slot.h b/hurricane/src/hurricane/hurricane/Slot.h index 82ff27bf..28fb1c89 100644 --- a/hurricane/src/hurricane/hurricane/Slot.h +++ b/hurricane/src/hurricane/hurricane/Slot.h @@ -322,7 +322,7 @@ namespace Hurricane { template -inline Hurricane::Slot* getSlot( std::string& name, Data d ) +inline Hurricane::Slot* getSlot( std::string name, Data d ) { //std::cerr << "getSlot( \"" << name << "\" )" << std::endl; return new Hurricane::SlotTemplate ( name, d ); @@ -330,28 +330,28 @@ inline Hurricane::Slot* getSlot( std::string& name, Data d ) template -inline Hurricane::Slot* getSlot( std::string& name, Data* d ) +inline Hurricane::Slot* getSlot( std::string name, Data* d ) { //std::cerr << "getSlot( \"" << name << "\" )" << std::endl; return new Hurricane::SlotTemplate ( name, d ); } -template -inline Hurricane::Slot* getSlot( const std::string& name, Data d ) -{ -//std::cerr << "getSlot( \"" << name << "\" )" << std::endl; -//std::cerr << " Data = " << typeid(d).name() << std::endl; - return new Hurricane::SlotTemplate ( name, d ); -} +// template +// inline Hurricane::Slot* getSlot( const std::string& name, Data d ) +// { +// //std::cerr << "getSlot( \"" << name << "\" )" << std::endl; +// //std::cerr << " Data = " << typeid(d).name() << std::endl; +// return new Hurricane::SlotTemplate ( name, d ); +// } -template -inline Hurricane::Slot* getSlot( const std::string& name, Data* d ) -{ -//std::cerr << "getSlot( \"" << name << "\" )" << std::endl; -//std::cerr << " Data = " << typeid(d).name() << std::endl; - return new Hurricane::SlotTemplate ( name, d ); -} +// template +// inline Hurricane::Slot* getSlot( const std::string& name, Data* d ) +// { +// //std::cerr << "getSlot( \"" << name << "\" )" << std::endl; +// //std::cerr << " Data = " << typeid(d).name() << std::endl; +// return new Hurricane::SlotTemplate ( name, d ); +// } #endif // HURRICANE_SLOT_H diff --git a/hurricane/src/isobar/PyBreakpoint.cpp b/hurricane/src/isobar/PyBreakpoint.cpp index 114f8d63..6c4467d8 100644 --- a/hurricane/src/isobar/PyBreakpoint.cpp +++ b/hurricane/src/isobar/PyBreakpoint.cpp @@ -2,21 +2,17 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved +// Copyright (c) UPMC/LIP6 2010-2019, All Rights Reserved // -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | C O R I O L I S | // | I s o b a r - Hurricane / Python Interface | // | | // | Author : Jean-Paul CHAPUT | -// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Module : "./PyBreakpoint.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #include "hurricane/isobar/PyNet.h" @@ -35,9 +31,9 @@ extern "C" { #define METHOD_HEAD(function) GENERIC_METHOD_HEAD(Breakpoint,bp,function) -// x=================================================================x +// +=================================================================+ // | "PyBreakpoint" Python Module Code Part | -// x=================================================================x +// +=================================================================+ #if defined(__PYTHON_MODULE__) @@ -123,19 +119,17 @@ extern "C" { #else // End of Python Module Code Part. -// x=================================================================x +// +=================================================================+ // | "PyBreakpoint" Shared Library Code Part | -// x=================================================================x +// +=================================================================+ PyTypeObjectDefinitions(Breakpoint) -# endif // End of Shared Library Code Part. +#endif // Shared Library Code Part. +} // extern "C". -} // End of extern "C". - - -} // End of Isobar namespace. +} // Isobar namespace. diff --git a/hurricane/src/isobar/PyInstance.cpp b/hurricane/src/isobar/PyInstance.cpp index 7ab7f9ed..ceb6c3eb 100644 --- a/hurricane/src/isobar/PyInstance.cpp +++ b/hurricane/src/isobar/PyInstance.cpp @@ -49,19 +49,6 @@ extern "C" { // +=================================================================+ #if defined(__PYTHON_MODULE__) - - - extern Instance::PlacementStatus PyInt_AsPlacementStatus ( PyObject* object ) - { - switch ( PyAny_AsLong(object) ) { - case Instance::PlacementStatus::UNPLACED : return ( Instance::PlacementStatus(Instance::PlacementStatus::UNPLACED) ); - case Instance::PlacementStatus::PLACED : return ( Instance::PlacementStatus(Instance::PlacementStatus::PLACED) ); - case Instance::PlacementStatus::FIXED : return ( Instance::PlacementStatus(Instance::PlacementStatus::FIXED) ); - } - - return ( Instance::PlacementStatus(Instance::PlacementStatus::UNPLACED) ); - } - // Standart Accessors (Attributes). diff --git a/hurricane/src/isobar/PyPlacementStatus.cpp b/hurricane/src/isobar/PyPlacementStatus.cpp index 502e2802..55060fc2 100644 --- a/hurricane/src/isobar/PyPlacementStatus.cpp +++ b/hurricane/src/isobar/PyPlacementStatus.cpp @@ -101,8 +101,16 @@ extern "C" { LoadObjectConstant(PyTypePlacementStatus.tp_dict,Instance::PlacementStatus::PLACED ,"PLACED"); LoadObjectConstant(PyTypePlacementStatus.tp_dict,Instance::PlacementStatus::FIXED ,"FIXED"); } + + +#endif // Shared Library Code Part. + +} // extern "C". +#if !defined(__PYTHON_MODULE__) + + extern Instance::PlacementStatus PyInt_AsPlacementStatus ( PyObject* object ) { switch ( PyAny_AsLong(object) ) { case Instance::PlacementStatus::UNPLACED : return Instance::PlacementStatus::UNPLACED; @@ -114,9 +122,7 @@ extern "C" { } -#endif // Shared Library Code Part. - -} // extern "C". +#endif } // Isobar namespace. diff --git a/hurricane/src/isobar/PyRectilinear.cpp b/hurricane/src/isobar/PyRectilinear.cpp index f0d518e1..b5b5bcb7 100644 --- a/hurricane/src/isobar/PyRectilinear.cpp +++ b/hurricane/src/isobar/PyRectilinear.cpp @@ -127,8 +127,6 @@ extern "C" { METHOD_HEAD( "Rectilinear.setPoints()" ) PyObject* arg0 = NULL; - PyObject* arg1 = NULL; - PyObject* arg2 = NULL; if (not PyArg_ParseTuple( args, "O:Rectilinear.setPoints", &arg0 )) { PyErr_SetString( ConstructorError, "Invalid number of parameters for Rectilinear.setPoints()." ); return NULL; diff --git a/hurricane/src/isobar/hurricane/isobar/PyPlacementStatus.h b/hurricane/src/isobar/hurricane/isobar/PyPlacementStatus.h index a0d89996..d4874fa0 100644 --- a/hurricane/src/isobar/hurricane/isobar/PyPlacementStatus.h +++ b/hurricane/src/isobar/hurricane/isobar/PyPlacementStatus.h @@ -43,7 +43,6 @@ namespace Isobar { extern PyObject* PyPlacementStatus_Link ( Hurricane::Instance::PlacementStatus* ); extern void PyPlacementStatus_LinkPyType (); extern void PyPlacementStatus_postModuleInit (); - extern Hurricane::Instance::PlacementStatus PyInt_AsPlacementStatus ( PyObject* ); #define IsPyPlacementStatus(v) ( (v)->ob_type == &PyTypePlacementStatus ) @@ -53,6 +52,10 @@ namespace Isobar { } // End of extern "C". + + extern Hurricane::Instance::PlacementStatus PyInt_AsPlacementStatus ( PyObject* ); + + } // End of Isobar namespace. #endif // PY_PLACEMENTSTATUS_H diff --git a/hurricane/src/viewer/CellPrinter.cpp b/hurricane/src/viewer/CellPrinter.cpp index ff05e88c..e93bea1e 100644 --- a/hurricane/src/viewer/CellPrinter.cpp +++ b/hurricane/src/viewer/CellPrinter.cpp @@ -92,21 +92,21 @@ namespace Hurricane { { _screenCellWidget = cellWidget; - array labels = { "fallback" - , "rubber" - , "phantom" - , "boundaries" - , "marker" - , "grid" - , "spot" - , "ghost" - , "text.ruler" - , "text.cell" - , "text.instance" - , "text.components" - , "text.references" - , "undef" - }; + array labels = {{ string("fallback" ) + , string("rubber" ) + , string("phantom" ) + , string("boundaries" ) + , string("marker" ) + , string("grid" ) + , string("spot" ) + , string("ghost" ) + , string("text.ruler" ) + , string("text.cell" ) + , string("text.instance" ) + , string("text.components" ) + , string("text.references" ) + , string("undef" ) + }}; for ( string label : labels ) _cellWidget->setLayerVisible( label diff --git a/hurricane/src/viewer/PyCellViewer.cpp b/hurricane/src/viewer/PyCellViewer.cpp index 136b5c98..f5821f06 100644 --- a/hurricane/src/viewer/PyCellViewer.cpp +++ b/hurricane/src/viewer/PyCellViewer.cpp @@ -109,19 +109,19 @@ extern "C" { HTRY METHOD_HEAD("CellViewer.addToMenu()") - char* nullBefore = ""; - char* path = NULL; - char* text = NULL; - char* textTip = NULL; - char* scriptPath = NULL; - char* before = NULL; + QString before (""); + char* path = NULL; + char* text = NULL; + char* textTip = NULL; + char* scriptPath = NULL; + char* beforeArg = NULL; if (not PyArg_ParseTuple( args, "s|ssss:CellViewer.addToMenu()" - , &path, &text, &textTip, &scriptPath, &before)) { + , &path, &text, &textTip, &scriptPath, &beforeArg)) { PyErr_SetString ( ConstructorError, "CellViewer.addToMenu(): Takes either one or five arguments." ); return NULL; } - if (before == NULL) before = nullBefore; + if (beforeArg != NULL) before = beforeArg; if (text != NULL) { if (cw->addToMenu( path, text, textTip, scriptPath, before )) Py_RETURN_TRUE; diff --git a/karakaze/CMakeLists.txt b/karakaze/CMakeLists.txt index dc3dbf62..7b4eb782 100644 --- a/karakaze/CMakeLists.txt +++ b/karakaze/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8.9) - set(ignoreVariables "${BUILD_DOC}") + set(ignoreVariables "${BUILD_DOC}" "${CMAKE_INSTALL_DIR}") list(INSERT CMAKE_MODULE_PATH 0 "$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) diff --git a/katabatic/CMakeLists.txt b/katabatic/CMakeLists.txt index f37e40eb..d0a1b7db 100644 --- a/katabatic/CMakeLists.txt +++ b/katabatic/CMakeLists.txt @@ -8,6 +8,8 @@ cmake_minimum_required(VERSION 2.8.9) + set(ignoreVariables "${CMAKE_INSTALL_DIR}") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) setup_project_paths(CORIOLIS) diff --git a/katabatic/src/KatabaticEngine.cpp b/katabatic/src/KatabaticEngine.cpp index 53885939..3b09b400 100644 --- a/katabatic/src/KatabaticEngine.cpp +++ b/katabatic/src/KatabaticEngine.cpp @@ -154,7 +154,7 @@ namespace Katabatic { , _autoContactLut () , _netRoutingStates () { - addMeasure( cell, "Gates" + addMeasure( "Gates" , AllianceFramework::getInstancesCount(cell,AllianceFramework::IgnoreFeeds |AllianceFramework::Recursive) ); } @@ -169,7 +169,7 @@ namespace Katabatic { _gcellGrid = GCellGrid::create( this ); Session::revalidate(); - addMeasure( getCell(), "GCells", _gcellGrid->getGCellVector()->size() ); + addMeasure( "GCells", _gcellGrid->getGCellVector()->size() ); if (getChipTools().isChip()) { unsigned int columns = _gcellGrid->getColumns(); @@ -365,8 +365,8 @@ namespace Katabatic { Super::printMeasures(); if (not tag.empty()) { - addMeasure( getCell(), tag+"T", getTimer().getCombTime () ); - addMeasure( getCell(), tag+"S", (getTimer().getMemorySize() >> 20) ); + addMeasure( tag+"T", getTimer().getCombTime () ); + addMeasure( tag+"S", (getTimer().getMemorySize() >> 20) ); } } diff --git a/katabatic/src/LoadGrByNet.cpp b/katabatic/src/LoadGrByNet.cpp index 8acfb774..665f9bef 100644 --- a/katabatic/src/LoadGrByNet.cpp +++ b/katabatic/src/LoadGrByNet.cpp @@ -2037,7 +2037,7 @@ namespace Katabatic { void KatabaticEngine::_loadGrByNet () { cmess1 << " o Loading Nets global routing from Knik." << endl; - cmess1 << Dots::asDouble(" - Saturation",getMeasure(getCell(),"Sat.")->getData()) << endl; + cmess1 << Dots::asDouble(" - Saturation",getMeasure("Sat.")) << endl; startMeasures(); Session::open( this ); @@ -2061,8 +2061,8 @@ namespace Katabatic { stopMeasures(); printMeasures( "load" ); - addMeasure( getCell(), "Globals", AutoSegment::getGlobalsCount() ); - addMeasure( getCell(), "Edges" , AutoSegment::getAllocateds() ); + addMeasure( "Globals", AutoSegment::getGlobalsCount() ); + addMeasure( "Edges" , AutoSegment::getAllocateds() ); } diff --git a/katana/CMakeLists.txt b/katana/CMakeLists.txt index d5a437c1..488a8326 100644 --- a/katana/CMakeLists.txt +++ b/katana/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 2.8.9) - set(ignoreVariables "${BUILD_DOC}") + set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) @@ -28,6 +28,7 @@ find_package(HURRICANE REQUIRED) find_package(CORIOLIS REQUIRED) find_package(ANABATIC REQUIRED) + find_package(ETESIAN REQUIRED) find_package(Doxygen) if(CHECK_DATABASE) diff --git a/katana/src/BloatProfile.cpp b/katana/src/BloatProfile.cpp new file mode 100644 index 00000000..56b62e0a --- /dev/null +++ b/katana/src/BloatProfile.cpp @@ -0,0 +1,317 @@ +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC 2019-2010, All Rights Reserved +// +// +-----------------------------------------------------------------+ +// | C O R I O L I S | +// | K i t e - D e t a i l e d R o u t e r | +// | | +// | Author : Jean-Paul CHAPUT | +// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | =============================================================== | +// | C++ Module : "./BloatProfile.cpp" | +// +-----------------------------------------------------------------+ + + +#include +#include +#include "hurricane/DebugSession.h" +#include "hurricane/Error.h" +#include "hurricane/Warning.h" +#include "hurricane/DataBase.h" +#include "hurricane/Technology.h" +#include "hurricane/BasicLayer.h" +#include "hurricane/RegularLayer.h" +#include "hurricane/NetExternalComponents.h" +#include "hurricane/NetRoutingProperty.h" +#include "hurricane/Instance.h" +#include "hurricane/Plug.h" +#include "hurricane/Path.h" +#include "hurricane/Query.h" +#include "crlcore/Utilities.h" +#include "crlcore/AllianceFramework.h" +#include "anabatic/GCell.h" +#include "etesian/BloatProperty.h" +#include "katana/KatanaEngine.h" + + +namespace { + + using namespace std; + using Hurricane::Error; + using Hurricane::Warning; + using Hurricane::DbU; + using Hurricane::Entity; + using Hurricane::Instance; + using Hurricane::Path; + using Hurricane::Transformation; + using Hurricane::Occurrence; + using Etesian::BloatState; + using Etesian::BloatExtension; + using Anabatic::Edge; + using namespace Katana; + + +// ------------------------------------------------------------------- +// Class : "FlatInstance". + + class FlatInstance { + public: + static DbU::Unit getXFromOccurrence ( Occurrence ); + static DbU::Unit getYFromOccurrence ( Occurrence ); + public: + inline FlatInstance ( Occurrence ); + inline DbU::Unit getX () const; + inline Occurrence getOccurrence () const; + private: + DbU::Unit _x; + Occurrence _instanceOcc; + }; + + + DbU::Unit FlatInstance::getXFromOccurrence ( Occurrence o ) + { + Instance* instance = dynamic_cast( o.getEntity() ); + Transformation transf = o.getPath().getTransformation(); + instance->getTransformation().applyOn( transf ); + Box ab = instance->getMasterCell()->getAbutmentBox(); + transf.applyOn( ab ); + return ab.getXMin(); + } + + + DbU::Unit FlatInstance::getYFromOccurrence ( Occurrence o ) + { + Instance* instance = dynamic_cast( o.getEntity() ); + Transformation transf = instance->getTransformation(); + + //cerr << "Inst transf:" << transf << endl; + //cerr << "Path transf:" << o.getPath().getTransformation() << endl; + + o.getPath().getTransformation().applyOn( transf ); + Box ab = instance->getMasterCell()->getAbutmentBox(); + transf.applyOn( ab ); + return ab.getYMin(); + } + + + + inline FlatInstance::FlatInstance ( Occurrence o ) + : _x(getXFromOccurrence(o)) + , _instanceOcc(o) + { } + + + inline DbU::Unit FlatInstance::getX () const { return _x; } + inline Occurrence FlatInstance::getOccurrence () const { return _instanceOcc; } + + + bool operator< ( const FlatInstance& lhs, const FlatInstance& rhs ) + { return lhs.getX() < rhs.getX(); } + + +// ------------------------------------------------------------------- +// Class : "Slice". + + class Slice { + public: + inline Slice ( GCell* ); + inline DbU::Unit getY () const; + inline void add ( Occurrence ); + inline void sort (); + void tagOverloadeds ( size_t& count, size_t& newCount ); + private: + GCell* _left; + vector _instances; + }; + + + inline Slice::Slice ( GCell* left ) + : _left (left) + , _instances() + { } + + + inline DbU::Unit Slice::getY () const { return _left->getYMin(); } + inline void Slice::add ( Occurrence o ) { _instances.push_back( o ); } + inline void Slice::sort () { std::sort( _instances.begin(), _instances.end() ); } + + + void Slice::tagOverloadeds ( size_t& count, size_t& newCount ) + { + GCell* gcell = _left; + Edge* eastEdge = _left->getEastEdge(); + Edge* northEdge = _left->getNorthEdge(); + bool bloated = false; + + for ( FlatInstance& fi : _instances ) { + if (fi.getX() >= gcell->getXMax()) { + for ( gcell = gcell->getEast() ; gcell and (fi.getX() < gcell->getXMin()) + ; gcell = gcell->getEast() ); + if (not gcell) break; + + bloated = false; + eastEdge = gcell->getEastEdge(); + northEdge = gcell->getNorthEdge(); + } + + unsigned int overload = 0; + + if (eastEdge) { + if (eastEdge->getRealOccupancy() > eastEdge->getCapacity()) { + overload = eastEdge->getRealOccupancy() - eastEdge->getCapacity(); + } + // else if (eastEdge->getHistoricCost() > 3.0) { + // overload = 4; + // } + } + + if (northEdge) { + if (northEdge->getRealOccupancy() > northEdge->getCapacity()) { + overload = std::max( overload, northEdge->getRealOccupancy() - northEdge->getCapacity() ); + } + // else if (northEdge->getHistoricCost() > 3.0) { + // overload = 4; + // } + } + + if (overload and not bloated) { + bloated = true; + BloatState* state = BloatExtension::get( fi.getOccurrence() ); + if (not state) { + state = BloatExtension::create( fi.getOccurrence(), overload ); + ++newCount; + } else { + state->setTracksCount( state->getTracksCount() + overload ); + } + ++count; + } + } + } + + +// ------------------------------------------------------------------- +// Class : "Slices". + + class Slices { + public: + Slices ( KatanaEngine* ); + ~Slices (); + inline void add ( Occurrence ); + inline void sort (); + inline void tagOverloadeds (); + private: + KatanaEngine* _katana; + Box _cellAb; + DbU::Unit _sliceHeight; + vector _slices; + }; + + + Slices::Slices ( KatanaEngine* katana ) + : _katana (katana) + , _cellAb (_katana->getCell()->getAbutmentBox()) + , _sliceHeight(_katana->getConfiguration()->getSliceHeight()) + , _slices () + { + GCell* left = _katana->getSouthWestGCell(); + size_t slicesNb = _cellAb.getHeight() / _sliceHeight; + + for ( size_t islice=0 ; islicegetCell()->getName()).c_str() + ); + + if (not left->isMatrix()) + throw Error( "Slices::Slices(): Non-matrix GCell under slice [%d] @%s in \"%s\".\n" + " (%s)" + , islice, DbU::getValueString( (DbU::Unit)islice * _sliceHeight).c_str() + , getString(_katana->getCell()->getName()).c_str() + , getString(left).c_str() + ); + + if (left->getYMin() != (DbU::Unit)islice * _sliceHeight + _cellAb.getYMin()) + throw Error( "Slices::Slices(): Misaligned GCell under slice [%d] @%s in \"%s\".\n" + " (%s)" + , islice, DbU::getValueString( (DbU::Unit)islice * _sliceHeight).c_str() + , getString(_katana->getCell()->getName()).c_str() + , getString(left).c_str() + ); + + _slices.push_back( new Slice( left ) ); + left = left->getNorth(); + } + } + + + Slices::~Slices () + { for ( Slice* slice : _slices ) delete slice; } + + + inline void Slices::sort () + { for ( Slice* slice : _slices ) slice->sort(); } + + + inline void Slices::add ( Occurrence o ) + { + DbU::Unit y = FlatInstance::getYFromOccurrence( o ); + size_t islice = (y - _cellAb.getYMin()) / _sliceHeight; + + if (islice >= _slices.size()) { + throw Error( "Slices::add(): Out of range instance occurrence placed at Y %s (slice:%u).\n" + " (%s)" + , DbU::getValueString(y).c_str() + , islice + , o.getCompactString().c_str() + ); + } + + _slices[islice]->add( o ); + } + + + inline void Slices::tagOverloadeds () + { + size_t count = 0; + size_t newCount = 0; + for ( Slice* slice : _slices ) slice->tagOverloadeds( count, newCount ); + + cmess2 << Dots::asUInt (" - Bloated cells" ,count ) << endl; + cmess2 << Dots::asUInt (" - Bloated cells, new" ,newCount) << endl; + } + + + +} // Anonymous namespace. + + +namespace Katana { + + using CRL::CatalogExtension; + + + void KatanaEngine::_buildBloatProfile () + { + cmess1 << " o Build bloat profile on \"" << getCell()->getName() << "\"." << endl; + + Slices slices ( this ); + + for ( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() ) + { + Instance* instance = static_cast(occurrence.getEntity()); + Cell* masterCell = instance->getMasterCell(); + + if (CatalogExtension::isFeed(masterCell)) continue; + + slices.add( occurrence ); + } + + slices.sort(); + slices.tagOverloadeds(); + } + + +} // Katana namespace. diff --git a/katana/src/CMakeLists.txt b/katana/src/CMakeLists.txt index f201e87c..55adf67d 100644 --- a/katana/src/CMakeLists.txt +++ b/katana/src/CMakeLists.txt @@ -75,6 +75,7 @@ PreRouteds.cpp ProtectRoutingPads.cpp PreProcess.cpp + BloatProfile.cpp GlobalRoute.cpp SymmetricRoute.cpp KatanaEngine.cpp @@ -87,7 +88,8 @@ ) qtX_wrap_cpp( mocCpps ${mocIncludes} ) - set( depLibs ${ANABATIC_LIBRARIES} + set( depLibs ${ETESIAN_LIBRARIES} + ${ANABATIC_LIBRARIES} ${CORIOLIS_PYTHON_LIBRARIES} ${CORIOLIS_LIBRARIES} ${HURRICANE_PYTHON_LIBRARIES} diff --git a/katana/src/Configuration.cpp b/katana/src/Configuration.cpp index be8ea48a..b9e94447 100644 --- a/katana/src/Configuration.cpp +++ b/katana/src/Configuration.cpp @@ -40,6 +40,7 @@ namespace Katana { Configuration::Configuration () : Anabatic::Configuration() , _postEventCb () + , _searchHalo (Cfg::getParamInt ("katana.searchHalo" , 1)->asInt()) , _hTracksReservedLocal(Cfg::getParamInt ("katana.hTracksReservedLocal", 3)->asInt()) , _vTracksReservedLocal(Cfg::getParamInt ("katana.vTracksReservedLocal", 3)->asInt()) , _termSatReservedLocal(Cfg::getParamInt ("katana.termSatReservedLocal", 9)->asInt()) @@ -56,6 +57,8 @@ namespace Katana { _ripupLimits[LongGlobalRipupLimit] = Cfg::getParamInt("katana.longGlobalRipupLimit" , 5)->asInt(); _ripupLimits[ShortNetRipupLimit] = Cfg::getParamInt("katana.shortNetRipupLimit" ,16)->asInt(); + if (Cfg::getParamBool("katana.useGlobalEstimate",false)->asBool()) _flags |= UseGlobalEstimate; + // for ( size_t i=0 ; i for Cell <" << cell->getName() << ">" << endl; + cout << Dots::asUInt (" - Dijkstra GR search halo" ,getSearchHalo()) << endl; + cout << Dots::asBool (" - Use GR density estimate" ,useGlobalEstimate()) << endl; cout << Dots::asDouble(" - GCell saturate ratio (LA)" ,getSaturateRatio()) << endl; cout << Dots::asUInt (" - Edge max H reserved local" ,_hTracksReservedLocal) << endl; cout << Dots::asUInt (" - Edge max V reserved local" ,_vTracksReservedLocal) << endl; @@ -163,7 +169,7 @@ namespace Katana { cout << Dots::asUInt (" - Ripup limit, globals" ,_ripupLimits[GlobalRipupLimit]) << endl; cout << Dots::asUInt (" - Ripup limit, long globals" ,_ripupLimits[LongGlobalRipupLimit]) << endl; - Super::print ( cell ); + Super::print( cell ); } @@ -185,6 +191,7 @@ namespace Katana { { Record* record = Super::_getRecord(); if ( record ) { + record->add ( getSlot("_searchHalo" ,_searchHalo ) ); record->add ( getSlot("_hTracksReservedLocal" ,_hTracksReservedLocal ) ); record->add ( getSlot("_vTracksReservedLocal" ,_vTracksReservedLocal ) ); record->add ( getSlot("_ripupCost" ,_ripupCost ) ); diff --git a/katana/src/Constants.cpp b/katana/src/Constants.cpp index 8d8aa167..461f9cc9 100644 --- a/katana/src/Constants.cpp +++ b/katana/src/Constants.cpp @@ -20,20 +20,23 @@ namespace Katana { - - const Hurricane::BaseFlags Flags::AllowDoglegReuse = (1L << 20); - const Hurricane::BaseFlags Flags::DataSelf = (1L << 21); - const Hurricane::BaseFlags Flags::Nearest = (1L << 22); - const Hurricane::BaseFlags Flags::Force = (1L << 23); - const Hurricane::BaseFlags Flags::ResetCount = (1L << 24); - const Hurricane::BaseFlags Flags::WithConstraints = (1L << 25); - const Hurricane::BaseFlags Flags::MoveToLeft = (1L << 26); - const Hurricane::BaseFlags Flags::MoveToRight = (1L << 27); - const Hurricane::BaseFlags Flags::ShortDogleg = (1L << 28); - const Hurricane::BaseFlags Flags::LoadingStage = (1L << 29); - const Hurricane::BaseFlags Flags::SlowMotion = (1L << 30); - const Hurricane::BaseFlags Flags::PreRoutedStage = (1L << 31); - const Hurricane::BaseFlags Flags::PairSymmetrics = (1L << 32); +// Flags for functions arguments only. + const Hurricane::BaseFlags Flags::AllowDoglegReuse = (1L << 20); + const Hurricane::BaseFlags Flags::DataSelf = (1L << 21); + const Hurricane::BaseFlags Flags::Nearest = (1L << 22); + const Hurricane::BaseFlags Flags::Force = (1L << 23); + const Hurricane::BaseFlags Flags::ResetCount = (1L << 24); + const Hurricane::BaseFlags Flags::WithConstraints = (1L << 25); + const Hurricane::BaseFlags Flags::MoveToLeft = (1L << 26); + const Hurricane::BaseFlags Flags::MoveToRight = (1L << 27); + const Hurricane::BaseFlags Flags::ShortDogleg = (1L << 28); + const Hurricane::BaseFlags Flags::LoadingStage = (1L << 29); + const Hurricane::BaseFlags Flags::SlowMotion = (1L << 30); + const Hurricane::BaseFlags Flags::PreRoutedStage = (1L << 31); + const Hurricane::BaseFlags Flags::PairSymmetrics = (1L << 32); + const Hurricane::BaseFlags Flags::ShowFailedGSegments = (1L << 33); + const Hurricane::BaseFlags Flags::ShowOverloadedGCells = (1L << 34); + const Hurricane::BaseFlags Flags::ShowBloatedInstances = (1L << 35); } // Anabatic namespace. diff --git a/katana/src/DataSymmetric.cpp b/katana/src/DataSymmetric.cpp index decaa149..24ce70dc 100644 --- a/katana/src/DataSymmetric.cpp +++ b/katana/src/DataSymmetric.cpp @@ -207,7 +207,7 @@ namespace Katana { _valid = false; } } else { - if ( std::abs( paired[0]->getAxis() != paired[1]->getAxis() ) > 5*vPitch ) { + if ( std::abs( paired[0]->getAxis() - paired[1]->getAxis() ) > 5*vPitch ) { errors.newline() << "Axis mismatch index " << index << " " << DbU::getValueString(paired[1]->getAxis()) << " (should be:" << DbU::getValueString(paired[0]->getAxis()) << ")"; diff --git a/katana/src/GlobalRoute.cpp b/katana/src/GlobalRoute.cpp index e09a67d8..aa12c6a1 100644 --- a/katana/src/GlobalRoute.cpp +++ b/katana/src/GlobalRoute.cpp @@ -15,12 +15,16 @@ #include "flute.h" +#include "vlsisapd/utilities/Dots.h" #include "hurricane/Warning.h" #include "hurricane/Breakpoint.h" #include "hurricane/RoutingPad.h" #include "hurricane/Cell.h" +#include "hurricane/viewer/CellViewer.h" #include "crlcore/Utilities.h" +#include "crlcore/Histogram.h" #include "anabatic/Dijkstra.h" +#include "etesian/BloatProperty.h" #include "katana/Block.h" #include "katana/RoutingPlane.h" #include "katana/KatanaEngine.h" @@ -36,14 +40,20 @@ namespace { using std::setfill; using std::left; using std::right; + using std::set; using Hurricane::DbU; using Hurricane::Interval; + using Hurricane::DBo; using Hurricane::Net; + using Hurricane::Segment; + using Utilities::Dots; using Anabatic::Flags; using Anabatic::Edge; using Anabatic::GCell; using Anabatic::Vertex; using Anabatic::AnabaticEngine; + using Etesian::BloatExtension; + using namespace Katana; class DigitalDistance { @@ -172,11 +182,117 @@ namespace { } + void selectSegments ( KatanaEngine* katana, set& segments ) + { + if (katana->getViewer()) { + cmess2 << " o Selecting overflowed edges (slow)." << endl; + + Dots dots ( cmess2, " ", 80, 100 ); + if (not cmess2.enabled()) dots.disable(); + + katana->getViewer()->setShowSelection( false ); + katana->getViewer()->setCumulativeSelection( true ); + + // for ( const Net* net : nets ) { + // Occurrence netOcc ( net ); + // getViewer()->select( netOcc ); + // } + + for ( const Segment* segment : segments ) { + Occurrence occurrence ( segment ); + katana->getViewer()->select( occurrence ); + + dots.dot(); + } + + dots.finish( Dots::Reset ); + katana->getViewer()->setShowSelection( true ); + } + } + + + void selectOverloadedGCells ( KatanaEngine* katana ) + { + CellViewer* viewer = katana->getViewer(); + + if (viewer) { + cmess2 << " o Selecting overloaded GCells (slow)." << endl; + + Dots dots ( cmess2, " ", 80, 100 ); + if (not cmess2.enabled()) dots.disable(); + + viewer->setShowSelection( false ); + viewer->setCumulativeSelection( true ); + + for ( GCell* gcell : katana->getGCells() ) { + Edge* eastEdge = gcell->getEastEdge (); + Edge* northEdge = gcell->getNorthEdge(); + bool overloaded = false; + + if (eastEdge) { + if (eastEdge->getRealOccupancy() > eastEdge->getCapacity()) { + overloaded = true; + } + // else if (eastEdge->getHistoricCost() > 3.0) { + // overloaded = true; + // } + } + + if (northEdge) { + if (northEdge->getRealOccupancy() > northEdge->getCapacity()) { + overloaded = true; + } + // else if (northEdge->getHistoricCost() > 3.0) { + // overloaded = true; + // } + } + + if (overloaded) { + Occurrence gcellOcc ( gcell ); + viewer->select( gcellOcc ); + dots.dot(); + } + } + + dots.finish( Dots::Reset ); + viewer->setShowSelection( true ); + } + } + + + void selectBloatedInstances ( KatanaEngine* katana ) + { + CellViewer* viewer = katana->getViewer(); + + if (viewer) { + cmess2 << " o Selecting bloated instances (slow)." << endl; + + Dots dots ( cmess2, " ", 80, 100 ); + if (not cmess2.enabled()) dots.disable(); + + viewer->setShowSelection( false ); + viewer->setCumulativeSelection( true ); + + for( Occurrence occurrence : katana->getCell()->getLeafInstanceOccurrences() ) { + if (BloatExtension::get(occurrence)) { + viewer->select( occurrence ); + + dots.dot(); + } + } + + dots.finish( Dots::Reset ); + viewer->setShowSelection( true ); + } + } + + } // Anonymous namespace. namespace Katana { + using Utilities::Dots; using Hurricane::Error; using Hurricane::Warning; using Hurricane::Breakpoint; @@ -189,6 +305,7 @@ namespace Katana { using Hurricane::RoutingPad; using Hurricane::RoutingPad; using Hurricane::Instance; + using CRL::Histogram; using Anabatic::EngineState; using Anabatic::Dijkstra; using Anabatic::NetData; @@ -224,7 +341,7 @@ namespace Katana { } else { cmess1 << " o Reusing existing grid." << endl; } - cmess1 << Dots::asInt(" - GCells" ,getGCells().size()) << endl; + cmess1 << ::Dots::asInt(" - GCells" ,getGCells().size()) << endl; stopMeasures(); printMeasures( "Anabatic Grid" ); @@ -319,27 +436,17 @@ namespace Katana { } - void KatanaEngine::runGlobalRouter () + void KatanaEngine::runGlobalRouter ( Flags flags ) { if (getState() >= EngineState::EngineGlobalLoaded) throw Error ("KatanaEngine::runGlobalRouter(): Global routing already done or loaded."); + startMeasures(); + cmess1 << " o Running global routing." << endl; + openSession(); annotateGlobalGraph(); - // for ( NetData* netData : getNetOrdering() ) { - // if (netData->isGlobalRouted() or netData->isExcluded()) continue; - - // updateEstimateDensity( netData, 1.0 ); - // netData->setGlobalEstimated( true ); - // } - - // Session::close(); - // Breakpoint::stop( 1, "After global routing estimation." ); - // openSession(); - - startMeasures(); - cmess1 << " o Running global routing." << endl; float edgeHInc = getConfiguration()->getEdgeHInc(); size_t globalIterations = getConfiguration()->getGlobalIterations();; @@ -355,7 +462,7 @@ namespace Katana { if (isChannelMode()) dijkstra->setSearchAreaHalo( Session::getSliceHeight()*10 ); else - dijkstra->setSearchAreaHalo( Session::getSliceHeight()*1 ); + dijkstra->setSearchAreaHalo( Session::getSliceHeight()*getSearchHalo() ); bool globalEstimated = false; size_t iteration = 0; @@ -386,14 +493,19 @@ namespace Katana { // openSession(); // } - if ( (netData->getRpCount() < 11) and not globalEstimated ) { - for ( NetData* netData2 : getNetOrdering() ) { - if (netData2->isGlobalRouted() or netData2->isExcluded()) continue; + if (useGlobalEstimate()) { + // Triggers the global routing when we reach nets of less than 11 terminals. + // High degree nets are routed straight (without taking account the smalls). + // See the SparsityOrder comparison function. + if ( (netData->getRpCount() < 11) and not globalEstimated ) { + for ( NetData* netData2 : getNetOrdering() ) { + if (netData2->isGlobalRouted() or netData2->isExcluded()) continue; - updateEstimateDensity( netData2, 1.0 ); - netData2->setGlobalEstimated( true ); + updateEstimateDensity( netData2, 1.0 ); + netData2->setGlobalEstimated( true ); + } + globalEstimated = true; } - globalEstimated = true; } } cmess2 << left << setw(6) << netCount; @@ -429,7 +541,8 @@ namespace Katana { } } - dijkstra->setSearchAreaHalo( Session::getSliceHeight()*3 ); + //dijkstra->setSearchAreaHalo( (getSearchHalo() + 3*(iteration/3)) * Session::getSliceHeight() ); + dijkstra->setSearchAreaHalo( 3 * Session::getSliceHeight() ); } cmess2 << " ovE:" << setw(4) << overflow; @@ -447,15 +560,26 @@ namespace Katana { printMeasures( "Dijkstra" ); if (not ovEdges.empty()) { - set< const Net*, Net::CompareByName > nets; + Histogram ovHistogram ( 0.0, 1.0, 1 ); + ovHistogram.setTitle ( "Overflowed", 0 ); + ovHistogram.setColor ( "green" , 0 ); + ovHistogram.setIndent( " " , 0 ); + + uint32_t hoverflow = 0; + uint32_t voverflow = 0; + set nets; + set segments; - //cerr << " o Global routing did not complete, overflowed edges:" << endl; cerr << " o Global routing did not complete." << endl; for ( size_t iEdge = 0 ; iEdgegetRealOccupancy() - ovEdges[iEdge]->getCapacity(); + ovHistogram.addSample( (float)edgeOverflow, 0 ); + if (ovEdges[iEdge]->isHorizontal()) hoverflow += edgeOverflow; + else voverflow += edgeOverflow; + for ( Segment* segment : ovEdges[iEdge]->getSegments() ) { - //cerr << " | " << segment << " " << DbU::getValueString(segment->getLength()) << endl; nets.insert( segment->getNet() ); + if (edgeOverflow > 2) segments.insert( segment ); } } @@ -464,8 +588,32 @@ namespace Katana { //for ( const Net* net : nets ) // cerr << " " << dec << setw(4) << (++count) << "| " << net->getName() << endl; - cout << Dots::asUInt (" - Overflowed edges" ,ovEdges.size()) << endl; - cout << Dots::asUInt (" - Unsatisfied nets" ,nets .size()) << endl; + cmess2 << ::Dots::asUInt (" - Unsatisfied nets" ,nets .size()) << endl; + cmess2 << ::Dots::asUInt (" - Unsatisfied segments" ,segments.size()) << endl; + cmess2 << ::Dots::asUInt (" - Overflowed edges" ,ovEdges .size()) << endl; + + ostringstream result; + float ratio = ((float)hoverflow / (float)(hoverflow+voverflow)) * 100.0; + result.str( "" ); + result << setprecision(4) << ratio << "% [" << hoverflow << "]"; + cmess2 << ::Dots::asString( " - H-overflow length", result.str() ) << endl; + + ratio = ((float)voverflow / (float)(hoverflow+voverflow)) * 100.0; + result.str( "" ); + result << setprecision(4) << ratio << "% [" << voverflow << "]"; + cmess2 << ::Dots::asString( " - V-overflow length", result.str() ) << endl; + + cmess2 << " o Overflowed edges Histogram." << endl; + cmess2 << ovHistogram.toString(0) << endl; + + addMeasure( "H-ovE", hoverflow, 12 ); + addMeasure( "V-ovE", voverflow, 12 ); + + _buildBloatProfile(); + + if (flags & Flags::ShowFailedGSegments ) selectSegments ( this, segments ); + if (flags & Flags::ShowOverloadedGCells) selectOverloadedGCells( this ); + if (flags & Flags::ShowBloatedInstances) selectBloatedInstances( this ); } if (getBlock(0)) { @@ -483,6 +631,14 @@ namespace Katana { } setState( EngineState::EngineGlobalLoaded ); + setGlobalRoutingSuccess( ovEdges.empty() ); + + // for( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() ) { + // if (occurrence.getEntity()->getId() == 25202) { + // cerr << "REFERENCE INSTANCE" << endl; + // cerr << occurrence << " " << occurrence.getPath().getTransformation() << endl; + // } + // } } diff --git a/katana/src/GraphicKatanaEngine.cpp b/katana/src/GraphicKatanaEngine.cpp index 8959eb62..60876a4a 100644 --- a/katana/src/GraphicKatanaEngine.cpp +++ b/katana/src/GraphicKatanaEngine.cpp @@ -153,8 +153,22 @@ namespace Katana { float edgeOccupancy = edge->getEstimateOccupancy() + (float)edge->getRealOccupancy(); +#define EDGE_OVERLOAD_DISPLAY 1 +#if NORMAL_DENSITY_DISPLAY if ((unsigned int)edgeOccupancy < edge->getCapacity()) occupancy = (uint32_t)( 255.0 * (edgeOccupancy / (float)edge->getCapacity()) ); +#endif +#if HISTORIC_COST_DISPLAY + occupancy = (uint32_t)( 10.0 * edge->getHistoricCost() ); + if (occupancy > 255) occupancy = 255; +#endif +#if EDGE_OVERLOAD_DISPLAY + if ((unsigned int)edgeOccupancy < edge->getCapacity()) + occupancy = 0; + else + occupancy = (uint32_t)( 20.0 * ((unsigned int)edgeOccupancy - edge->getCapacity()) ); + if (occupancy > 255) occupancy = 255; +#endif QPainter& painter = widget->getPainter(); if ((unsigned int)edgeOccupancy > edge->getCapacity()) { diff --git a/katana/src/KatanaEngine.cpp b/katana/src/KatanaEngine.cpp index fb69b1ac..95edaa3f 100644 --- a/katana/src/KatanaEngine.cpp +++ b/katana/src/KatanaEngine.cpp @@ -59,6 +59,7 @@ namespace { using Hurricane::Net; using Hurricane::Cell; using Hurricane::Segment; + using Hurricane::Plug; using Katana::Session; using Katana::TrackSegment; @@ -122,6 +123,7 @@ namespace Katana { using std::endl; using std::dec; using std::setw; + using std::setfill; using std::left; using std::ostream; using std::ofstream; @@ -193,7 +195,7 @@ namespace Katana { , _shortDoglegs () , _symmetrics () , _mode (DigitalMode) - , _toolSuccess (false) + , _successState (0) { //Entity::setMemoryLimit( 1024 ); // 1Gb. } @@ -577,7 +579,7 @@ namespace Katana { _check( overlaps ); Session::close(); - _toolSuccess = _toolSuccess and (overlaps == 0); + setDetailedRoutingSuccess( isDetailedRoutingSuccess() and (overlaps == 0) ); } @@ -605,8 +607,10 @@ namespace Katana { void KatanaEngine::printCompletion () const { size_t routeds = 0; - unsigned long long totalWireLength = 0; - unsigned long long routedWireLength = 0; + uint64_t totalWireLength = 0; + uint64_t routedWireLength = 0; + uint32_t hunrouteds = 0; + uint32_t vunrouteds = 0; vector unrouteds; vector reduceds; ostringstream result; @@ -616,7 +620,7 @@ namespace Katana { TrackElement* segment = _lookup( ilut->second ); if (segment == NULL) continue; - unsigned long long wl = (unsigned long long)DbU::toLambda( segment->getLength() ); + uint64_t wl = (unsigned long long)DbU::toLambda( segment->getLength() ); if (wl > 100000) { cerr << Error("KatanaEngine::printCompletion(): Suspiciously long wire: %llu for %p:%s" ,wl,ilut->first,getString(segment).c_str()) << endl; @@ -634,12 +638,14 @@ namespace Katana { } unrouteds.push_back( segment ); + if (segment->isHorizontal()) ++hunrouteds; + if (segment->isVertical ()) ++vunrouteds; } float segmentRatio = (float)(routeds) / (float)(routeds+unrouteds.size()) * 100.0; float wireLengthRatio = (float)(routedWireLength) / (float)(totalWireLength) * 100.0; - _toolSuccess = (unrouteds.empty()); + setDetailedRoutingSuccess( unrouteds.empty() ); if (not unrouteds.empty()) { cerr << " o Routing did not complete, unrouted segments:" << endl; @@ -674,53 +680,76 @@ namespace Katana { cmess1 << Dots::asString( " - Wire Length Expand Ratio", result.str() ) << endl; } - addMeasure ( getCell(), "Segs" , routeds+unrouteds.size() ); - addMeasure( getCell(), "DWL(l)" , totalWireLength , 12 ); - addMeasure( getCell(), "fWL(l)" , totalWireLength-routedWireLength , 12 ); - addMeasure ( getCell(), "WLER(%)", (expandRatio-1.0)*100.0 ); + float ratio = ((float)hunrouteds / (float)unrouteds.size()) * 100.0; + result.str(""); + result << setprecision(4) << ratio << "% [" << hunrouteds << "]"; + cmess1 << Dots::asString( " - Unrouted horizontals", result.str() ) << endl; + + ratio = ((float)vunrouteds / (float)unrouteds.size()) * 100.0; + result.str(""); + result << setprecision(4) << ratio << "% [" << vunrouteds << "]"; + cmess1 << Dots::asString( " - Unrouted verticals", result.str() ) << endl; + + addMeasure ( "Segs" , routeds+unrouteds.size() ); + addMeasure( "DWL(l)" , totalWireLength , 12 ); + addMeasure( "fWL(l)" , totalWireLength-routedWireLength , 12 ); + addMeasure ( "WLER(%)", expandRatio ); } void KatanaEngine::dumpMeasures ( ostream& out ) const { vector measuresLabels; - measuresLabels.push_back( "Gates" ); - measuresLabels.push_back( "GCells" ); - measuresLabels.push_back( "knikT" ); - measuresLabels.push_back( "knikS" ); - measuresLabels.push_back( "GWL(l)" ); - measuresLabels.push_back( "Area(l2)"); - measuresLabels.push_back( "Sat." ); - measuresLabels.push_back( "loadT" ); - measuresLabels.push_back( "loadS" ); - measuresLabels.push_back( "Globals" ); - measuresLabels.push_back( "Edges" ); - measuresLabels.push_back( "assignT" ); - measuresLabels.push_back( "algoT" ); - measuresLabels.push_back( "algoS" ); - measuresLabels.push_back( "finT" ); - measuresLabels.push_back( "Segs" ); - measuresLabels.push_back( "DWL(l)" ); - measuresLabels.push_back( "fWL(l)" ); - measuresLabels.push_back( "WLER(%)" ); - measuresLabels.push_back( "Events" ); - measuresLabels.push_back( "UEvents" ); + measuresLabels.push_back( getMeasureLabel("Gates" ) ); + measuresLabels.push_back( getMeasureLabel("GCells" ) ); + //measuresLabels.push_back( getMeasureLabel("knikT" ) ); + //measuresLabels.push_back( getMeasureLabel("knikS" ) ); + //measuresLabels.push_back( getMeasureLabel("GWL(l)" ) ); + measuresLabels.push_back( getMeasureLabel("Area(l2)") ); + measuresLabels.push_back( getMeasureLabel("Sat." ) ); + measuresLabels.push_back( getMeasureLabel("loadT" ) ); + measuresLabels.push_back( getMeasureLabel("loadS" ) ); + measuresLabels.push_back( getMeasureLabel("H-ovE" ) ); + measuresLabels.push_back( getMeasureLabel("V-ovE" ) ); + measuresLabels.push_back( getMeasureLabel("Globals" ) ); + measuresLabels.push_back( getMeasureLabel("Edges" ) ); + measuresLabels.push_back( getMeasureLabel("assignT" ) ); + measuresLabels.push_back( getMeasureLabel("algoT" ) ); + measuresLabels.push_back( getMeasureLabel("algoS" ) ); + measuresLabels.push_back( getMeasureLabel("finT" ) ); + measuresLabels.push_back( getMeasureLabel("Segs" ) ); + measuresLabels.push_back( getMeasureLabel("DWL(l)" ) ); + measuresLabels.push_back( getMeasureLabel("fWL(l)" ) ); + measuresLabels.push_back( getMeasureLabel("WLER(%)" ) ); + measuresLabels.push_back( getMeasureLabel("Events" ) ); + measuresLabels.push_back( getMeasureLabel("UEvents" ) ); const MeasuresSet* measures = Measures::get( getCell() ); - out << "#" << endl; - out << "# " << getCell()->getName() << endl; - out << measures->toStringHeaders(measuresLabels) << endl; - out << measures->toStringDatas (measuresLabels) << endl; - - measures->toGnuplot( "GCells Density Histogram", getString(getCell()->getName()) ); + if (measures) { + out << "#" << endl; + out << "# " << getCell()->getName() << endl; + out << measures->toStringHeaders(measuresLabels) << endl; + for ( size_t i=0 ; i<=getPassNumber() ; ++i ) { + out << measures->toStringDatas(measuresLabels,i) << endl; + + measures->toGnuplot( getMeasureLabel("GCells Density Histogram") + , i, getString(getCell()->getName()) ); + } + } else { + cerr << Warning( "KatanaEngine::dumpMeasures(): \"%s\" has no measures yet." + , getString(getCell()->getName()).c_str() + ) << endl; + } } void KatanaEngine::dumpMeasures () const { + cmess1 << " o Dumping measurements." << endl; + ostringstream path; - path << getCell()->getName() << ".knik-katana.dat"; + path << getCell()->getName() << ".katana.dat"; ofstream sfile ( path.str().c_str() ); dumpMeasures( sfile ); @@ -809,6 +838,40 @@ namespace Katana { } + void KatanaEngine::resetRouting () + { + _gutKatana(); + + UpdateSession::open(); + for ( Net* net : getCell()->getNets() ) { + vector removeds; + + for ( Component* component : net->getComponents() ) { + if (dynamic_cast(component)) continue; + if (dynamic_cast(component)) removeds.push_back( component ); + } + for ( Component* component : removeds ) component->destroy(); + } + + for ( Net* net : getCell()->getNets() ) { + vector removeds; + + for ( Component* component : net->getComponents() ) { + if (dynamic_cast(component)) continue; + removeds.push_back( component ); + } + for ( Component* component : removeds ) component->destroy(); + } + + setState( Anabatic::EngineCreation ); + setGlobalRoutingSuccess ( false ); + setDetailedRoutingSuccess( false ); + UpdateSession::close(); + + getCell()->resetFlags( Cell::Flags::Routed ); + } + + TrackElement* KatanaEngine::_lookup ( Segment* segment ) const { AutoSegment* autoSegment = Super::_lookup( segment ); diff --git a/katana/src/NegociateWindow.cpp b/katana/src/NegociateWindow.cpp index 8f7bc91a..e29b454a 100644 --- a/katana/src/NegociateWindow.cpp +++ b/katana/src/NegociateWindow.cpp @@ -748,11 +748,11 @@ namespace Katana { cmess1 << Dots::asSizet(" - # of GCells",_statistics.getGCellsCount()) << endl; _katana->printCompletion(); - addMeasure( getCell(), "Events" , RoutingEvent::getProcesseds(), 12 ); - addMeasure( getCell(), "UEvents", RoutingEvent::getProcesseds()-RoutingEvent::getCloneds(), 12 ); + _katana->addMeasure( "Events" , RoutingEvent::getProcesseds(), 12 ); + _katana->addMeasure( "UEvents", RoutingEvent::getProcesseds()-RoutingEvent::getCloneds(), 12 ); Histogram* densityHistogram = new Histogram ( 1.0, 0.1, 2 ); - addMeasure( getCell(), "GCells Density Histogram", densityHistogram ); + _katana->addMeasure( "GCells Density Histogram", densityHistogram ); densityHistogram->setFileExtension( ".density.histogram" ); densityHistogram->setMainTitle ( "GCell Densities" ); diff --git a/katana/src/PowerRails.cpp b/katana/src/PowerRails.cpp index a7c42502..40abcd12 100644 --- a/katana/src/PowerRails.cpp +++ b/katana/src/PowerRails.cpp @@ -1161,7 +1161,7 @@ namespace { { } -} // End of anonymous namespace. +} // anonymous namespace. namespace Katana { diff --git a/katana/src/PreProcess.cpp b/katana/src/PreProcess.cpp index cb20ae50..d0336109 100644 --- a/katana/src/PreProcess.cpp +++ b/katana/src/PreProcess.cpp @@ -360,6 +360,7 @@ namespace { } +#if THIS_IS_DISABLED void metal2protect ( AutoContactTerminal* contact ) { const Layer* metal2 = Session::getRoutingLayer(1); @@ -394,6 +395,7 @@ namespace { cdebug_log(145,0) << "X:" << DbU::getValueString(position.getX()) << " Metal3 Track Y:" << DbU::getValueString(metal3axis) << endl; } +#endif } // End of local namespace. diff --git a/katana/src/PyKatanaEngine.cpp b/katana/src/PyKatanaEngine.cpp index 3f7dc83f..3383166d 100644 --- a/katana/src/PyKatanaEngine.cpp +++ b/katana/src/PyKatanaEngine.cpp @@ -196,19 +196,25 @@ extern "C" { } - PyObject* PyKatanaEngine_runGlobalRouter ( PyKatanaEngine* self ) + PyObject* PyKatanaEngine_runGlobalRouter ( PyKatanaEngine* self, PyObject* args ) { cdebug_log(40,0) << "PyKatanaEngine_runGlobalRouter()" << endl; HTRY METHOD_HEAD("KatanaEngine.runGlobalRouter()") - if (katana->getViewer()) { - if (ExceptionWidget::catchAllWrapper( std::bind(&KatanaEngine::runGlobalRouter,katana) )) { - PyErr_SetString( HurricaneError, "KatanaEngine::runGlobalrouter() has thrown an exception (C++)." ); - return NULL; + uint64_t flags = 0; + if (PyArg_ParseTuple(args,"L:KatanaEngine.runGlobalRouter", &flags)) { + if (katana->getViewer()) { + if (ExceptionWidget::catchAllWrapper( std::bind(&KatanaEngine::runGlobalRouter,katana,flags) )) { + PyErr_SetString( HurricaneError, "KatanaEngine::runGlobalrouter() has thrown an exception (C++)." ); + return NULL; + } + } else { + katana->runGlobalRouter( flags ); } } else { - katana->runGlobalRouter(); + PyErr_SetString(ConstructorError, "KatanaEngine.runGlobalRouter(): Invalid number/bad type of parameter."); + return NULL; } HCATCH @@ -319,47 +325,56 @@ extern "C" { // Standart Accessors (Attributes). - DirectVoidToolMethod(KatanaEngine,katana,printConfiguration) - DirectVoidToolMethod(KatanaEngine,katana,finalizeLayout) - DirectVoidMethod(KatanaEngine,katana,dumpMeasures) - DirectGetBoolAttribute(PyKatanaEngine_getToolSuccess,getToolSuccess,PyKatanaEngine,KatanaEngine) + DirectVoidToolMethod (KatanaEngine,katana,printConfiguration) + DirectVoidToolMethod (KatanaEngine,katana,finalizeLayout) + DirectVoidToolMethod (KatanaEngine,katana,resetRouting) + DirectVoidMethod (KatanaEngine,katana,dumpMeasures) + DirectGetBoolAttribute(PyKatanaEngine_isGlobalRoutingSuccess,isGlobalRoutingSuccess,PyKatanaEngine,KatanaEngine) + DirectGetBoolAttribute(PyKatanaEngine_isDetailedRoutingSuccess,isDetailedRoutingSuccess,PyKatanaEngine,KatanaEngine) + DirectGetUIntAttribute(PyKatanaEngine_getSuccessState,getSuccessState,PyKatanaEngine,KatanaEngine) // Standart Destroy (Attribute). DBoDestroyAttribute(PyKatanaEngine_destroy,PyKatanaEngine) PyMethodDef PyKatanaEngine_Methods[] = - { { "get" , (PyCFunction)PyKatanaEngine_get , METH_VARARGS|METH_STATIC - , "Returns the Katana engine attached to the Cell, None if there isnt't." } - , { "create" , (PyCFunction)PyKatanaEngine_create , METH_VARARGS|METH_STATIC - , "Create a Katana engine on this cell." } - , { "setViewer" , (PyCFunction)PyKatanaEngine_setViewer , METH_VARARGS - , "Associate a Viewer to this KatanaEngine." } - , { "digitalInit" , (PyCFunction)PyKatanaEngine_digitalInit , METH_NOARGS - , "Setup Katana for digital routing." } - , { "exclude" , (PyCFunction)PyKatanaEngine_exclude , METH_VARARGS - , "Exclude a net from routing." } - , { "printConfiguration" , (PyCFunction)PyKatanaEngine_printConfiguration , METH_NOARGS - , "Display on the console the configuration of Katana." } - , { "getToolSuccess" , (PyCFunction)PyKatanaEngine_getToolSuccess , METH_NOARGS - , "Returns True if the detailed routing has been successful." } - , { "runGlobalRouter" , (PyCFunction)PyKatanaEngine_runGlobalRouter , METH_NOARGS - , "Run the global router (Katana)." } - , { "loadGlobalRouting" , (PyCFunction)PyKatanaEngine_loadGlobalRouting , METH_VARARGS - , "Load global routing into the detailed router." } - , { "layerAssign" , (PyCFunction)PyKatanaEngine_layerAssign , METH_VARARGS - , "Run the layer assigment stage." } - , { "runNegociatePreRouted", (PyCFunction)PyKatanaEngine_runNegociatePreRouted, METH_NOARGS - , "Run the negociation stage for pre-routed of the detailed router." } - , { "runNegociate" , (PyCFunction)PyKatanaEngine_runNegociate , METH_VARARGS - , "Run the negociation stage of the detailed router." } - , { "finalizeLayout" , (PyCFunction)PyKatanaEngine_finalizeLayout , METH_NOARGS - , "Revert to a pure Hurricane database, remove router's additionnal data structures." } - , { "dumpMeasures" , (PyCFunction)PyKatanaEngine_dumpMeasures , METH_NOARGS - , "Dump to disk lots of statistical informations about the routing." } - , { "destroy" , (PyCFunction)PyKatanaEngine_destroy , METH_NOARGS - , "Destroy the associated hurricane object. The python object remains." } - , {NULL, NULL, 0, NULL} /* sentinel */ + { { "get" , (PyCFunction)PyKatanaEngine_get , METH_VARARGS|METH_STATIC + , "Returns the Katana engine attached to the Cell, None if there isnt't." } + , { "create" , (PyCFunction)PyKatanaEngine_create , METH_VARARGS|METH_STATIC + , "Create a Katana engine on this cell." } + , { "setViewer" , (PyCFunction)PyKatanaEngine_setViewer , METH_VARARGS + , "Associate a Viewer to this KatanaEngine." } + , { "digitalInit" , (PyCFunction)PyKatanaEngine_digitalInit , METH_NOARGS + , "Setup Katana for digital routing." } + , { "exclude" , (PyCFunction)PyKatanaEngine_exclude , METH_VARARGS + , "Exclude a net from routing." } + , { "printConfiguration" , (PyCFunction)PyKatanaEngine_printConfiguration , METH_NOARGS + , "Display on the console the configuration of Katana." } + , { "getSuccessState" , (PyCFunction)PyKatanaEngine_getSuccessState , METH_NOARGS + , "Returns the success statuses of both global & detailed routing." } + , { "isGlobalRoutingSuccess" , (PyCFunction)PyKatanaEngine_isGlobalRoutingSuccess , METH_NOARGS + , "Returns True if the global routing has been successful." } + , { "isDetailedRoutingSuccess" , (PyCFunction)PyKatanaEngine_isDetailedRoutingSuccess, METH_NOARGS + , "Returns True if the detailed routing has been successful." } + , { "runGlobalRouter" , (PyCFunction)PyKatanaEngine_runGlobalRouter , METH_VARARGS + , "Run the global router (Katana)." } + , { "loadGlobalRouting" , (PyCFunction)PyKatanaEngine_loadGlobalRouting , METH_VARARGS + , "Load global routing into the detailed router." } + , { "layerAssign" , (PyCFunction)PyKatanaEngine_layerAssign , METH_VARARGS + , "Run the layer assigment stage." } + , { "runNegociatePreRouted" , (PyCFunction)PyKatanaEngine_runNegociatePreRouted , METH_NOARGS + , "Run the negociation stage for pre-routed of the detailed router." } + , { "runNegociate" , (PyCFunction)PyKatanaEngine_runNegociate , METH_VARARGS + , "Run the negociation stage of the detailed router." } + , { "finalizeLayout" , (PyCFunction)PyKatanaEngine_finalizeLayout , METH_NOARGS + , "Revert to a pure Hurricane database, remove router's additionnal data structures." } + , { "resetRouting" , (PyCFunction)PyKatanaEngine_resetRouting , METH_NOARGS + , "Remove all router's work, revert to placed only design." } + , { "dumpMeasures" , (PyCFunction)PyKatanaEngine_dumpMeasures , METH_NOARGS + , "Dump to disk lots of statistical informations about the routing." } + , { "destroy" , (PyCFunction)PyKatanaEngine_destroy , METH_NOARGS + , "Destroy the associated hurricane object. The python object remains." } + , {NULL, NULL, 0, NULL} /* sentinel */ }; @@ -385,6 +400,10 @@ extern "C" { PyKatanaFlags_postModuleInit(); PyDict_SetItemString( PyTypeKatanaEngine.tp_dict, "Flags", (PyObject*)&PyTypeKatanaFlags ); + + PyObject* constant = NULL; + LoadObjectConstant( PyTypeKatanaEngine.tp_dict, KatanaEngine::GlobalRoutingSuccess , "GlobalRoutingSuccess" ) + LoadObjectConstant( PyTypeKatanaEngine.tp_dict, KatanaEngine::DetailedRoutingSuccess, "DetailedRoutingSuccess" ) } diff --git a/katana/src/PyKatanaFlags.cpp b/katana/src/PyKatanaFlags.cpp index b42f9ae0..3fef92bf 100644 --- a/katana/src/PyKatanaFlags.cpp +++ b/katana/src/PyKatanaFlags.cpp @@ -93,10 +93,13 @@ extern "C" { { PyObject* constant; - LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::NoFlags ,"NoFlags" ); - LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::SlowMotion ,"SlowMotion" ); - LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::PreRoutedStage,"PreRoutedStage"); - LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::PairSymmetrics,"PairSymmetrics"); + LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::NoFlags ,"NoFlags" ); + LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::SlowMotion ,"SlowMotion" ); + LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::PreRoutedStage ,"PreRoutedStage" ); + LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::PairSymmetrics ,"PairSymmetrics" ); + LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::ShowFailedGSegments ,"ShowFailedGSegments" ); + LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::ShowOverloadedGCells,"ShowOverloadedGCells"); + LoadObjectConstant(PyTypeKatanaFlags.tp_dict,(uint64_t)Katana::Flags::ShowBloatedInstances,"ShowBloatedInstances"); } diff --git a/katana/src/katana/Configuration.h b/katana/src/katana/Configuration.h index 88824e17..04e542e1 100644 --- a/katana/src/katana/Configuration.h +++ b/katana/src/katana/Configuration.h @@ -53,7 +53,9 @@ namespace Katana { , RipupLimitsTableSize = 5 }; enum Constants { MaxMetalDepth = 20 }; - enum Flag { UseClockTree = (1 << 0) }; + enum Flag { UseClockTree = (1 << 0) + , UseGlobalEstimate = (1 << 1) + }; public: // Constructor & Destructor. virtual Configuration* clone () const; @@ -61,6 +63,7 @@ namespace Katana { ~Configuration (); // Decorateds. inline bool useClockTree () const; + inline bool useGlobalEstimate () const; inline bool profileEventCosts () const; // Methods. inline Anabatic::Configuration* base (); @@ -69,6 +72,7 @@ namespace Katana { inline uint64_t getEventsLimit () const; inline uint32_t getRipupCost () const; uint32_t getRipupLimit ( uint32_t type ) const; + inline uint32_t getSearchHalo () const; inline uint32_t getHTracksReservedLocal () const; inline uint32_t getVTracksReservedLocal () const; inline uint32_t getTermSatReservedLocal () const; @@ -89,6 +93,7 @@ namespace Katana { private: // Attributes. PostEventCb_t _postEventCb; + uint32_t _searchHalo; uint32_t _hTracksReservedLocal; uint32_t _vTracksReservedLocal; uint32_t _termSatReservedLocal; @@ -109,6 +114,7 @@ namespace Katana { inline Anabatic::Configuration* Configuration::base () { return dynamic_cast(this); } inline Configuration::PostEventCb_t& Configuration::getPostEventCb () { return _postEventCb; } inline uint64_t Configuration::getEventsLimit () const { return _eventsLimit; } + inline uint32_t Configuration::getSearchHalo () const { return _searchHalo; } inline uint32_t Configuration::getRipupCost () const { return _ripupCost; } inline uint32_t Configuration::getHTracksReservedLocal () const { return _hTracksReservedLocal; } inline uint32_t Configuration::getVTracksReservedLocal () const { return _vTracksReservedLocal; } @@ -118,6 +124,7 @@ namespace Katana { inline void Configuration::setPostEventCb ( PostEventCb_t cb ) { _postEventCb = cb; } inline void Configuration::setEventsLimit ( uint64_t limit ) { _eventsLimit = limit; } inline bool Configuration::useClockTree () const { return _flags & UseClockTree; } + inline bool Configuration::useGlobalEstimate () const { return _flags & UseGlobalEstimate; } inline bool Configuration::profileEventCosts () const { return _profileEventCosts; } inline void Configuration::setFlags ( unsigned int flags ) { _flags |= flags; } inline void Configuration::unsetFlags ( unsigned int flags ) { _flags &= ~flags; } diff --git a/katana/src/katana/Constants.h b/katana/src/katana/Constants.h index 8194994d..83eee998 100644 --- a/katana/src/katana/Constants.h +++ b/katana/src/katana/Constants.h @@ -39,6 +39,9 @@ namespace Katana { static const Hurricane::BaseFlags SlowMotion; static const Hurricane::BaseFlags PreRoutedStage; static const Hurricane::BaseFlags PairSymmetrics; + static const Hurricane::BaseFlags ShowFailedGSegments; + static const Hurricane::BaseFlags ShowOverloadedGCells; + static const Hurricane::BaseFlags ShowBloatedInstances; public: inline Flags ( uint64_t ); inline Flags ( const Super& ); diff --git a/katana/src/katana/KatanaEngine.h b/katana/src/katana/KatanaEngine.h index 31ec9e7a..077a0aaf 100644 --- a/katana/src/katana/KatanaEngine.h +++ b/katana/src/katana/KatanaEngine.h @@ -57,10 +57,12 @@ namespace Katana { class KatanaEngine : public AnabaticEngine { public: - static const uint32_t DigitalMode = (1 << 0); - static const uint32_t AnalogMode = (1 << 1); - static const uint32_t MixedMode = (1 << 2); - static const uint32_t ChannelMode = (1 << 3); + static const uint32_t DigitalMode = (1 << 0); + static const uint32_t AnalogMode = (1 << 1); + static const uint32_t MixedMode = (1 << 2); + static const uint32_t ChannelMode = (1 << 3); + static const uint32_t GlobalRoutingSuccess = (1 << 0); + static const uint32_t DetailedRoutingSuccess = (1 << 1); public: typedef AnabaticEngine Super; public: @@ -72,16 +74,20 @@ namespace Katana { inline bool isAnalogMode () const; inline bool isMixedMode () const; inline bool isChannelMode () const; + inline bool isGlobalRoutingSuccess () const; + inline bool isDetailedRoutingSuccess () const; inline bool useClockTree () const; + inline bool useGlobalEstimate () const; inline CellViewer* getViewer () const; inline AnabaticEngine* base (); inline Configuration* getKatanaConfiguration (); virtual Configuration* getConfiguration (); - inline bool getToolSuccess () const; + inline uint32_t getSuccessState () const; inline uint64_t getEventsLimit () const; inline uint32_t getRipupLimit ( uint32_t type ) const; uint32_t getRipupLimit ( const TrackElement* ) const; inline uint32_t getRipupCost () const; + inline uint32_t getSearchHalo () const; inline uint32_t getHTracksReservedLocal () const; inline uint32_t getVTracksReservedLocal () const; inline uint32_t getTermSatReservedLocal () const; @@ -102,6 +108,8 @@ namespace Katana { void printCompletion () const; void dumpMeasures ( std::ostream& ) const; void dumpMeasures () const; + inline void setGlobalRoutingSuccess ( bool ) const; + inline void setDetailedRoutingSuccess ( bool ) const; virtual void openSession (); inline void setViewer ( CellViewer* ); inline void setPostEventCb ( Configuration::PostEventCb_t ); @@ -128,12 +136,14 @@ namespace Katana { void pairSymmetrics (); void updateEstimateDensity ( NetData*, double weight ); void runNegociate ( Flags flags=Flags::NoFlags ); - void runGlobalRouter (); + void runGlobalRouter ( Flags flags=Flags::NoFlags ); void computeGlobalWireLength ( long& wireLength, long& viaCount ); void runTest (); + void resetRouting (); virtual void finalizeLayout (); void _runKatanaInit (); void _gutKatana (); + void _buildBloatProfile (); void _computeCagedConstraints (); TrackElement* _lookup ( Segment* ) const; inline TrackElement* _lookup ( AutoSegment* ) const; @@ -157,7 +167,7 @@ namespace Katana { TrackElementPairing _shortDoglegs; DataSymmetricMap _symmetrics; uint32_t _mode; - mutable bool _toolSuccess; + mutable uint32_t _successState; protected: // Constructors & Destructors. KatanaEngine ( Cell* ); @@ -175,14 +185,18 @@ namespace Katana { inline bool KatanaEngine::isAnalogMode () const { return (_mode & AnalogMode); }; inline bool KatanaEngine::isMixedMode () const { return (_mode & MixedMode); }; inline bool KatanaEngine::isChannelMode () const { return (_mode & ChannelMode); }; + inline bool KatanaEngine::isGlobalRoutingSuccess () const { return (_successState & GlobalRoutingSuccess); } + inline bool KatanaEngine::isDetailedRoutingSuccess() const { return (_successState & DetailedRoutingSuccess); } inline bool KatanaEngine::useClockTree () const { return _configuration->useClockTree(); } + inline bool KatanaEngine::useGlobalEstimate () const { return _configuration->useGlobalEstimate(); } inline CellViewer* KatanaEngine::getViewer () const { return _viewer; } inline AnabaticEngine* KatanaEngine::base () { return static_cast(this); } inline Configuration* KatanaEngine::getKatanaConfiguration () { return _configuration; } inline Configuration::PostEventCb_t& KatanaEngine::getPostEventCb () { return _configuration->getPostEventCb(); } - inline bool KatanaEngine::getToolSuccess () const { return _toolSuccess; } + inline uint32_t KatanaEngine::getSuccessState () const { return _successState; } inline uint64_t KatanaEngine::getEventsLimit () const { return _configuration->getEventsLimit(); } inline uint32_t KatanaEngine::getRipupCost () const { return _configuration->getRipupCost(); } + inline uint32_t KatanaEngine::getSearchHalo () const { return _configuration->getSearchHalo(); } inline uint32_t KatanaEngine::getHTracksReservedLocal () const { return _configuration->getHTracksReservedLocal(); } inline uint32_t KatanaEngine::getVTracksReservedLocal () const { return _configuration->getVTracksReservedLocal(); } inline uint32_t KatanaEngine::getTermSatReservedLocal () const { return _configuration->getTermSatReservedLocal(); } @@ -218,6 +232,17 @@ namespace Katana { return NULL; } + inline void KatanaEngine::setGlobalRoutingSuccess ( bool state ) const + { + if (state) _successState |= GlobalRoutingSuccess; + else _successState &= ~GlobalRoutingSuccess; + } + + inline void KatanaEngine::setDetailedRoutingSuccess( bool state ) const + { + if (state) _successState |= DetailedRoutingSuccess; + else _successState &= ~DetailedRoutingSuccess; + } // Variables. extern const char* missingRW; diff --git a/kite/CMakeLists.txt b/kite/CMakeLists.txt index ba298a44..b9eac3cb 100644 --- a/kite/CMakeLists.txt +++ b/kite/CMakeLists.txt @@ -8,6 +8,8 @@ cmake_minimum_required(VERSION 2.8.9) + set(ignoreVariables "${CMAKE_INSTALL_DIR}") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) setup_project_paths(CORIOLIS) diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 9ed668f1..5608a8ba 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -738,10 +738,10 @@ namespace Kite { cmess1 << Dots::asString( " - Wire Length Expand Ratio", result.str() ) << endl; } - addMeasure ( getCell(), "Segs" , routeds+unrouteds.size() ); - addMeasure( getCell(), "DWL(l)" , totalWireLength , 12 ); - addMeasure( getCell(), "fWL(l)" , totalWireLength-routedWireLength , 12 ); - addMeasure ( getCell(), "WLER(%)", (expandRatio-1.0)*100.0 ); + addMeasure ( "Segs" , routeds+unrouteds.size() ); + addMeasure( "DWL(l)" , totalWireLength , 12 ); + addMeasure( "fWL(l)" , totalWireLength-routedWireLength , 12 ); + addMeasure ( "WLER(%)", (expandRatio-1.0)*100.0 ); } @@ -775,9 +775,10 @@ namespace Kite { out << "#" << endl; out << "# " << getCell()->getName() << endl; out << measures->toStringHeaders(measuresLabels) << endl; - out << measures->toStringDatas (measuresLabels) << endl; + for ( size_t i=0 ; itoStringDatas(measuresLabels,i) << endl; - measures->toGnuplot( "GCells Density Histogram", getString(getCell()->getName()) ); + //measures->toGnuplot( "GCells Density Histogram", getString(getCell()->getName()) ); } diff --git a/kite/src/NegociateWindow.cpp b/kite/src/NegociateWindow.cpp index 0b6241e2..3ce6124a 100644 --- a/kite/src/NegociateWindow.cpp +++ b/kite/src/NegociateWindow.cpp @@ -608,11 +608,11 @@ namespace Kite { cmess1 << Dots::asSizet(" - # of GCells",_statistics.getGCellsCount()) << endl; _kite->printCompletion(); - addMeasure( getCell(), "Events" , RoutingEvent::getProcesseds(), 12 ); - addMeasure( getCell(), "UEvents", RoutingEvent::getProcesseds()-RoutingEvent::getCloneds(), 12 ); + _kite->addMeasure( "Events" , RoutingEvent::getProcesseds(), 12 ); + _kite->addMeasure( "UEvents", RoutingEvent::getProcesseds()-RoutingEvent::getCloneds(), 12 ); Histogram* densityHistogram = new Histogram ( 1.0, 0.1, 2 ); - addMeasure( getCell(), "GCells Density Histogram", densityHistogram ); + _kite->addMeasure( "GCells Density Histogram", densityHistogram ); densityHistogram->setFileExtension( ".density.histogram" ); densityHistogram->setMainTitle ( "GCell Densities" ); diff --git a/knik/CMakeLists.txt b/knik/CMakeLists.txt index 97d68038..e91ca784 100644 --- a/knik/CMakeLists.txt +++ b/knik/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.8.9) - set(ignoreVariables "${BUILD_DOC}") + set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) diff --git a/knik/src/KnikEngine.cpp b/knik/src/KnikEngine.cpp index 325fd3b1..d29afa8d 100644 --- a/knik/src/KnikEngine.cpp +++ b/knik/src/KnikEngine.cpp @@ -1082,8 +1082,8 @@ void KnikEngine::run( const map& excludedNets ) << Timer::getStringMemory(Timer::getMemorySize()); cmess2 << Dots::asString( " - Raw measurements", result.str() ) << endl; - addMeasure ( getCell(), "knikT", _timer.getCombTime () ); - addMeasure ( getCell(), "knikS", (_timer.getMemorySize() >> 20) ); + addMeasure ( "knikT", _timer.getCombTime () ); + addMeasure ( "knikS", (_timer.getMemorySize() >> 20) ); computeSymbolicWireLength (); } @@ -1307,13 +1307,13 @@ void KnikEngine::computeSymbolicWireLength () } } - addMeasure ( getCell(), "GWL(l)", symbolicWireLength, 14 ); + addMeasure ( "GWL(l)", symbolicWireLength, 14 ); Box ab ( getCell()->getAbutmentBox() ); double area = (DbU::getLambda(ab.getWidth()) * DbU::getLambda(ab.getHeight()) ); - addMeasure ( getCell(), "Area(l2)", area, 14 ); - addMeasure ( getCell(), "Sat." , (symbolicWireLength/area)/normalize ); + addMeasure ( "Area(l2)", area, 14 ); + addMeasure ( "Sat." , (symbolicWireLength/area)/normalize ); } diff --git a/knik/src/LoadSolution.cpp b/knik/src/LoadSolution.cpp index 7f726039..98831618 100644 --- a/knik/src/LoadSolution.cpp +++ b/knik/src/LoadSolution.cpp @@ -447,8 +447,8 @@ namespace Knik { SolutionParser parser ( this, loadFileName ); parser.load (); - addMeasure ( getCell(), "knikT", 0.0, 8 ); - addMeasure ( getCell(), "knikS", 0 , 8 ); + addMeasure ( "knikT", 0.0, 8 ); + addMeasure ( "knikS", 0 , 8 ); computeSymbolicWireLength (); } diff --git a/lefdef/src/def/defzlib/CMakeLists.txt b/lefdef/src/def/defzlib/CMakeLists.txt index 63d1d268..e1f96319 100644 --- a/lefdef/src/def/defzlib/CMakeLists.txt +++ b/lefdef/src/def/defzlib/CMakeLists.txt @@ -11,7 +11,7 @@ ) add_library ( defzlib ${cpps} ) - target_link_libraries ( defzlib def ) + target_link_libraries ( defzlib def z ) set_target_properties ( defzlib PROPERTIES VERSION 5.8 SOVERSION 5 ) install ( TARGETS defzlib DESTINATION lib${LIB_SUFFIX} ) diff --git a/lefdef/src/lef/lefzlib/CMakeLists.txt b/lefdef/src/lef/lefzlib/CMakeLists.txt index 3028f876..9fda26fa 100644 --- a/lefdef/src/lef/lefzlib/CMakeLists.txt +++ b/lefdef/src/lef/lefzlib/CMakeLists.txt @@ -11,7 +11,7 @@ ) add_library ( lefzlib ${cpps} ) - target_link_libraries ( lefzlib lef ) + target_link_libraries ( lefzlib lef z ) set_target_properties ( lefzlib PROPERTIES VERSION 5.8 SOVERSION 5 ) install ( TARGETS lefzlib DESTINATION lib${LIB_SUFFIX} ) diff --git a/oroshi/CMakeLists.txt b/oroshi/CMakeLists.txt index fe87cf6f..2cfa5f79 100644 --- a/oroshi/CMakeLists.txt +++ b/oroshi/CMakeLists.txt @@ -3,6 +3,8 @@ project(OROSHI) cmake_minimum_required(VERSION 2.4.0) + + set(ignoreVariables "${CMAKE_INSTALL_DIR}") list(INSERT CMAKE_MODULE_PATH 0 "$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) diff --git a/solstice/CMakeLists.txt b/solstice/CMakeLists.txt index f09c1e6d..91c8bca9 100644 --- a/solstice/CMakeLists.txt +++ b/solstice/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.8.9) - set(ignoreVariables "${BUILD_DOC}") + set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) diff --git a/stratus1/CMakeLists.txt b/stratus1/CMakeLists.txt index 1bb7ba12..18969ad6 100644 --- a/stratus1/CMakeLists.txt +++ b/stratus1/CMakeLists.txt @@ -3,7 +3,9 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0) project(STRATUS1) - # option(BUILD_DOC "Build the documentation (latex2html)" OFF) +#option(BUILD_DOC "Build the documentation (latex2html)" OFF) + + set(ignoreVariables "${BUILD_DOC}" "${CMAKE_INSTALL_DIR}") cmake_minimum_required(VERSION 2.4.0) list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") diff --git a/tutorial/CMakeLists.txt b/tutorial/CMakeLists.txt index dbb6c4e2..6afbd210 100644 --- a/tutorial/CMakeLists.txt +++ b/tutorial/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 2.8.9) - set(ignoreVariables "${LIB_SUFFIX} ${BUILD_DOC}") + set(ignoreVariables "${LIB_SUFFIX} ${BUILD_DOC} ${CMAKE_INSTALL_DIR}") list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) diff --git a/unicorn/CMakeLists.txt b/unicorn/CMakeLists.txt index 6a93dd34..a2eba8d3 100644 --- a/unicorn/CMakeLists.txt +++ b/unicorn/CMakeLists.txt @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 2.8.9) + set(ignoreVariables "${CMAKE_INSTALL_DIR}") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) setup_project_paths(CORIOLIS) diff --git a/unicorn/src/cgt.py b/unicorn/src/cgt.py index 2dcdb40b..958698d2 100755 --- a/unicorn/src/cgt.py +++ b/unicorn/src/cgt.py @@ -11,9 +11,9 @@ try: import Hurricane import Viewer import CRL + import Etesian import Anabatic import Katana - import Etesian import Katabatic import Kite import Bora @@ -234,7 +234,7 @@ if __name__ == '__main__': katana.loadGlobalRouting ( Anabatic.EngineLoadGrByNet ) katana.layerAssign ( Anabatic.EngineNoNetLayerAssign ) katana.runNegociate ( Katana.Flags.NoFlags ) - kiteSuccess = katana.getToolSuccess() + kiteSuccess = katana.isDetailedRoutingSuccess() #katana.finalizeLayout() katana.destroy() diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 405db044..ca89f830 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.8.9) - set(ignoreVariables "${BUILD_DOC}") + set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) diff --git a/vlsisapd/CMakeLists.txt b/vlsisapd/CMakeLists.txt index 12b42137..15eeb37d 100644 --- a/vlsisapd/CMakeLists.txt +++ b/vlsisapd/CMakeLists.txt @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 2.8.9) + set(ignoreVariables "${CMAKE_INSTALL_DIR}") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) list(INSERT CMAKE_MODULE_PATH 0 "${VLSISAPD_SOURCE_DIR}/cmake_modules/")