diff --git a/crlcore/cmake_modules/CMakeLists.txt b/crlcore/cmake_modules/CMakeLists.txt
index 96455ade..d5e3deea 100644
--- a/crlcore/cmake_modules/CMakeLists.txt
+++ b/crlcore/cmake_modules/CMakeLists.txt
@@ -1,4 +1,3 @@
install ( FILES FindCORIOLIS.cmake
FindOPENACCESS.cmake
- FindLEFDEF.cmake
DESTINATION share/cmake/Modules )
diff --git a/crlcore/cmake_modules/FindLEFDEF.cmake b/crlcore/cmake_modules/FindLEFDEF.cmake
deleted file mode 100644
index a4e04f63..00000000
--- a/crlcore/cmake_modules/FindLEFDEF.cmake
+++ /dev/null
@@ -1,119 +0,0 @@
-# - Find the LEF/DEF includes and libraries.
-# The following variables are set if LEF/DEF is found. If LEF/DEF is not
-# found, LEFDEF_FOUND is set to false.
-# LEFDEF_FOUND - True when LEF/DEF is found.
-# LEFDEF_INCLUDE_DIR - the path to where the LEF/DEF include files are.
-# LEFDEF_LIBRARIES - The path to where the LEF/DEF library files are.
-#
-# The DEF C API library: LEFDEF_CDEF_LIBRARY
-# LEFDEF_CDEF_LIBRARY_RELEASE
-# LEFDEF_CDEF_LIBRARY_DEBUG
-#
-# The DEF C API library (zlib) : LEFDEF_ZCDEF_LIBRARY
-# LEFDEF_ZCDEF_LIBRARY_RELEASE
-# LEFDEF_ZCDEF_LIBRARY_DEBUG
-#
-# The DEF C++ API library: LEFDEF_DEF_LIBRARY
-# LEFDEF_DEF_LIBRARY_RELEASE
-# LEFDEF_DEF_LIBRARY_DEBUG
-#
-# The DEF C++ API library (zlib) : LEFDEF_ZDEF_LIBRARY
-# LEFDEF_ZDEF_LIBRARY_RELEASE
-# LEFDEF_ZDEF_LIBRARY_DEBUG
-#
-# The LEF C API library: LEFDEF_CLEF_LIBRARY
-# LEFDEF_CLEF_LIBRARY_RELEASE
-# LEFDEF_CLEF_LIBRARY_DEBUG
-#
-# The LEF C API library (zlib) : LEFDEF_ZCLEF_LIBRARY
-# LEFDEF_ZCLEF_LIBRARY_RELEASE
-# LEFDEF_ZCLEF_LIBRARY_DEBUG
-#
-# The LEF C++ API library: LEFDEF_LEF_LIBRARY
-# LEFDEF_LEF_LIBRARY_RELEASE
-# LEFDEF_LEF_LIBRARY_DEBUG
-#
-# The LEF C++ API library (zlib) : LEFDEF_ZLEF_LIBRARY
-# LEFDEF_ZLEF_LIBRARY_RELEASE
-# LEFDEF_ZLEF_LIBRARY_DEBUG
-
-
-macro ( _find_lefdef_lib varname libname )
- find_library ( LEFDEF_${varname}_LIBRARY_RELEASE NAMES ${libname} PATHS ${LEFDEF_LIBRARY_DIR} )
- find_library ( LEFDEF_${varname}_LIBRARY_DEBUG NAMES ${libname}_Debug PATHS ${LEFDEF_LIBRARY_DIR} )
-
- if ( LEFDEF_${varname}_LIBRARY_RELEASE AND NOT LEFDEF_${varname}_LIBRARY_DEBUG )
- set ( LEFDEF_${varname}_LIBRARY_DEBUG ${LEFDEF_${varname}_LIBRARY_RELEASE}
- CACHE STRING "Path to a library" FORCE )
- endif ( LEFDEF_${varname}_LIBRARY_RELEASE AND NOT LEFDEF_${varname}_LIBRARY_DEBUG )
-
- if ( LEFDEF_${varname}_LIBRARY_DEBUG AND NOT LEFDEF_${varname}_LIBRARY_RELEASE )
- set ( LEFDEF_${varname}_LIBRARY_RELEASE LEFDEF_${varname}_LIBRARY_DEBUG
- CACHE STRING "Path to a library" FORCE )
- endif ( LEFDEF_${varname}_LIBRARY_DEBUG AND NOT LEFDEF_${varname}_LIBRARY_RELEASE )
-
- if ( LEFDEF_${varname}_LIBRARY_RELEASE )
- list ( APPEND LEFDEF_LIBRARIES "optimized" ${LEFDEF_${varname}_LIBRARY_RELEASE}
- "debug" ${LEFDEF_${varname}_LIBRARY_DEBUG} )
- set ( LEFDEF_${varname}_LIBRARY_FOUND 1 )
- mark_as_advanced ( LEFDEF_${varname}_LIBRARY_RELEASE
- LEFDEF_${varname}_LIBRARY_DEBUG )
- else ( LEFDEF_${varname}_LIBRARY_RELEASE )
- set ( LEFDEF_FOUND "NO" )
- endif ( LEFDEF_${varname}_LIBRARY_RELEASE )
-endmacro ( _find_lefdef_lib )
-
-
-set ( LEFDEF_INCLUDE_DIR_DESCRIPTION "directory containing the LEF/DEF include files. E.g /opt/lefdef-5.6/include" )
-set ( LEFDEF_LIBRARY_DIR_DESCRIPTION "directory containing the LEF/DEF library files. E.g /opt/lefdef-5.6/lib" )
-set ( LEFDEF_DIR_MESSAGE "Set the LEFDEF_INCLUDE_DIR cmake cache entry to the ${LEFDEF_INCLUDE_DIR_DESCRIPTION}" )
-
-# Don't even bother under Win32
-if ( UNIX )
- set ( LEFDEF_FOUND "YES" )
- set ( LEFDEF_SEARCH_PATH $ENV{LEFDEF_TOP}
- "/opt/lefdef-5.6"
- "/opt/lefdef-5.7"
- "/opt/lefdef")
-
- set ( LEFDEF_LIBRARIES "" )
- set ( LEFDEF_LIBRARY_SEARCH_PATH "" )
- foreach ( element ${LEFDEF_SEARCH_PATH} )
- list ( APPEND LEFDEF_LIBRARY_SEARCH_PATH "${element}/lib" )
- endforeach ( element ${LEFDEF_SEARCH_PATH} )
-
- find_path ( LEFDEF_INCLUDE_DIR NAMES "defiDefs.h"
- PATHS ${LEFDEF_SEARCH_PATH}
- PATH_SUFFIXES "include"
- DOC "The ${LEFDEF_INCLUDE_DIR_DESCRIPTION}" )
-
- find_path ( LEFDEF_LIBRARY_DIR NAMES "libdef.a" "libdef_Debug.a"
- PATHS ${LEFDEF_LIBRARY_SEARCH_PATH}
- DOC "The ${LEFDEF_LIBRARY_DIR_DESCRIPTION}" )
-
- if ( LEFDEF_INCLUDE_DIR AND LEFDEF_LIBRARY_DIR )
- _find_lefdef_lib ( "CDEF" "cdef" )
- _find_lefdef_lib ( "ZCDEF" "cdefzlib" )
- _find_lefdef_lib ( "DEF" "def" )
- _find_lefdef_lib ( "ZDEF" "defzlib" )
- _find_lefdef_lib ( "CLEF" "clef" )
- _find_lefdef_lib ( "ZCLEF" "clefzlib" )
- _find_lefdef_lib ( "LEF" "lef" )
- _find_lefdef_lib ( "ZLEF" "lefzlib" )
- else ( LEFDEF_INCLUDE_DIR AND LEFDEF_LIBRARY_DIR )
- set ( LEFDEF_FOUND "NO" )
- endif ( LEFDEF_INCLUDE_DIR AND LEFDEF_LIBRARY_DIR )
-
- mark_as_advanced ( LEFDEF_INCLUDE_DIR LEFDEF_LIBRARY_DIR LEFDEF_LIBRARIES )
-
- if ( LEFDEF_FOUND )
- add_definitions ( -DHAVE_LEFDEF )
- if ( NOT LEFDEF_FIND_QUIETLY )
- message ( STATUS "Found LEF/DEF" )
- endif ( NOT LEFDEF_FIND_QUIETLY )
- else ( LEFDEF_FOUND )
- if ( LEFDEF_FIND_REQUIRED )
- message ( STATUS "LEF/DEF libraries and/or includes NOT found!" )
- endif ( LEFDEF_FIND_REQUIRED )
- endif ( LEFDEF_FOUND )
-endif ( UNIX )
diff --git a/crlcore/etc/environment.alliance.xml b/crlcore/etc/environment.alliance.xml
index 065d6b1a..889a5c35 100644
--- a/crlcore/etc/environment.alliance.xml
+++ b/crlcore/etc/environment.alliance.xml
@@ -8,9 +8,6 @@
${CORIOLIS_TOP}/etc/coriolis2/technology.cmos130.s2r.xml
-
- ${CORIOLIS_TOP}/etc/coriolis2/cmos.lef
-
${CORIOLIS_TOP}/etc/coriolis2/display.xml
@@ -46,5 +43,6 @@
vdd
vss
^do_not_find_ck$
+ ^obstacleNet$
diff --git a/crlcore/etc/tools.configuration.xml b/crlcore/etc/tools.configuration.xml
index fc279eb7..10e00439 100644
--- a/crlcore/etc/tools.configuration.xml
+++ b/crlcore/etc/tools.configuration.xml
@@ -70,10 +70,12 @@
+
+
@@ -127,19 +129,21 @@
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/crlcore/src/ccore/AllianceFramework.cpp b/crlcore/src/ccore/AllianceFramework.cpp
index 1735e0af..2b3c215f 100644
--- a/crlcore/src/ccore/AllianceFramework.cpp
+++ b/crlcore/src/ccore/AllianceFramework.cpp
@@ -23,6 +23,7 @@
// x-----------------------------------------------------------------x
+#include
#include "hurricane/Warning.h"
#include "hurricane/Technology.h"
#include "hurricane/DataBase.h"
@@ -78,6 +79,11 @@ namespace CRL {
string userEnvironment = Environment::getEnv ( "HOME", "" );
_environment.loadFromXml ( userEnvironment+"/.environment.alliance.xml", false );
+ char cwd[1024];
+ getcwd ( cwd, 1024 );
+ string cwdEnvironment = cwd;
+ _environment.loadFromXml ( cwdEnvironment+"/.environment.alliance.xml", false );
+
SymbolicTechnologyParser::load ( db, _environment.getSYMBOLIC_TECHNOLOGY() );
RealTechnologyParser::load ( db, _environment.getREAL_TECHNOLOGY() );
GraphicsParser::load ( _environment.getDISPLAY() );
@@ -85,9 +91,9 @@ namespace CRL {
if ( !_environment.getDisplayStyle().empty() )
Graphics::setStyle ( _environment.getDisplayStyle() );
- bool hasCatalog;
- SearchPath& LIBRARIES = _environment.getLIBRARIES ();
- Library* rootLibrary = db->getRootLibrary ();
+ unsigned int flags = InSearchPath;
+ SearchPath& LIBRARIES = _environment.getLIBRARIES ();
+ Library* rootLibrary = db->getRootLibrary ();
cmess2 << " o Creating Alliance Framework root library." << endl;
if ( !rootLibrary )
@@ -99,15 +105,13 @@ namespace CRL {
cmess2 << " o Loading libraries (working first)." << endl;
for ( unsigned i=0 ; igetLayer("METAL6");
+ if ( routingLayer == NULL ) break;
+
+ sxlibRg->addLayerGauge ( RoutingLayerGauge::create( routingLayer
+ , Constant::Horizontal
+ , Constant::Default
+ , 5 // Depth (?).
+ , 0 // Density.
+ , DbU::lambda(0) // Offset.
+ , DbU::lambda(5) // Pitch.
+ , DbU::lambda(2) // Wire width.
+ , DbU::lambda(3) // Via width.
+ ) );
+#if 0
+ routingLayer = technology->getLayer("METAL7");
+ if ( routingLayer == NULL ) break;
+
+ sxlibRg->addLayerGauge ( RoutingLayerGauge::create( routingLayer
+ , Constant::Vertical
+ , Constant::Default
+ , 7 // Depth (?).
+ , 0 // Density.
+ , DbU::lambda(0) // Offset.
+ , DbU::lambda(5) // Pitch.
+ , DbU::lambda(2) // Wire width.
+ , DbU::lambda(3) // Via width.
+ ) );
+#endif
}
addRoutingGauge ( sxlibRg );
@@ -244,34 +277,37 @@ namespace CRL {
}
- AllianceLibrary* AllianceFramework::getAllianceLibrary ( const Name &path , bool &flag )
+ AllianceLibrary* AllianceFramework::getAllianceLibrary ( unsigned index )
{
+ if ( index >= _libraries.size() )
+ return NULL;
+
+ return _libraries[index];
+ }
+
+
+ AllianceLibrary* AllianceFramework::getAllianceLibrary ( const Name &path, unsigned int& flags )
+ {
+
string spath = getString ( path );
size_t slash = spath.rfind ( '/' );
string sname = spath.substr ( (slash!=string::npos)?slash+1:0 );
- AllianceLibrary* library = new AllianceLibrary ( path, Library::create(getParentLibrary(),sname) );
- string catalog = spath + "/" + _environment.getCATALOG();
+ for ( size_t ilib=0 ; ilib<_libraries.size() ; ++ilib ) {
+ if ( _libraries[ilib]->getLibrary()->getName() == sname )
+ return _libraries[ilib];
+ }
- flag = false;
- if ( _catalog.loadFromFile(catalog,library->getLibrary()) ) flag = true;
+ return (flags&CreateLibrary) ? createLibrary ( getString(path), flags ) : NULL;
+ }
- ParserFormatSlot& parser = _parsers.getParserSlot ( spath, Catalog::State::Physical, _environment );
- if ( !parser.loadByLib() ) return library;
-
- size_t base = spath.find_last_of ( '/' );
- if ( base == spath.npos ) return library;
-
- string file = spath.substr(base+1,spath.size()-base);
-
- // Load the whole library.
- if ( ! _readLocate(file,Catalog::State::State::Logical,true) ) return library;
-
- // Call the parser function.
- (parser.getParsLib())( _environment.getLIBRARIES().getSelected() , library->getLibrary() , _catalog );
-
- return library;
+ AllianceLibrary* AllianceFramework::getAllianceLibrary ( Library* library )
+ {
+ for ( size_t ilib=0 ; ilib<_libraries.size() ; ++ilib ) {
+ if ( _libraries[ilib]->getLibrary() == library ) return _libraries[ilib];
+ }
+ return NULL;
}
@@ -336,19 +372,97 @@ namespace CRL {
}
- Cell* AllianceFramework::createCell ( const string& name )
+ AllianceLibrary* AllianceFramework::createLibrary ( const string& path, unsigned int& flags )
+ {
+ size_t slash = path.rfind ( '/' );
+ string libName = path.substr ( (slash!=string::npos)?slash+1:0 );
+
+ flags &= ~HasCatalog;
+
+ AllianceLibrary* library = getAllianceLibrary ( libName, flags );
+ if ( library != NULL ) {
+ cerr << Warning("AllianceFramework::createLibrary(): Attempt to re-create <%s>, using already existing."
+ ,libName.c_str()) << endl;
+ return library;
+ }
+
+ SearchPath& LIBRARIES = _environment.getLIBRARIES ();
+ if ( not (flags & InSearchPath) ) LIBRARIES.prepend ( path );
+ else LIBRARIES.select ( path );
+
+ library = new AllianceLibrary ( path, Library::create(getParentLibrary(),libName) );
+
+ AllianceLibraries::iterator ilib = _libraries.begin();
+ for ( size_t i=0 ; igetLibrary()) ) flags |= HasCatalog;
+
+ ParserFormatSlot& parser = _parsers.getParserSlot ( path, Catalog::State::Physical, _environment );
+
+ if ( not parser.loadByLib() ) return library;
+
+ if ( slash == path.npos ) return library;
+ string file = path.substr(slash+1,path.size()-slash);
+
+ // Load the whole library.
+ if ( ! _readLocate(file,Catalog::State::State::Logical,true) ) return library;
+
+ // Call the parser function.
+ (parser.getParsLib())( _environment.getLIBRARIES().getSelected() , library->getLibrary() , _catalog );
+
+ return library;
+ }
+
+
+ void AllianceFramework::saveLibrary ( Library* library )
+ {
+ if ( library == NULL ) return;
+
+ AllianceLibrary* alibrary = getAllianceLibrary ( library );
+ if ( alibrary == NULL ) {
+ throw Error("AllianceFramework::saveLibrary(): Cannot save non-Alliance library <%s>."
+ ,getString(library->getName()).c_str());
+ }
+
+ saveLibrary ( alibrary );
+ }
+
+
+ void AllianceFramework::saveLibrary ( AllianceLibrary* library )
+ {
+ if ( library == NULL ) return;
+
+ bfs::path libPath ( getString(library->getPath()) );
+ if ( not bfs::exists(libPath) ) {
+ bfs::create_directory(libPath);
+ }
+
+ forEach ( Cell*, icell, library->getLibrary()->getCells() ) {
+ saveCell ( *icell, Catalog::State::Views );
+ }
+ }
+
+
+ Cell* AllianceFramework::createCell ( const string& name, AllianceLibrary* library )
{
Catalog::State* state = _catalog.getState ( name );
// The cell is not in the CATAL : add an entry.
if ( state == NULL ) state = _catalog.getState ( name, true );
+ if ( library == NULL )
+ library = _libraries[0];
+
if ( !state->getCell() ) {
state->setPhysical ( true );
state->setLogical ( true );
state->setDepth ( 1 );
- state->setCell ( Cell::create ( _libraries[0]->getLibrary() , name ) );
+ state->setCell ( Cell::create ( library->getLibrary() , name ) );
state->getCell ()->put ( CatalogProperty::create(state) );
state->getCell ()->setFlattenLeaf ( false );
}
@@ -357,14 +471,15 @@ namespace CRL {
}
- void AllianceFramework::saveCell ( Cell* cell , unsigned int mode )
+ void AllianceFramework::saveCell ( Cell* cell, unsigned int mode )
{
- if ( !cell ) return;
+ if ( cell == NULL ) return;
- string name = getString(cell->getName());
- DriverSlot* driver;
- unsigned int saveMode;
- unsigned int savedViews = 0;
+ string name = getString(cell->getName());
+ DriverSlot* driver;
+ unsigned int saveMode = 0;
+ unsigned int savedViews = 0;
+ AllianceLibrary* library = getAllianceLibrary ( cell->getLibrary() );
for ( int i=0 ; i<2 ; i++ ) {
// Check is the view is requested for saving or already saved.
@@ -381,6 +496,8 @@ namespace CRL {
driver = & ( _drivers.getDriverSlot ( name, saveMode, _environment ) );
// Try to open cell file (file extention is supplied by the parser).
+ if ( library != NULL )
+ _environment.getLIBRARIES().select ( getString(library->getPath()) );
if ( !_writeLocate(name,saveMode,false) ) continue;
// Call the driver function.
@@ -473,7 +590,7 @@ namespace CRL {
// Try to open using the library driver.
name = file + "." + getString(format.getExtLib());
- LIBRARIES.locate ( name, ios::out|ios::trunc, 0, 1 );
+ LIBRARIES.locate ( name, ios::out|ios::trunc );
if ( LIBRARIES.hasSelected() ) return true;
} else {
if ( !format.getDrivCell() ) return false;
@@ -481,7 +598,7 @@ namespace CRL {
// Try to open using the cell driver.
name = file + "." + getString(format.getExtCell());
- LIBRARIES.locate ( name, ios::out|ios::trunc, 0, 1 );
+ LIBRARIES.locate ( name, ios::out|ios::trunc );
if ( LIBRARIES.hasSelected() ) return true;
}
return false;
diff --git a/crlcore/src/ccore/CMakeLists.txt b/crlcore/src/ccore/CMakeLists.txt
index d27fa65b..4b53b40a 100644
--- a/crlcore/src/ccore/CMakeLists.txt
+++ b/crlcore/src/ccore/CMakeLists.txt
@@ -16,6 +16,8 @@
${CRLCORE_SOURCE_DIR}/src/ccore/properties
${CRLCORE_SOURCE_DIR}/src/ccore/bookshelf
${CRLCORE_SOURCE_DIR}/src/ccore/acmsigda
+ ${CRLCORE_SOURCE_DIR}/src/ccore/ispd04
+ ${CRLCORE_SOURCE_DIR}/src/ccore/iccad04
${CRLCORE_SOURCE_DIR}/src/ccore/cspice
${CRLCORE_SOURCE_DIR}/src/ccore/lefdef
${CRLCORE_SOURCE_DIR}/src/ccore/alliance/ap
@@ -52,6 +54,11 @@
crlcore/AllianceLibrary.h
crlcore/ParsersDrivers.h
crlcore/LefDefExtension.h
+ crlcore/DefImport.h
+ crlcore/DefExport.h
+ crlcore/LefExport.h
+ crlcore/Iccad04Lefdef.h
+ crlcore/Ispd04Bookshelf.h
crlcore/Ioc.h
crlcore/NetExtension.h
crlcore/Measures.h
@@ -123,20 +130,28 @@
# liberty/TimingEvent.cpp
# liberty/LuTable.cpp
# )
- set ( lefdef_cpps lefdef/LefDef.h
+# set ( lefdef_cpps lefdef/LefDef.h
+# lefdef/LefDefExtension.cpp
+# lefdef/LefParser.cpp
+# lefdef/DefParser.cpp
+# lefdef/DefDriver.cpp
+# )
+ set ( lefdef_cpps lefdef/LefExport.cpp
+ lefdef/DefExport.cpp
+ lefdef/DefImport.cpp
lefdef/LefDefExtension.cpp
- lefdef/LefParser.cpp
- lefdef/DefParser.cpp
- lefdef/DefDriver.cpp
- )
+ )
+ set ( iccad04_cpps iccad04/Iccad04Lefdef.cpp )
+ set ( ispd04_cpps ispd04/Ispd04Bookshelf.cpp )
if ( LEFDEF_FOUND )
include_directories ( ${LEFDEF_INCLUDE_DIR} )
endif ( LEFDEF_FOUND )
if ( OA_FOUND )
include_directories ( ${OA_INCLUDE_DIR} )
endif ( OA_FOUND )
- set (openaccess_cpps openaccess/OpenAccessDriver.cpp
- openaccess/OpenAccessParser.cpp )
+ set (openaccess_cpps openaccess/OpenAccessParser.cpp
+ openaccess/OpenAccessDriver.cpp
+ )
set ( VstParserSourceDir ${CRLCORE_SOURCE_DIR}/src/ccore/alliance/vst )
set ( VstParserBinaryDir ${CRLCORE_BINARY_DIR}/src/ccore/alliance/vst )
@@ -269,6 +284,8 @@
${liberty_parser_cpps}
${bookshelf_cpps}
${acmsigda_parser_cpps}
+ ${iccad04_cpps}
+ ${ispd04_cpps}
${spice_cpps}
${lefdef_cpps}
${openaccess_cpps}
@@ -276,6 +293,7 @@
target_link_libraries ( crlcore ${HURRICANE_PYTHON_LIBRARIES}
${HURRICANE_GRAPHICAL_LIBRARIES}
${HURRICANE_LIBRARIES}
+ ${BOOKSHELF_LIBRARY}
${CONFIGURATION_LIBRARY}
${CIF_LIBRARY}
${AGDS_LIBRARY}
diff --git a/crlcore/src/ccore/Environment.cpp b/crlcore/src/ccore/Environment.cpp
index e950b21a..f553fbf9 100644
--- a/crlcore/src/ccore/Environment.cpp
+++ b/crlcore/src/ccore/Environment.cpp
@@ -73,7 +73,6 @@ namespace {
, TagsTechnologies
, TagsHurricane
, TagsReal
- , TagsLEF
, TagsDisplay
, TagsConfig
, TagsLibraries
@@ -96,7 +95,6 @@ namespace {
};
enum State { HurricaneTechnology = 1
, RealTechnology
- , LEFTechnology
, Display
, WorkingLibrary
, SystemLibrary
@@ -124,7 +122,6 @@ namespace {
void parseTechnologies ();
void parseHurricane ();
void parseReal ();
- void parseLEF ();
void parseDisplay ();
void parseDisplayStyle ();
void parseConfig ();
@@ -164,8 +161,6 @@ namespace {
addTagEntry ( TagsHurricane , "config" , (tagParser_t)&XmlEnvironmentParser::parseConfig );
addTagEntry ( TagsTechnologies, "real" , (tagParser_t)&XmlEnvironmentParser::parseReal );
addTagEntry ( TagsReal , "config" , (tagParser_t)&XmlEnvironmentParser::parseConfig );
- addTagEntry ( TagsTechnologies, "lef" , (tagParser_t)&XmlEnvironmentParser::parseLEF );
- addTagEntry ( TagsLEF , "config" , (tagParser_t)&XmlEnvironmentParser::parseConfig );
addTagEntry ( TagsTechnologies, "display" , (tagParser_t)&XmlEnvironmentParser::parseDisplay );
addTagEntry ( TagsDisplay , "config" , (tagParser_t)&XmlEnvironmentParser::parseConfig );
addTagEntry ( TagsDisplay , "displaystyle", (tagParser_t)&XmlEnvironmentParser::parseDisplayStyle );
@@ -323,13 +318,6 @@ namespace {
}
- void XmlEnvironmentParser::parseLEF ()
- {
- _state = LEFTechnology;
- parseTags ( TagsLEF );
- }
-
-
void XmlEnvironmentParser::parseDisplay ()
{
_state = Display;
@@ -357,7 +345,6 @@ namespace {
expandVariables ( config );
switch ( _state ) {
case HurricaneTechnology: _environment.setSYMBOLIC_TECHNOLOGY ( config.c_str() ); break;
- case LEFTechnology: _environment.setLEF_TECHNOLOGY ( config.c_str() ); break;
case RealTechnology: _environment.setREAL_TECHNOLOGY ( config.c_str() ); break;
case Display: _environment.setDISPLAY ( config.c_str() ); break;
}
@@ -528,7 +515,6 @@ namespace CRL {
, _displayStyle ()
, _SCALE_X (10)
, _SYMBOLIC_TECHNOLOGY("")
- , _LEF_TECHNOLOGY ("")
, _DISPLAY ("")
, _IN_LO ("vst")
, _IN_PH ("ap")
@@ -644,8 +630,6 @@ namespace CRL {
<< " \"" << _CORIOLIS_TOP << "\"\n"
<< " - Symbolic Technology:\n"
<< " \"" << _SYMBOLIC_TECHNOLOGY << "\"\n"
- << " - LEF Technology:\n"
- << " \"" << _LEF_TECHNOLOGY << "\"\n"
<< " - Display configuration:\n"
<< " \"" << _DISPLAY << "\"\n";
diff --git a/crlcore/src/ccore/OAParserDriver.cpp b/crlcore/src/ccore/OAParserDriver.cpp
index d38b3e69..7cfd28e9 100644
--- a/crlcore/src/ccore/OAParserDriver.cpp
+++ b/crlcore/src/ccore/OAParserDriver.cpp
@@ -11,7 +11,7 @@ namespace CRL {
OADriver::OADriver(Cell* cell) : _cell(cell) {}
void OADriver::save(const std::string& filePath) {
- CRL::OpenAccess::oaDriver(filePath, _cell);
+ //CRL::OpenAccess::oaDriver(filePath, _cell);
}
OAParser::OAParser(const std::string& cellLibPath,const std::string& cellLibName,
diff --git a/crlcore/src/ccore/ParsersDrivers.cpp b/crlcore/src/ccore/ParsersDrivers.cpp
index d364f012..d766c292 100644
--- a/crlcore/src/ccore/ParsersDrivers.cpp
+++ b/crlcore/src/ccore/ParsersDrivers.cpp
@@ -51,19 +51,18 @@
-# include "hurricane/DBo.h"
+#include "hurricane/DBo.h"
-# include "crlcore/Utilities.h"
-# include "crlcore/Environment.h"
-# include "crlcore/Catalog.h"
-# include "crlcore/ParsersDrivers.h"
-# include "Ap.h"
-# include "Vst.h"
-# include "Spice.h"
-# include "Bookshelf.h"
-# include "AcmSigda.h"
-# include "LefDef.h"
-# include "openaccess/OpenAccess.h"
+#include "crlcore/Utilities.h"
+#include "crlcore/Environment.h"
+#include "crlcore/Catalog.h"
+#include "crlcore/ParsersDrivers.h"
+#include "Ap.h"
+#include "Vst.h"
+#include "Spice.h"
+#include "Bookshelf.h"
+#include "AcmSigda.h"
+#include "openaccess/OpenAccess.h"
namespace {
@@ -214,15 +213,13 @@ namespace CRL {
ParsersMap::ParsersMap (): map()
{
// Register the Alliance default parsers.
- registerSlot ( "ap" , (CellParser_t*)apParser , "ap" );
- registerSlot ( "vst", (CellParser_t*)vstParser , "vst" );
- registerSlot ( "vst", (CellParser_t*)vstParser , "vbe" );
- registerSlot ( "spi", (CellParser_t*)spiceParser , "spi" );
- registerSlot ( "def", (CellParser_t*)defParser , "def" );
- registerSlot ( "def", (LibraryParser_t*)lefParser , "lef" );
- registerSlot ( "oa", (CellParser_t*)OpenAccess::oaCellParser , "oa" );
-// registerSlot ( "oa", (LibraryParser_t*)OpenAccess::oaLibParser , "oa" );
- registerSlot ( "aux", (CellParser_t*)bookshelfParser, "aux" );
+ registerSlot ( "ap" , (CellParser_t*)apParser , "ap" );
+ registerSlot ( "vst" , (CellParser_t*)vstParser , "vst" );
+ registerSlot ( "vst" , (CellParser_t*)vstParser , "vbe" );
+ registerSlot ( "spi" , (CellParser_t*)spiceParser , "spi" );
+ registerSlot ( "oa" , (CellParser_t*)OpenAccess::oaCellParser , "oa" );
+ //registerSlot ( "oa" , (LibraryParser_t*)OpenAccess::oaLibParser, "oa" );
+ registerSlot ( "aux" , (CellParser_t*)bookshelfParser, "aux" );
registerSlot ( "bench", (CellParser_t*)acmSigdaParser , "bench" );
}
@@ -333,10 +330,10 @@ namespace CRL {
// Register the Alliance default drivers.
registerSlot ( "ap" , (CellDriver_t*)apDriver , "ap" );
registerSlot ( "vst", (CellDriver_t*)vstDriver , "vst" );
- registerSlot ( "def", (CellDriver_t*)defDriver , "def" );
+ //registerSlot ( "def", (CellDriver_t*)defDriver , "def" );
registerSlot ( "aux", (CellDriver_t*)bookshelfDriver, "test.aux" );
registerSlot ( "spi", (CellDriver_t*)spiceDriver , "spi" );
- registerSlot ( "oa" , (CellDriver_t*)OpenAccess::oaDriver, "oa");
+ //registerSlot ( "oa" , (CellDriver_t*)OpenAccess::oaDriver, "oa");
}
diff --git a/crlcore/src/ccore/SearchPath.cpp b/crlcore/src/ccore/SearchPath.cpp
index ae2aa3d2..43f79c19 100644
--- a/crlcore/src/ccore/SearchPath.cpp
+++ b/crlcore/src/ccore/SearchPath.cpp
@@ -26,42 +26,86 @@
# include "crlcore/SearchPath.h"
+namespace {
+
+ using namespace std;
+
+
+} // End of anonymous namespace.
+
+
namespace CRL {
using namespace std;
- const size_t SearchPath::npos = (size_t)-1;
+ const size_t SearchPath::npos = (size_t)-1;
+ const string SearchPath::_selectFailed = "";
SearchPath::SearchPath ()
: _paths ()
, _index (npos)
- , _selected("")
+ , _selected(_selectFailed)
+ { }
+
+
+ bool SearchPath::_canOpen ( const string& directory, const string& file, ios::openmode mode )
{
+ _selected = directory + "/" + file;
+ fstream filestream ( _selected.c_str(), mode );
+ if ( filestream.is_open() ) {
+ filestream.close ();
+ return true;
+ }
+ _selected = _selectFailed;
+ return false;
+ }
+
+
+ void SearchPath::prepend ( const std::string& path )
+ {
+ vector::iterator ipath = _paths.begin();
+
+ _index = 0;
+ if ( ipath != _paths.end() ) { ++ipath; ++_index; }
+
+ _paths.insert ( ipath, path );
}
void SearchPath::replace ( const string& path, size_t index )
{
+ _index = index;
if ( index < _paths.size() )
_paths[index] = path;
}
- size_t SearchPath ::locate ( const string& file, ios::openmode mode, int first, int last )
+ void SearchPath::select ( const string& path )
{
- for ( int i=max(0,first) ; i < min((int)_paths.size(),last) ; i++ ) {
- string path = _paths[i] + "/" + file;
+ for ( size_t ipath=0 ; ipath < _paths.size() ; ++ipath ) {
+ if ( _paths[ipath] == path ) {
+ _selected = _paths[ipath];
+ _index = ipath;
+ return;
+ }
+ }
- fstream filestream ( path.c_str(), mode );
- if ( filestream.is_open() ) {
- filestream.close ();
- _selected = path;
+ _selected = _selectFailed;
+ _index = npos;
+ }
+
+
+ size_t SearchPath::locate ( const string& file, ios::openmode mode, int first, int last )
+ {
+ if ( hasSelected() and _canOpen(_paths[_index],file,mode) ) return _index;
+
+ for ( int i=max(0,first) ; i < min((int)_paths.size(),last) ; i++ ) {
+ if ( _canOpen(_paths[i],file,mode) ) {
return _index = i;
}
}
- _selected = "";
return _index = npos;
}
diff --git a/crlcore/src/ccore/alliance/ap/ApDriver.cpp b/crlcore/src/ccore/alliance/ap/ApDriver.cpp
index 8946c945..1e4b5f22 100644
--- a/crlcore/src/ccore/alliance/ap/ApDriver.cpp
+++ b/crlcore/src/ccore/alliance/ap/ApDriver.cpp
@@ -95,12 +95,12 @@ bool toMBKLayer ( const char*& mbkLayer
tableLayer [ "METAL5" ] = "ALU5";
tableLayer [ "METAL6" ] = "ALU6";
- tableLayer [ "OBSTACLE1" ] = "TALU1";
- tableLayer [ "OBSTACLE2" ] = "TALU2";
- tableLayer [ "OBSTACLE3" ] = "TALU3";
- tableLayer [ "OBSTACLE4" ] = "TALU4";
- tableLayer [ "OBSTACLE5" ] = "TALU5";
- tableLayer [ "OBSTACLE6" ] = "TALU6";
+ tableLayer [ "BLOCKAGE1" ] = "TALU1";
+ tableLayer [ "BLOCKAGE2" ] = "TALU2";
+ tableLayer [ "BLOCKAGE3" ] = "TALU3";
+ tableLayer [ "BLOCKAGE4" ] = "TALU4";
+ tableLayer [ "BLOCKAGE5" ] = "TALU5";
+ tableLayer [ "BLOCKAGE6" ] = "TALU6";
tableConnector [ "METAL1" ] = "CALU1";
tableConnector [ "METAL2" ] = "CALU2";
diff --git a/crlcore/src/ccore/alliance/vst/VstDriver.cpp b/crlcore/src/ccore/alliance/vst/VstDriver.cpp
index cc10e026..cdec8351 100644
--- a/crlcore/src/ccore/alliance/vst/VstDriver.cpp
+++ b/crlcore/src/ccore/alliance/vst/VstDriver.cpp
@@ -50,6 +50,48 @@ namespace {
using namespace CRL;
+ class GlobalNetLookup {
+ public:
+ inline void addLookup ( Net* );
+ inline Net* lookup ( const string& );
+ inline bool isGlobal ( Net* );
+ inline void clear ();
+ private:
+ map _globalNets;
+ };
+
+
+ inline void GlobalNetLookup::addLookup ( Net* globalNet )
+ {
+ if ( globalNet == NULL ) return;
+ _globalNets.insert ( make_pair(getString(globalNet->getName())
+ ,globalNet
+ ) );
+ }
+
+
+ inline Net* GlobalNetLookup::lookup ( const string& name )
+ {
+ map::iterator inet = _globalNets.find(name);
+ if ( inet == _globalNets.end() ) return NULL;
+ return (*inet).second;
+ }
+
+
+ inline bool GlobalNetLookup::isGlobal ( Net* globalNet )
+ {
+ if ( globalNet == NULL ) return false;
+ return (lookup(getString(globalNet->getName())) != NULL);
+ }
+
+
+ inline void GlobalNetLookup::clear ()
+ { _globalNets.clear (); }
+
+
+ GlobalNetLookup __globalNets;
+
+
void FilterPointsInStrings(string& s) {
// Problem in VST... : the . which seems to represent hierachy paths
// in ap is not supported...
@@ -297,18 +339,20 @@ void DumpSignalList(ofstream &ccell, Cell* cell)
{
StringPtVector netsString;
NetSet netSet;
- for_each_net(net, cell->getInternalNets())
+ forEach(Net*, inet, cell->getNets())
{
- string* stringName = new string(net->getName()._getString());
+ if ( not (*inet)->isExternal() ) {
+ string* stringName = new string(inet->getName()._getString());
FilterPointsInStrings(*stringName);
netsString.push_back(stringName);
- NetSet::iterator nsit = netSet.find(net);
+ NetSet::iterator nsit = netSet.find(*inet);
if (nsit != netSet.end())
- {
- throw Error("two times the same name");
- }
- netSet.insert(net);
- end_for;
+ throw Error("two times the same name");
+ netSet.insert(*inet);
+ }
+ if ( (*inet)->isGlobal() ) {
+ __globalNets.addLookup ( *inet );
+ }
}
sort(netsString.begin(), netsString.end(), StringSort());
@@ -412,7 +456,7 @@ void DumpConnectionList(ofstream &ccell, Instance*instance)
throw Error("Cannot find net named " + *string1);
}
if (string1OpenPar == string::npos)
- {
+ {
Plug* plug = spmit->second;
string connectedNetName;
if (plug->isConnected()) {
@@ -430,19 +474,21 @@ void DumpConnectionList(ofstream &ccell, Instance*instance)
Net* masterNet = plug->getMasterNet();
if (masterNet->isGlobal()) // connection by name
{
- for_each_net(globalnet, instance->getCell()->getGlobalNets())
+ Net* globalNet = __globalNets.lookup ( getString(masterNet->getName()) );
+ if ( globalNet != NULL ) connectedNetName = getString(globalNet->getName());
+#if VERY_SLOW
+ for_each_net(globalnet, instance->getCell()->getGlobalNets())
{
- if (globalnet->getName() == masterNet->getName())
+ if (globalnet->getName() == masterNet->getName())
{
- connectedNetName = string(masterNet->getName()._getString());
- break;
+ connectedNetName = string(masterNet->getName()._getString());
+ break;
}
- end_for;
- }
- if (connectedNetName == string())
- {
- throw Error("No global net " + masterNet->getName()._getString() + " in cell " + instance->getCell()->getName()._getString());
+ end_for;
}
+#endif
+ if ( connectedNetName.empty() )
+ throw Error("No global net " + masterNet->getName()._getString() + " in cell " + instance->getCell()->getName()._getString());
}
else
@@ -616,6 +662,8 @@ namespace CRL {
void vstDriver ( const string cellPath, Cell *cell, unsigned int &saveState )
{
+ __globalNets.clear ();
+
::std::ofstream ccell ( cellPath.c_str() );
ccell << "entity " << cell->getName() << " is" << endl;
DumpPortList(ccell, cell);
diff --git a/crlcore/src/ccore/crlcore/AllianceFramework.h b/crlcore/src/ccore/crlcore/AllianceFramework.h
index 7457be1e..0e1f345f 100644
--- a/crlcore/src/ccore/crlcore/AllianceFramework.h
+++ b/crlcore/src/ccore/crlcore/AllianceFramework.h
@@ -28,6 +28,7 @@
#include