diff --git a/crlcore/etc/environment.alliance.xml b/crlcore/etc/environment.alliance.xml index 3a9401a0..0717d5c3 100644 --- a/crlcore/etc/environment.alliance.xml +++ b/crlcore/etc/environment.alliance.xml @@ -6,7 +6,7 @@ ${CORIOLIS_TOP}/etc/coriolis2/technology.symbolic.xml - ${CORIOLIS_TOP}/etc/coriolis2/technology.hcmos9.s2r.xml + ${CORIOLIS_TOP}/etc/coriolis2/technology.cmos130.s2r.xml ${CORIOLIS_TOP}/etc/coriolis2/cmos.lef diff --git a/crlcore/src/ccore/AllianceFramework.cpp b/crlcore/src/ccore/AllianceFramework.cpp index 548bade6..d9bc48a4 100644 --- a/crlcore/src/ccore/AllianceFramework.cpp +++ b/crlcore/src/ccore/AllianceFramework.cpp @@ -68,7 +68,7 @@ namespace CRL { db = DataBase::create (); _environment.loadFromShell (); - _environment.loadFromXml (); + _environment.loadFromXml (); string userEnvironment = Environment::getEnv ( "HOME", "" ); _environment.loadFromXml ( userEnvironment+"/.environment.alliance.xml", false ); @@ -108,57 +108,81 @@ namespace CRL { // Temporary: create the SxLib routing gauge. Technology* technology = db->getTechnology(); - RoutingGauge* sxlibRg = RoutingGauge::create ( "sxlib" ); - sxlibRg->addLayerGauge ( RoutingLayerGauge::create( technology->getLayer("METAL1") - , Constant::Vertical - , Constant::PinOnly - , 0 // Depth (?). - , 0 // Density. - , DbU::lambda(0) // Offset. - , DbU::lambda(5) // Pitch. - , DbU::lambda(2) // Wire width. - , DbU::lambda(3) // Via width. - ) ); - sxlibRg->addLayerGauge ( RoutingLayerGauge::create( technology->getLayer("METAL2") - , Constant::Horizontal - , Constant::Default - , 1 // Depth (?). - , 7.7 // Density. - , DbU::lambda(0) // Offset. - , DbU::lambda(5) // Pitch. - , DbU::lambda(2) // Wire width. - , DbU::lambda(3) // Via width. - ) ); - sxlibRg->addLayerGauge ( RoutingLayerGauge::create( technology->getLayer("METAL3") - , Constant::Vertical - , Constant::Default - , 2 // Depth (?). - , 0 // Density. - , DbU::lambda(0) // Offset. - , DbU::lambda(5) // Pitch. - , DbU::lambda(2) // Wire width. - , DbU::lambda(3) // Via width. - ) ); - sxlibRg->addLayerGauge ( RoutingLayerGauge::create( technology->getLayer("METAL4") - , Constant::Horizontal - , Constant::Default - , 3 // Depth (?). - , 0 // Density. - , DbU::lambda(0) // Offset. - , DbU::lambda(5) // Pitch. - , DbU::lambda(2) // Wire width. - , DbU::lambda(3) // Via width. - ) ); - sxlibRg->addLayerGauge ( RoutingLayerGauge::create( technology->getLayer("METAL5") - , Constant::Vertical - , Constant::Default - , 4 // Depth (?). - , 0 // Density. - , DbU::lambda(0) // Offset. - , DbU::lambda(5) // Pitch. - , DbU::lambda(2) // Wire width. - , DbU::lambda(3) // Via width. - ) ); + RoutingGauge* sxlibRg = RoutingGauge::create ( "sxlib" ); + const Layer* routingLayer = NULL; + + switch ( 1 ) { + default: + routingLayer = technology->getLayer("METAL1"); + if ( routingLayer == NULL ) break; + + sxlibRg->addLayerGauge ( RoutingLayerGauge::create( routingLayer + , Constant::Vertical + , Constant::PinOnly + , 0 // Depth (?). + , 0 // Density. + , DbU::lambda(0) // Offset. + , DbU::lambda(5) // Pitch. + , DbU::lambda(2) // Wire width. + , DbU::lambda(3) // Via width. + ) ); + + routingLayer = technology->getLayer("METAL2"); + if ( routingLayer == NULL ) break; + + sxlibRg->addLayerGauge ( RoutingLayerGauge::create( routingLayer + , Constant::Horizontal + , Constant::Default + , 1 // Depth (?). + , 7.7 // Density. + , DbU::lambda(0) // Offset. + , DbU::lambda(5) // Pitch. + , DbU::lambda(2) // Wire width. + , DbU::lambda(3) // Via width. + ) ); + + routingLayer = technology->getLayer("METAL3"); + if ( routingLayer == NULL ) break; + + sxlibRg->addLayerGauge ( RoutingLayerGauge::create( routingLayer + , Constant::Vertical + , Constant::Default + , 2 // Depth (?). + , 0 // Density. + , DbU::lambda(0) // Offset. + , DbU::lambda(5) // Pitch. + , DbU::lambda(2) // Wire width. + , DbU::lambda(3) // Via width. + ) ); + + routingLayer = technology->getLayer("METAL4"); + if ( routingLayer == NULL ) break; + + sxlibRg->addLayerGauge ( RoutingLayerGauge::create( routingLayer + , Constant::Horizontal + , Constant::Default + , 3 // Depth (?). + , 0 // Density. + , DbU::lambda(0) // Offset. + , DbU::lambda(5) // Pitch. + , DbU::lambda(2) // Wire width. + , DbU::lambda(3) // Via width. + ) ); + + routingLayer = technology->getLayer("METAL5"); + if ( routingLayer == NULL ) break; + + sxlibRg->addLayerGauge ( RoutingLayerGauge::create( routingLayer + , Constant::Vertical + , Constant::Default + , 4 // Depth (?). + , 0 // Density. + , DbU::lambda(0) // Offset. + , DbU::lambda(5) // Pitch. + , DbU::lambda(2) // Wire width. + , DbU::lambda(3) // Via width. + ) ); + } addRoutingGauge ( sxlibRg ); CellGauge* sxlibCg = CellGauge::create ( "sxlib" diff --git a/crlcore/src/ccore/CMakeLists.txt b/crlcore/src/ccore/CMakeLists.txt index abf1297b..9163ef4a 100644 --- a/crlcore/src/ccore/CMakeLists.txt +++ b/crlcore/src/ccore/CMakeLists.txt @@ -1,4 +1,14 @@ +# Try to find a reasonable CORIOLIS_TOP value. + if( NOT("$ENV{CORIOLIS_USER_TOP}" STREQUAL "") ) + set ( CORIOLIS_USER_TOP "$ENV{CORIOLIS_USER_TOP}" ) + else( NOT("$ENV{CORIOLIS_USER_TOP}" STREQUAL "") ) + if( NOT("$ENV{CORIOLIS_TOP}" STREQUAL "") ) + set ( CORIOLIS_TOP "$ENV{CORIOLIS_TOP}" ) + endif( NOT("$ENV{CORIOLIS_TOP}" STREQUAL "") ) + endif( NOT("$ENV{CORIOLIS_USER_TOP}" STREQUAL "") ) + + include ( ${QT_USE_FILE} ) include_directories ( ${CIF_INCLUDE_DIR} @@ -18,7 +28,7 @@ ${CRLCORE_SOURCE_DIR}/src/ccore/toolbox ) - add_definitions ( -DCORIOLIS_TOP="${PROJECT_BINARY_DIR}" + add_definitions ( -DCORIOLIS_TOP="${CORIOLIS_TOP}" -DSYS_CONF_DIR="${SYS_CONF_DIR}" ) diff --git a/crlcore/src/ccore/XmlParser.cpp b/crlcore/src/ccore/XmlParser.cpp index 97e7135e..c272cc6d 100644 --- a/crlcore/src/ccore/XmlParser.cpp +++ b/crlcore/src/ccore/XmlParser.cpp @@ -32,7 +32,7 @@ namespace CRL { bool XmlParser::_load ( const string& path, bool warnNotFound ) { QFile file ( path.c_str() ); - if ( !file.open(QFile::ReadOnly|QFile::Text) ) { + if ( path.empty() or (not file.open(QFile::ReadOnly|QFile::Text)) ) { if ( warnNotFound ) { cerr << "[ERROR] Cannot open " << _getMessage(OpenFile) << " file:" << endl; cerr << " \"" << path << "\"." << endl;