Groudwork for routing density driven placement. Compliance with clang 5.0.1.

This commit contains two set of features that should have been commited
separately.
  1. Compliance with clang 5.0.1, tested with the RedHat collection
     llvm-toolset-7. This allow Coriolis to be compiled under Darwin (MacOS)
     with Xcode & macports. The bootstrap install system has been modificated
     accordingly.
  2. The basic support for routing density driven placement. Related
     features are:
     * Bloat property. Each Occurrence of an Instance can be individually
       bloated. This property not attached to any tool to allow the placer and
       router to share it as wanted. Nevertheless, it is defined in Etesian.
     * BloatProfile in Katana, add individual Bloat properties to Instances
       occurrences based on the East & North overflowed edges of each GCell.
     * Support in ToolEngine for a "pass number" of a tool. This pass number
       is mainly used to make "per pass" measurements. The MeasureSet system
       is improved accordingly to support multiple values of a same measure.
     * Embryo of "P&R Conductor" to perform the place & route loop until the
       design is successfully placed. May be the first brick of a Silicon
       Compiler.

* Change: In boostrap/FindBoostrap.cmake, in setup_boost(), added tag to
    the python component for macport (ex: python27).
* Change: In boostrap/build.conf, put etesian before anabatic for
    instance occurrence BloatProperty dependency.
      Added option support for the "llvm-toolset-7" collection to build
    against clang 5.0.1.
* Bug: In Hurricane::getRecord( const pair<T,U>& ), the getSlot<> templates
    for first & second arguments must be called with <const T> and <const U>
    as the pair itself is const (and not simply <T> & <U>).
* Change: In Hurricane::getSlot() temlate, only use "string" arguments and
    not const string&, simpler for template argument deduction.
* Bug: In Hurricane::AnalogCellExtension, the StandardPrivateProperty<>
    template has a static member "_name". Clang did show that the template
    for this static number has to be put inside the namespace where the
    template *is defined* (i.e. Hurricane) instead of the namespace where
    it is instanciated (i.e. Analog).
* Bug: In Isobar, Matrix_FromListOfList(), PyInt_AsPlacementStatus() must
    be put outside the C linkage back in the Isobar C++ namespace (clang).
* Bug: In Hurricane::DBo::~DBo, and derived add a throw() specification
    (clang).
* Bug: In Hurricane::RegularLayer::getEnclosure() & setEnclosure(), change
    signature so it matches the one of the base class (clang).
* Bug: In Hurricane::CellPrinter, use double brackets for initializer list
    (clang).
* Change: In Hurricane::Breakpoint, reverse the meaning of the error level.
    Only error level *lesser or equal* than the stop level will be enabled.
* Bug: In CRL/python/helpers/__init__.loadUserSettings(), must put the
    current working directory in the sys.path as in certain configuration
    it may not be included.
* Bug: In CRL::ApDriver, DumpSegments(), no longer generate segments when
    encountering a RoutingPad on a top-level Pin Occurrence. The segment
    was generated in the wrong direction, creating DRC violations on the
    "mips_core_flat" example.
* Change: In CRL::Measures, partial re-design of the measurements management.
    Now, each kind of measure can accept multiple values put in a vector.
    The index is intented to match a tool run number.
* Change: In CRL::Histogram, add support for multiple sets of datas,
    indexeds with tool run number.
* Change: In CRL::ToolEngine, add support for multiple pass number, add
    addMeasure<> templates for the various data-types.
* Change: In CRL::gdsDriver & CRL::gdsParser(), comment out unused GDS record
    name constants.
* New: Etesian::BloatProperty, property to attach to Instance occurrences
    that contains the extra number of pitch to add to the cell width.
* Bug: In AutoSegment::CompareByDepthLength, the segment length comparison
    was wrong, it was always returning true, which broke the "strick weak
    ordering" of the comparison.
      This was producing a core-dump in GCell::updateDensity() when sorting
    a vector<>. The end() iterator was being dereferenced, leading to the
    problem.
* Bug: In Katana::DataSymmetric::checkPairing(), the test for segments
    whose axis is perpandicular to the symmetry axis was wrong
    ("!=" instead of "-").
* New: In Katana/GlobalRoute, new ::selectSegments(), selectOverloadedgcells()
    and selectBloatedInstances() to automatically select segments from
    overloaded edges, overloaded GCells and bloated cells.
* Change: In KatanaEngine, return a more detailed success state, distinguish
    between global and detailed.
      Add support for multiple routing iterations.
* New: In cumulus/python/plugins/ConductorPlugin.py, embryo of routing
    driven placement.
This commit is contained in:
Jean-Paul Chaput 2019-12-09 01:57:44 +01:00
parent a3b006a809
commit 68e45bc5ab
123 changed files with 1886 additions and 644 deletions

View File

@ -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)

View File

@ -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<size_t>( getCell(), "Globals", AutoSegment::getGlobalsCount() );
addMeasure<size_t>( getCell(), "Edges" , AutoSegment::getAllocateds() );
addMeasure<size_t>( "Globals", AutoSegment::getGlobalsCount() );
addMeasure<size_t>( "Edges" , AutoSegment::getAllocateds() );
}

View File

@ -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();

View File

@ -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<DbU::Unit*,3>( { viaToTopCap, viaToBottomCap, viaToSameCap } ) );
_extensionCaps.push_back( std::array<DbU::Unit*,3>( {{ viaToTopCap, viaToBottomCap, viaToSameCap }} ) );
}
}

View File

@ -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();

View File

@ -533,6 +533,7 @@ namespace Anabatic {
cout << " o Configuration of ToolEngine<Anabatic> 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;
}

View File

@ -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() );

View File

@ -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() );

View File

@ -527,8 +527,8 @@ namespace Anabatic {
vector<AutoSegment*> southBounds;
DbU::Unit leftBound;
DbU::Unit rightBound;
bool hasNorth = false;
bool hasSouth = false;
//bool hasNorth = false;
//bool hasSouth = false;
AutoSegment::getTopologicalInfos( horizontal
, collapseds

View File

@ -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<Segment*>( getFromHook()->getComponent() )

View File

@ -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)

View File

@ -15,16 +15,16 @@ projects = [
, 'tools' : [ "bootstrap"
, "lefdef"
, "flute"
, "coloquinte"
, "vlsisapd"
, "hurricane"
, "crlcore"
, "etesian"
, "anabatic"
, "katana"
, "knik"
, "katabatic"
, "kite"
, "coloquinte"
, "etesian"
, "equinox"
, "solstice"
, "oroshi"

View File

@ -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

View File

@ -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 )

View File

@ -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}")

View File

@ -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)

View File

@ -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<size_t>::iterator itpair = _nextSet.begin();
Symmetry symmetry;
const VSlicingNodes& children = _HVSnode->getChildren();
for ( size_t ichild=0 ; ichild<children.size() ; ++ichild ) {

View File

@ -104,8 +104,6 @@ extern "C" {
static PyObject* PyBoraEngine_updatePlacement ( PyBoraEngine* self, PyObject* args )
{
unsigned int bsIndex = 0;
METHOD_HEAD( "BoraEngine.updatePlacement()" )
HTRY
PyObject* arg0;

View File

@ -91,7 +91,6 @@ extern "C" {
static PyObject* PyMatrixParameterRange_getValue ( PyMatrixParameterRange* self, PyObject* args )
{
Matrix* matrix = NULL;
PyMatrix* pyMatrix = NULL;
METHOD_HEAD( "MatrixParameterRange.getValue()" );

View File

@ -58,6 +58,7 @@ extern "C" {
, { "getSize" , (PyCFunction)PyParameterRange_getSize , METH_NOARGS , "To be documented." }
, { "progress" , (PyCFunction)PyParameterRange_progress , METH_NOARGS , "To be documented." }
, { "setIndex" , (PyCFunction)PyParameterRange_setIndex , METH_VARARGS, "To be documented." }
, { "reset" , (PyCFunction)PyParameterRange_reset , METH_NOARGS , "To be documented." }
//, { "destroy" , (PyCFunction)PyParameterRange_destroy , METH_NOARGS
// , "Destroy associated hurricane object, the python object remains." }
, {NULL, NULL, 0, NULL} /* sentinel */

View File

@ -488,6 +488,12 @@ namespace Bora {
cdebug_log(535,-1);
}
void SlicingNode::_setGlobalSize ( DbU::Unit, DbU::Unit )
{
cerr << Error( "SlicingNode::_setGlobalSize(): Must not be called on \"%s\"." , _getTypeName().c_str() ) << endl;
}
void SlicingNode::preDestroy ()
{

View File

@ -174,6 +174,7 @@ namespace Bora {
virtual void setGlobalSize ( DbU::Unit height, DbU::Unit width );
virtual void setGlobalSize ( size_t index );
virtual void _setGlobalSize ( BoxSet* );
virtual void _setGlobalSize ( DbU::Unit height, DbU::Unit width );
virtual inline bool recursiveCheckPreset () const;
virtual inline bool recursiveCheckSet () const;
virtual inline bool recursiveCheckPlaced () const;

View File

@ -3,6 +3,8 @@
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
project(COLOQUINTE)
set(ignoreVariables "${CMAKE_INSTALL_DIR}")
option(BUILD_DOC "Build the documentation (doxygen)" OFF)
cmake_minimum_required(VERSION 2.8.9)

View File

@ -3,6 +3,8 @@
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
project(CRLCORE)
set(ignoreVariables "${CMAKE_INSTALL_DIR}")
cmake_minimum_required(VERSION 2.8.9)
OPTION(BUILD_DOC "Build the documentation (latex+doxygen)" OFF)

View File

@ -61,6 +61,8 @@ p = Cfg.getParamEnumerate ( "anabatic.gcell.displayMode" ); p.setInt (
p.addValue( "Boundary", 1 )
p.addValue( "Density" , 2 )
p = Cfg.getParamBool ( "katana.useGlobalEstimate" ); p.setBool ( False )
p = Cfg.getParamInt ( "katana.searchHalo" ); p.setInt ( 1 )
p = Cfg.getParamInt ( "katana.hTracksReservedLocal" ); p.setInt ( 3 ); p.setMin(0); p.setMax(20)
p = Cfg.getParamInt ( "katana.vTracksReservedLocal" ); p.setInt ( 3 ); p.setMin(0); p.setMax(20)
p = Cfg.getParamInt ( "katana.termSatReservedLocal" ); p.setInt ( 8 )

View File

@ -396,6 +396,7 @@ setSysConfDir( False )
def loadUserSettings ():
if os.path.isfile('./coriolis2/settings.py'):
if os.path.isfile('./coriolis2/__init__.py'):
sys.path.insert( 0, os.getcwd() )
import coriolis2.settings
return True
else:

View File

@ -31,7 +31,10 @@ namespace CRL {
using std::ostringstream;
using std::setprecision;
using std::setw;
using std::setfill;
using std::vector;
using std::cerr;
using std::endl;
using Hurricane::Record;
@ -118,8 +121,8 @@ namespace CRL {
size_t titleWidth = _titles[iset].size();
string hline = _indents[iset] + "+-" + string(titleWidth,'-') + "-+-------------+----+\n";
string tline = _indents[iset] + "| " + _titles[iset] + " | Count | % |\n";
string hline = _indents[iset] + "+-" + string(titleWidth,'-') + "-+-------------+-----+\n";
string tline = _indents[iset] + "| " + _titles[iset] + " | Count | % |\n";
s << hline << tline << hline;
@ -131,8 +134,8 @@ namespace CRL {
s << _indents[iset]
<< "| " << setw(titleWidth) << (size_t)(_step*i)
<< " | " << setw(11) << (size_t)(value)
<< " | " << setw( 2) << percent
<< " | " << string( percent, '*' )
<< " | " << setw( 3) << percent
<< " | " << string( percent/2, '*' )
<< "\n";
}
@ -230,34 +233,44 @@ namespace CRL {
}
Measure<Histogram>::Measure ( const Name& name, Histogram* data )
Measure<Histogram>::Measure ( const Name& name )
: BaseMeasure(name,0)
, _data(data)
, _datas ()
{ }
Measure<Histogram>::~Measure ()
{ delete _data; }
{ for ( auto item : _datas ) delete item.second; }
bool Measure<Histogram>::isSimpleData () const
{ return false; }
Histogram* Measure<Histogram>::getData () const
{ return _data; }
Histogram* Measure<Histogram>::getData ( size_t index ) const
{ return (index < _datas.size()) ? _datas[index].second : NULL; }
void Measure<Histogram>::setData ( Histogram* data )
{ _data=data; }
void Measure<Histogram>::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<Histogram>::toString () const
std::string Measure<Histogram>::toString ( size_t ) const
{ return "Unsupported"; }
void Measure<Histogram>::toGnuplot ( std::string basename ) const
{ _data->toGnuplot ( basename ); }
void Measure<Histogram>::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<Histogram>::_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;
}

View File

@ -198,6 +198,7 @@ namespace CRL {
, _routingModificationFlag (0)
, _inRelationDestroy (false)
, _timer ()
, _passNumber (0)
{ }

View File

@ -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<Segment*>(rp->getOccurrence().getEntity());
segment = dynamic_cast<Segment*>( 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<Pin*>(rp->getOccurrence().getEntity());
if (pin) {
Pin* pin = dynamic_cast<Pin*>( 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<Segment*>(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) << ","

View File

@ -69,20 +69,29 @@ namespace CRL {
template<>
class Measure<Histogram> : 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<uint32_t,Histogram*> > _datas;
};
inline bool Measure<Histogram>::hasDataAt ( size_t index ) const
{ return (index < _datas.size()) ? _datas[index].first & BaseMeasure::Set : 0; }
inline size_t Measure<Histogram>::getSize () const
{ return _datas.size(); }
} // CRL namespace.

View File

@ -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<typename Data>
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<uint32_t,Data> > _datas;
};
template<typename Data>
inline Measure<Data>::Measure ( const Name& name, const Data& data, unsigned int width )
: BaseMeasure(name,width), _data(data) { }
inline Measure<Data>::Measure ( const Name& name, unsigned int width )
: BaseMeasure(name,width), _blankData(), _datas() { }
template<typename Data>
inline const Data& Measure<Data>::getData () const { return _data; }
inline bool Measure<Data>::hasDataAt ( size_t index ) const
{ return (index < _datas.size()) ? _datas[index].first & BaseMeasure::Set : 0; }
template<typename Data>
inline void Measure<Data>::setData ( const Data& data ) { _data=data; }
inline size_t Measure<Data>::getSize () const
{ return _datas.size(); }
template<typename Data>
std::string Measure<Data>::toString () const
{ std::ostringstream s; s << std::fixed << std::setprecision(2) << _data; return s.str(); }
inline const Data& Measure<Data>::getData ( size_t index ) const
{ return (index < _datas.size()) ? _datas[index].second : _blankData; }
template<typename Data>
inline void Measure<Data>::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<typename Data>
std::string Measure<Data>::toString ( size_t index ) const
{ std::ostringstream s; s << std::fixed << std::setprecision(2) << getData(index); return s.str(); }
template<typename Data>
std::string Measure<Data>::_getString () const
{ return "<Measure " + Hurricane::demangle(typeid(_data).name()) + ">"; }
{ return "<Measure " + Hurricane::demangle(typeid(_datas[0]).name()) + " [" + getString(_datas.size())+ "]>"; }
template<typename Data>
Record* Measure<Data>::_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<Name>& ) const;
std::string toStringDatas ( const std::vector<Name>& ) const;
void toGnuplot ( Name, const std::string& ) const;
std::string toStringDatas ( const std::vector<Name>&, 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<MeasuresDatas> Extension;
public:
template<typename Data> friend inline void addMeasure ( DBo*, const Name&, const Data&, unsigned int width );
template<typename Data> friend inline void addMeasure ( DBo*, const Name&, const Data& );
template<typename Data> friend inline void addMeasure ( DBo*, const Name&, Data* );
template<typename Data> friend inline void addMeasure ( DBo*, const Name&, size_t index, const Data&, unsigned int width );
template<typename Data> friend inline void addMeasure ( DBo*, const Name&, size_t index, const Data& );
template<typename Data> friend inline void addMeasure ( DBo*, const Name&, size_t index, Data* );
template<typename Data> friend inline const Measure<Data>* getMeasure ( DBo*, const Name& );
static const MeasuresSet* get ( const DBo* );
private:
@ -158,35 +177,41 @@ namespace CRL {
template<typename Data>
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<Data>(name,data,width)) );
} else {
static_cast< Measure<Data>* >( (*imeasure).second )->setData( data );
}
}
template<typename Data>
inline void addMeasure ( DBo* object, const Name& name, const Data& data )
{ return addMeasure(object,name,data,8); }
template<typename Data>
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<Data>* measure = NULL;
if (imeasure == extension->getValue()._measures.end()) {
extension->getValue()._measures.insert( std::make_pair(name,new Measure<Data>(name,data)) );
measure = new Measure<Data>( name, width );
extension->getValue()._measures.insert ( std::make_pair(name,measure) );
} else {
static_cast< Measure<Data>* >( (*imeasure).second )->setData( data );
measure = static_cast< Measure<Data>* >( (*imeasure).second );
}
measure->setData( index, data );
}
template<typename Data>
inline void addMeasure ( DBo* object, const Name& name, size_t index, const Data& data )
{ return ::CRL::addMeasure(object,name,index,data,8); }
template<typename Data>
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<Data>* measure = NULL;
if (imeasure == extension->getValue()._measures.end()) {
measure = new Measure<Data>( name );
extension->getValue()._measures.insert( std::make_pair(name,measure) );
} else {
measure = static_cast< Measure<Data>* >( (*imeasure).second );
}
measure->setData( index, data );
}

View File

@ -15,7 +15,7 @@
// +-----------------------------------------------------------------+
#ifndef CRL_PARSERS_DRIVERS_H_
#ifndef CRL_PARSERS_DRIVERS_H
#define CRL_PARSERS_DRIVERS_H
#include <string>

View File

@ -19,7 +19,6 @@
#define CRL_TOOL_ENGINE_H
#include <string>
#include <vector>
#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<typename Data>
inline void addMeasure ( std::string, const Data&, unsigned int width ) const;
template<typename Data>
inline void addMeasure ( std::string, const Data& ) const;
template<typename Data>
inline void addMeasure ( std::string, Data* ) const;
template<typename Data>
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<typename Data>
inline void ToolEngine::addMeasure ( std::string name, const Data& data, unsigned int width ) const
{ ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data, width ); }
template<typename Data>
inline void ToolEngine::addMeasure ( std::string name, const Data& data ) const
{ ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data ); }
template<typename Data>
inline void ToolEngine::addMeasure ( std::string name, Data* data ) const
{ ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data ); }
template<typename Data>
inline const Data& ToolEngine::getMeasure ( std::string name ) const
{ return ::CRL::getMeasure<Data>( getCell(), getMeasureLabel(name) )->getData( getPassNumber() ); }
} // CRL namespace.

View File

@ -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 );

View File

@ -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)

View File

@ -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 "<Undefined Measure>"; }
Record* BaseMeasure::_getRecord () const { return NULL; }
@ -67,45 +67,48 @@ namespace CRL {
out << "#";
for ( size_t i=0 ; i<names.size() ; ++i ) {
const_iterator imeasure = find ( names[i] );
if ( imeasure == end() ) continue;
const_iterator imeasure = find( names[i] );
if (imeasure == end()) continue;
const BaseMeasure* measure = (*imeasure).second;
if ( measure->isSimpleData() )
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<Name>& names ) const
string MeasuresSet::toStringDatas ( const vector<Name>& names, size_t index ) const
{
ostringstream out;
out << " ";
for ( size_t i=0 ; i<names.size() ; ++i ) {
const_iterator imeasure = find ( names[i] );
if ( imeasure == end() ) continue;
const_iterator imeasure = find( names[i] );
if (imeasure == end()) continue;
const BaseMeasure* measure = (*imeasure).second;
if ( measure->isSimpleData() )
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 );
}

View File

@ -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;

View File

@ -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." }

View File

@ -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)

View File

@ -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
@ -33,7 +38,8 @@
)
install ( FILES ${pySources} DESTINATION ${PYTHON_SITE_PACKAGES}/cumulus )
install ( FILES ${pyPlugins} DESTINATION ${PYTHON_SITE_PACKAGES}/cumulus/plugins )
#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 )

0
cumulus/src/plugins/ClockTreePlugin.py Executable file → Normal file
View File

View File

@ -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

View File

@ -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 )

View File

@ -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 )

View File

@ -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)

View File

@ -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)

View File

@ -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<Instance*>( 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();

View File

@ -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 ( "<BloatState " + _getString() + " >" );
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<JsonBloatProperty> 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<uint32_t>( stack, "_state" );
BloatProperty* property = NULL;
DBo* dbo = stack.back_dbo();
if (dbo) {
Cell* cell = dynamic_cast<Cell*>( dbo );
if (cell) {
property = dynamic_cast<BloatProperty*>( 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<BloatProperty*>(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.

View File

@ -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
)

View File

@ -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<Instance*>(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<Transformation> 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<int_t>(
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<RoutingPad*>() ) {

View File

@ -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

View File

@ -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:

View File

@ -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 <string>
#include <map>
#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

View File

@ -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;

View File

@ -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 )

View File

@ -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)

View File

@ -24,6 +24,14 @@
#include "hurricane/analog/AnalogCellExtension.h"
namespace Hurricane {
template<>
Name StandardPrivateProperty<Analog::AnalogCellExtensionDatas>::_name = "Analog::CellExtension";
} // Hurricane namespace.
namespace Analog {
using namespace std;
@ -43,10 +51,6 @@ namespace Analog {
string AnalogData::_getString () const
{ return "<AnalogData>"; }
template<>
Name StandardPrivateProperty<AnalogCellExtensionDatas>::_name = "Analog::CellExtension";
AnalogCellExtensionDatas::AnalogCellExtensionDatas ()

View File

@ -24,8 +24,6 @@ namespace Analog {
: Super(library,name)
, _type (type)
, _referenceCapacitor(NULL)
, _operatorIndex (0)
, _row (0)
{ }

View File

@ -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.

View File

@ -117,4 +117,13 @@ namespace Analog {
} // Analog namespace.
namespace Hurricane {
template<>
Name StandardPrivateProperty<Analog::AnalogCellExtensionDatas>::_name;
} // Hurricane namespace.
#endif // ANALOG_CELL_EXTENSION_H

View File

@ -58,8 +58,6 @@ namespace Analog {
private:
const Type _type;
MetaCapacitor* _referenceCapacitor;
int _operatorIndex;
int _row;
};
inline MetaCapacitor* CapacitorFamily::getReferenceCapacitor () { return _referenceCapacitor; }

View File

@ -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

View File

@ -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;

View File

@ -142,7 +142,7 @@ namespace Hurricane {
}
DBo::~DBo ()
DBo::~DBo () throw(Error)
{ }

View File

@ -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<RoutingPad*>(occurrence.getEntity());

View File

@ -38,6 +38,10 @@ namespace Hurricane {
{ }
Entity::~Entity() throw(Error)
{ }
void Entity::_postCreate()
{
Inherit::_postCreate();

View File

@ -38,6 +38,9 @@ Go::Go()
{
}
Go::~Go() throw(Error)
{ }
bool Go::autoMaterializationIsDisabled()
// *************************************
{

View File

@ -196,8 +196,8 @@ Hook::Hook()
{
}
Hook::~Hook()
// **********
Hook::~Hook() throw(Error)
// ***********************
{
if (_nextHook != this)
throw Error("Abnormal deletion of hook : always attached");

View File

@ -64,7 +64,8 @@ namespace Hurricane {
if ( (points[i].getX() != points[j].getX())
and (points[i].getY() != points[j].getY()) )
throw Error( "Rectilinear::create(): Can't create, non H/V edge." );
throw Error( "Rectilinear::create(): Can't create, non H/V edge (points %d:%s - %d:%s)."
, i, getString(points[i]).c_str(), j, getString(points[j]).c_str() );
}
Rectilinear* rectilinear = new Rectilinear ( net, layer, points );

View File

@ -235,7 +235,7 @@ namespace Hurricane {
{ return getTechnology()->getLayer(_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;
}

View File

@ -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.

View File

@ -163,10 +163,8 @@ namespace Hurricane {
// Forward declaration of "getSlot<>()" template.
template<typename Data> inline Hurricane::Slot* getSlot ( std::string& name, Data );
template<typename Data> inline Hurricane::Slot* getSlot ( std::string& name, Data* );
template<typename Data> inline Hurricane::Slot* getSlot ( const std::string& name, Data );
template<typename Data> inline Hurricane::Slot* getSlot ( const std::string& name, Data* );
template<typename Data> inline Hurricane::Slot* getSlot ( std::string name, Data );
template<typename Data> inline Hurricane::Slot* getSlot ( std::string name, Data* );
// -------------------------------------------------------------------
@ -344,8 +342,8 @@ inline Hurricane::Record* getRecord ( const std::pair<T,U>& p )
{
Hurricane::Record* record = NULL;
record = new Hurricane::Record ( "const std::pair<T,U>" );
record->add( getSlot<T>("first" , &p.first ) );
record->add( getSlot<U>("second", &p.second) );
record->add( getSlot<const T>(std::string("first" ), &p.first ) );
record->add( getSlot<const U>(std::string("second"), &p.second) );
return record;
}
@ -362,8 +360,8 @@ inline Hurricane::Record* getRecord ( std::pair<T,U>& p )
{
Hurricane::Record* record = NULL;
record = new Hurricane::Record ( "std::pair<T,U>" );
record->add( getSlot<T>("first" , &p.first ) );
record->add( getSlot<U>("second", &p.second) );
record->add( getSlot<T>(std::string("first" ), &p.first ) );
record->add( getSlot<U>(std::string("second"), &p.second) );
return record;
}

View File

@ -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;

View File

@ -48,6 +48,7 @@ namespace Hurricane {
Quark* _getQuark ( SharedPath* sharedPath = NULL ) const;
protected:
Entity ();
virtual ~Entity () throw(Error);
virtual void _postCreate ();
virtual void _preDestroy ();
};

View File

@ -56,6 +56,7 @@ class Go : public Entity {
// ************
protected: Go();
protected: virtual ~Go() throw(Error);
// Predicates
// **********

View File

@ -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
// *********

View File

@ -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<Data,Compare>::Node::~Node ()
RbTree<Data,Compare>::Node::~Node ()
{ }
template< typename Data, typename Compare >inline bool RbTree<Data,Compare>::Node::isRed () const { return not isBlack(); }
@ -1027,7 +1027,7 @@ namespace Hurricane {
template< typename Data, typename Compare >
inline void RbTree<Data,Compare>::write ( std::string path ) const
{ RbTreeToDot<Data,Compare,RbTree>(this).write( path ); }
{ RbTreeToDot< Data, Compare, RbTree >(this).write( path ); }
} // Hurricane namespace.

View File

@ -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.

View File

@ -322,7 +322,7 @@ namespace Hurricane {
template<typename Data>
inline Hurricane::Slot* getSlot( std::string& name, Data d )
inline Hurricane::Slot* getSlot( std::string name, Data d )
{
//std::cerr << "getSlot<string&,Data>( \"" << name << "\" )" << std::endl;
return new Hurricane::SlotTemplate<Data> ( name, d );
@ -330,28 +330,28 @@ inline Hurricane::Slot* getSlot( std::string& name, Data d )
template<typename Data>
inline Hurricane::Slot* getSlot( std::string& name, Data* d )
inline Hurricane::Slot* getSlot( std::string name, Data* d )
{
//std::cerr << "getSlot<string&,Data*>( \"" << name << "\" )" << std::endl;
return new Hurricane::SlotTemplate<Data*> ( name, d );
}
template<typename Data>
inline Hurricane::Slot* getSlot( const std::string& name, Data d )
{
//std::cerr << "getSlot<const string&,Data>( \"" << name << "\" )" << std::endl;
//std::cerr << " Data = " << typeid(d).name() << std::endl;
return new Hurricane::SlotTemplate<Data> ( name, d );
}
// template<typename Data>
// inline Hurricane::Slot* getSlot( const std::string& name, Data d )
// {
// //std::cerr << "getSlot<const string&,Data>( \"" << name << "\" )" << std::endl;
// //std::cerr << " Data = " << typeid(d).name() << std::endl;
// return new Hurricane::SlotTemplate<Data> ( name, d );
// }
template<typename Data>
inline Hurricane::Slot* getSlot( const std::string& name, Data* d )
{
//std::cerr << "getSlot<const string&,Data*>( \"" << name << "\" )" << std::endl;
//std::cerr << " Data = " << typeid(d).name() << std::endl;
return new Hurricane::SlotTemplate<Data*> ( name, d );
}
// template<typename Data>
// inline Hurricane::Slot* getSlot( const std::string& name, Data* d )
// {
// //std::cerr << "getSlot<const string&,Data*>( \"" << name << "\" )" << std::endl;
// //std::cerr << " Data = " << typeid(d).name() << std::endl;
// return new Hurricane::SlotTemplate<Data*> ( name, d );
// }
#endif // HURRICANE_SLOT_H

View File

@ -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.

View File

@ -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).

View File

@ -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.

View File

@ -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;

View File

@ -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

View File

@ -92,21 +92,21 @@ namespace Hurricane {
{
_screenCellWidget = cellWidget;
array<string,14> labels = { "fallback"
, "rubber"
, "phantom"
, "boundaries"
, "marker"
, "grid"
, "spot"
, "ghost"
, "text.ruler"
, "text.cell"
, "text.instance"
, "text.components"
, "text.references"
, "undef"
};
array<string,14> 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

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -154,7 +154,7 @@ namespace Katabatic {
, _autoContactLut ()
, _netRoutingStates ()
{
addMeasure<size_t>( cell, "Gates"
addMeasure<size_t>( "Gates"
, AllianceFramework::getInstancesCount(cell,AllianceFramework::IgnoreFeeds
|AllianceFramework::Recursive) );
}
@ -169,7 +169,7 @@ namespace Katabatic {
_gcellGrid = GCellGrid::create( this );
Session::revalidate();
addMeasure<size_t>( getCell(), "GCells", _gcellGrid->getGCellVector()->size() );
addMeasure<size_t>( "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<double>( getCell(), tag+"T", getTimer().getCombTime () );
addMeasure<size_t>( getCell(), tag+"S", (getTimer().getMemorySize() >> 20) );
addMeasure<double>( tag+"T", getTimer().getCombTime () );
addMeasure<size_t>( tag+"S", (getTimer().getMemorySize() >> 20) );
}
}

View File

@ -2037,7 +2037,7 @@ namespace Katabatic {
void KatabaticEngine::_loadGrByNet ()
{
cmess1 << " o Loading Nets global routing from Knik." << endl;
cmess1 << Dots::asDouble(" - Saturation",getMeasure<double>(getCell(),"Sat.")->getData()) << endl;
cmess1 << Dots::asDouble(" - Saturation",getMeasure<double>("Sat.")) << endl;
startMeasures();
Session::open( this );
@ -2061,8 +2061,8 @@ namespace Katabatic {
stopMeasures();
printMeasures( "load" );
addMeasure<size_t>( getCell(), "Globals", AutoSegment::getGlobalsCount() );
addMeasure<size_t>( getCell(), "Edges" , AutoSegment::getAllocateds() );
addMeasure<size_t>( "Globals", AutoSegment::getGlobalsCount() );
addMeasure<size_t>( "Edges" , AutoSegment::getAllocateds() );
}

View File

@ -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)

317
katana/src/BloatProfile.cpp Normal file
View File

@ -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 <map>
#include <list>
#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<Instance*>( 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<Instance*>( 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<FlatInstance> _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<Slice*> _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 ; islice<slicesNb ; ++islice ) {
if (not left)
throw Error( "Slices::Slices(): No GCell under slice [%d] @%s in \"%s\"."
, islice, DbU::getValueString( (DbU::Unit)islice * _sliceHeight).c_str()
, getString(_katana->getCell()->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<Instance*>(occurrence.getEntity());
Cell* masterCell = instance->getMasterCell();
if (CatalogExtension::isFeed(masterCell)) continue;
slices.add( occurrence );
}
slices.sort();
slices.tagOverloadeds();
}
} // Katana namespace.

View File

@ -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}

View File

@ -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<MaxMetalDepth ; ++i ) {
// ostringstream paramName;
// paramName << "katana.metal" << (i+1) << "MinBreak";
@ -80,6 +83,7 @@ namespace Katana {
Configuration::Configuration ( const Configuration& other )
: Anabatic::Configuration(*other.base())
, _postEventCb (other._postEventCb)
, _searchHalo (other._searchHalo)
, _hTracksReservedLocal(other._hTracksReservedLocal)
, _vTracksReservedLocal(other._vTracksReservedLocal)
, _termSatReservedLocal(other._termSatReservedLocal)
@ -152,6 +156,8 @@ namespace Katana {
if (not cmess1.enabled()) return;
cout << " o Configuration of ToolEngine<Katana> 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 ) );

View File

@ -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.

View File

@ -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()) << ")";

View File

@ -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<Segment*,DBo::CompareById>& 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<const Net*,Net::CompareByName> nets;
set<Segment* ,DBo::CompareById > segments;
//cerr << " o Global routing did not complete, overflowed edges:" << endl;
cerr << " o Global routing did not complete." << endl;
for ( size_t iEdge = 0 ; iEdge<ovEdges.size() ; ++iEdge ) {
//cerr << " " << dec << setw(4) << (iEdge+1) << "+ " << ovEdges[iEdge] << endl;
unsigned int edgeOverflow = ovEdges[iEdge]->getRealOccupancy() - 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<uint32_t>( "H-ovE", hoverflow, 12 );
addMeasure<uint32_t>( "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;
// }
// }
}

View File

@ -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()) {

View File

@ -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<TrackElement*> unrouteds;
vector<TrackElement*> 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<size_t> ( getCell(), "Segs" , routeds+unrouteds.size() );
addMeasure<unsigned long long>( getCell(), "DWL(l)" , totalWireLength , 12 );
addMeasure<unsigned long long>( getCell(), "fWL(l)" , totalWireLength-routedWireLength , 12 );
addMeasure<double> ( 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<size_t> ( "Segs" , routeds+unrouteds.size() );
addMeasure<uint64_t>( "DWL(l)" , totalWireLength , 12 );
addMeasure<uint64_t>( "fWL(l)" , totalWireLength-routedWireLength , 12 );
addMeasure<double> ( "WLER(%)", expandRatio );
}
void KatanaEngine::dumpMeasures ( ostream& out ) const
{
vector<Name> 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<Component*> removeds;
for ( Component* component : net->getComponents() ) {
if (dynamic_cast<Plug *>(component)) continue;
if (dynamic_cast<Contact*>(component)) removeds.push_back( component );
}
for ( Component* component : removeds ) component->destroy();
}
for ( Net* net : getCell()->getNets() ) {
vector<Component*> removeds;
for ( Component* component : net->getComponents() ) {
if (dynamic_cast<Plug*>(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 );

View File

@ -748,11 +748,11 @@ namespace Katana {
cmess1 << Dots::asSizet(" - # of GCells",_statistics.getGCellsCount()) << endl;
_katana->printCompletion();
addMeasure<size_t>( getCell(), "Events" , RoutingEvent::getProcesseds(), 12 );
addMeasure<size_t>( getCell(), "UEvents", RoutingEvent::getProcesseds()-RoutingEvent::getCloneds(), 12 );
_katana->addMeasure<size_t>( "Events" , RoutingEvent::getProcesseds(), 12 );
_katana->addMeasure<size_t>( "UEvents", RoutingEvent::getProcesseds()-RoutingEvent::getCloneds(), 12 );
Histogram* densityHistogram = new Histogram ( 1.0, 0.1, 2 );
addMeasure<Histogram>( getCell(), "GCells Density Histogram", densityHistogram );
_katana->addMeasure<Histogram>( "GCells Density Histogram", densityHistogram );
densityHistogram->setFileExtension( ".density.histogram" );
densityHistogram->setMainTitle ( "GCell Densities" );

Some files were not shown because too many files have changed in this diff Show More