diff --git a/crlcore/CMakeLists.txt b/crlcore/CMakeLists.txt
new file mode 100644
index 00000000..2e9c7d34
--- /dev/null
+++ b/crlcore/CMakeLists.txt
@@ -0,0 +1,28 @@
+PROJECT(CRLCORE)
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0)
+
+IF(COMMAND CMAKE_POLICY)
+ CMAKE_POLICY(SET CMP0003 NEW)
+ENDIF(COMMAND CMAKE_POLICY)
+
+SET(CMAKE_MODULE_PATH "${CRLCORE_SOURCE_DIR}/cmake_modules/" "$ENV{HURRICANE_TOP}/share/cmake_modules/" "$ENV{IO_TOP}/share/cmake_modules/" )
+
+
+SET(QT_USE_QTXML "true")
+#SET(QT_USE_QTOPENGL "true")
+
+FIND_PACKAGE(Boost 1.33.1 COMPONENTS program_options REQUIRED)
+FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project
+FIND_PACKAGE(BISON REQUIRED)
+FIND_PACKAGE(FLEX REQUIRED)
+FIND_PACKAGE(HURRICANE REQUIRED)
+FIND_PACKAGE(IO REQUIRED)
+FIND_PACKAGE(OPENACCESS)
+FIND_PACKAGE(LEFDEF)
+
+SET_LIB_LINK_MODE()
+
+ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(etc)
+ADD_SUBDIRECTORY(cmake_modules)
diff --git a/crlcore/cmake_modules/CMakeLists.txt b/crlcore/cmake_modules/CMakeLists.txt
new file mode 100644
index 00000000..17d7251d
--- /dev/null
+++ b/crlcore/cmake_modules/CMakeLists.txt
@@ -0,0 +1,4 @@
+install ( FILES FindCORIOLIS.cmake
+ FindOPENACCESS.cmake
+ FindLEFDEF.cmake
+ DESTINATION /share/cmake_modules )
diff --git a/crlcore/cmake_modules/FindCORIOLIS.cmake b/crlcore/cmake_modules/FindCORIOLIS.cmake
new file mode 100644
index 00000000..305286a8
--- /dev/null
+++ b/crlcore/cmake_modules/FindCORIOLIS.cmake
@@ -0,0 +1,47 @@
+# - Find the Coriolis includes and libraries.
+# The following variables are set if Coriolis is found. If CORIOLIS is not
+# found, CORIOLIS_FOUND is set to false.
+# CORIOLIS_FOUND - True when the Coriolis include directory is found.
+# CORIOLIS_INCLUDE_DIR - the path to where the Coriolis include files are.
+# CORIOLIS_LIBRARIES - The path to where the Coriolis library files are.
+
+
+SET(CORIOLIS_INCLUDE_PATH_DESCRIPTION "directory containing the Coriolis include files. E.g /usr/local/include/coriolis or /asim/coriolis/include/coriolis")
+
+SET(CORIOLIS_DIR_MESSAGE "Set the CORIOLIS_INCLUDE_DIR cmake cache entry to the ${CORIOLIS_INCLUDE_PATH_DESCRIPTION}")
+
+# don't even bother under WIN32
+IF(UNIX)
+
+ SET(CORIOLIS_DIR_SEARCH $ENV{CORIOLIS_TOP} $ENV{HURRICANE_TOP})
+ #
+ # Look for an installation.
+ #
+ FIND_PATH(CRLCORE_INCLUDE_PATH NAMES crlcore/ToolEngine.h PATHS
+ # Look in other places.
+ ${CORIOLIS_DIR_SEARCH}
+ PATH_SUFFIXES include/coriolis
+ # Help the user find it if we cannot.
+ DOC "The ${CORIOLIS_INCLUDE_PATH_DESCRIPTION}"
+ )
+
+ FIND_LIBRARY(CRLCORE_LIBRARY_PATH
+ NAMES crlcore
+ PATHS ${CORIOLIS_DIR_SEARCH}
+ PATH_SUFFIXES lib
+ # Help the user find it if we cannot.
+ DOC "The ${CORIOLIS_INCLUDE_PATH_DESCRIPTION}"
+ )
+
+ FIND_LIBRARY(CRLCORE_STATIC_LIBRARY_PATH
+ NAMES crlcore-static
+ PATHS ${CORIOLIS_DIR_SEARCH}
+ PATH_SUFFIXES lib
+ # Help the user find it if we cannot.
+ DOC "The ${CORIOLIS_INCLUDE_PATH_DESCRIPTION}"
+ )
+
+ SET_LIBRARIES_PATH(CORIOLIS CRLCORE)
+ HURRICANE_CHECK_LIBRARIES(CORIOLIS)
+
+ENDIF(UNIX)
diff --git a/crlcore/cmake_modules/FindLEFDEF.cmake b/crlcore/cmake_modules/FindLEFDEF.cmake
new file mode 100644
index 00000000..a4e04f63
--- /dev/null
+++ b/crlcore/cmake_modules/FindLEFDEF.cmake
@@ -0,0 +1,119 @@
+# - 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/cmake_modules/FindOPENACCESS.cmake b/crlcore/cmake_modules/FindOPENACCESS.cmake
new file mode 100644
index 00000000..f0413732
--- /dev/null
+++ b/crlcore/cmake_modules/FindOPENACCESS.cmake
@@ -0,0 +1,188 @@
+# - Find the OpenAccess includes and libraries.
+# The following variables are set if OpenAccess is found. If OpenAccess is not
+# found, OA_FOUND is set to false.
+# OA_FOUND - True when OpenAccess is found.
+# OA_INCLUDE_DIR - the path to where the OpenAccess include files are.
+# OA_LIBRARIES - The path to where the OpenAccess library files are.
+#
+# The OpenAccess oaCommon library: OA_COMMON_LIBRARY
+# OA_COMMON_LIBRARY_RELEASE
+# OA_COMMON_DEBUG
+#
+# The OpenAccess oaBase library: OA_BASE_LIBRARY
+# OA_BASE_LIBRARY_RELEASE
+# OA_BASE_DEBUG
+#
+# The OpenAccess oaDM library: OA_DM_LIBRARY
+# OA_DM_LIBRARY_RELEASE
+# OA_DM_DEBUG
+#
+# The OpenAccess oaTech library: OA_TECH_LIBRARY
+# OA_TECH_LIBRARY_RELEASE
+# OA_TECH_DEBUG
+#
+# The OpenAccess oaDesign library: OA_DESIGN_LIBRARY
+# OA_DESIGN_LIBRARY_RELEASE
+# OA_DESIGN_DEBUG
+#
+# The OpenAccess oaWafer library: OA_WAFER_LIBRARY
+# OA_WAFER_LIBRARY_RELEASE
+# OA_WAFER_DEBUG
+#
+# The OpenAccess oaPlugin library: OA_PLUGIN_LIBRARY
+# OA_PLUGIN_LIBRARY_RELEASE
+# OA_PLUGIN_DEBUG
+
+
+SET(OA_INCLUDE_PATH_DESCRIPTION "directory containing the OpenAccess include files. E.g /usr/local/include")
+
+SET(OA_DIR_MESSAGE "Set the OA_INCLUDE_DIR cmake cache entry to the ${OA_INCLUDE_PATH_DESCRIPTION}")
+
+# don't even bother under WIN32
+IF(UNIX)
+
+ SET(OA_DIR_SEARCH $ENV{OPENACCESS_TOP})
+ IF(OA_DIR_SEARCH)
+ FILE(TO_CMAKE_PATH ${OA_DIR_SEARCH} OA_DIR_SEARCH)
+ ENDIF(OA_DIR_SEARCH)
+
+ #
+ # Look for an installation.
+ #
+ FIND_PATH(OA_INCLUDE_PATH NAMES oa/oaDesign.h PATHS
+ # Look in other places.
+ ${OA_DIR_SEARCH}
+ PATH_SUFFIXES include
+ # Help the user find it if we cannot.
+ DOC "The ${OA_INCLUDE_PATH_DESCRIPTION}"
+ )
+
+
+ FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
+ IF(CMAKE_UNAME)
+ EXEC_PROGRAM(uname ARGS -a OUTPUT_VARIABLE SYSTEM_TYPE)
+ ELSE(CMAKE_UNAME)
+ MESSAGE(FATAL_ERROR, "uname command was not found")
+ ENDIF(CMAKE_UNAME)
+
+ IF($SYSTEM_TYPE MATCHES ".*x86_64.*")
+ SET(OA_LIBRARY_DIR ${OA_DIR_SEARCH}/lib/linux_rhel30_64/dbg)
+ ELSEIF($SYSTEM_TYPE MATCHES ".*i686.*")
+ SET(OA_LIBRARY_DIR ${OA_DIR_SEARCH}/lib/linux_rhel21_32/dbg)
+ ELSE($SYSTEM_TYPE MATCHES ".*x86_64.*")
+ SET(OA_LIBRARY_DIR "unknown")
+ ENDIF($SYSTEM_TYPE MATCHES ".*x86_64.*")
+
+ # Set OA_OACOMMON_LIBRARY
+ FIND_LIBRARY(OA_OACOMMON_LIBRARY_RELEASE NAMES oaCommon PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH )
+ FIND_LIBRARY(OA_OACOMMON_LIBRARY_DEBUG NAMES oaCommonD PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set OA_OABASE_LIBRARY
+ FIND_LIBRARY(OA_OABASE_LIBRARY_RELEASE NAMES oaBase PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH )
+ FIND_LIBRARY(OA_OABASE_LIBRARY_DEBUG NAMES oaBaseD PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set OA_OADM_LIBRARY
+ FIND_LIBRARY(OA_OADM_LIBRARY_RELEASE NAMES oaDM PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH )
+ FIND_LIBRARY(OA_OADM_LIBRARY_DEBUG NAMES oaDMD PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set OA_OATECH_LIBRARY
+ FIND_LIBRARY(OA_OATECH_LIBRARY_RELEASE NAMES oaTech PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH )
+ FIND_LIBRARY(OA_OATECH_LIBRARY_DEBUG NAMES oaTechD PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set OA_OADESIGN_LIBRARY
+ FIND_LIBRARY(OA_OADESIGN_LIBRARY_RELEASE NAMES oaDesign PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH )
+ FIND_LIBRARY(OA_OADESIGN_LIBRARY_DEBUG NAMES oaDesignD PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set OA_OAWAFER_LIBRARY
+ FIND_LIBRARY(OA_OAWAFER_LIBRARY_RELEASE NAMES oaWafer PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH )
+ FIND_LIBRARY(OA_OAWAFER_LIBRARY_DEBUG NAMES oaWaferD PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set OA_OAPLUGIN_LIBRARY
+ FIND_LIBRARY(OA_OAPLUGIN_LIBRARY_RELEASE NAMES oaPlugIn PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH )
+ FIND_LIBRARY(OA_OAPLUGIN_LIBRARY_DEBUG NAMES oaPlugInD PATHS ${OA_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ ############################################
+ #
+ # Check the existence of the libraries.
+ #
+ ############################################
+
+ MACRO (_OA_ADJUST_LIB_VARS basename)
+ # if only the release version was found, set the debug variable also to the release version
+ IF (OA_${basename}_LIBRARY_RELEASE AND NOT OA_${basename}_LIBRARY_DEBUG)
+ SET(OA_${basename}_LIBRARY_DEBUG ${OA_${basename}_LIBRARY_RELEASE})
+ SET(OA_${basename}_LIBRARY ${OA_${basename}_LIBRARY_RELEASE})
+ SET(OA_${basename}_LIBRARIES ${OA_${basename}_LIBRARY_RELEASE})
+ ENDIF (OA_${basename}_LIBRARY_RELEASE AND NOT OA_${basename}_LIBRARY_DEBUG)
+
+ # if only the debug version was found, set the release variable also to the debug version
+ IF (OA_${basename}_LIBRARY_DEBUG AND NOT OA_${basename}_LIBRARY_RELEASE)
+ SET(OA_${basename}_LIBRARY_RELEASE ${OA_${basename}_LIBRARY_DEBUG})
+ SET(OA_${basename}_LIBRARY ${OA_${basename}_LIBRARY_DEBUG})
+ SET(OA_${basename}_LIBRARIES ${OA_${basename}_LIBRARY_DEBUG})
+ ENDIF (OA_${basename}_LIBRARY_DEBUG AND NOT OA_${basename}_LIBRARY_RELEASE)
+ IF (OA_${basename}_LIBRARY_DEBUG AND OA_${basename}_LIBRARY_RELEASE)
+ # if the generator supports configuration types then set
+ # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(OA_${basename}_LIBRARY optimized ${OA_${basename}_LIBRARY_RELEASE} debug ${OA_${basename}_LIBRARY_DEBUG})
+ ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ # if there are no configuration types and CMAKE_BUILD_TYPE has no value
+ # then just use the release libraries
+ SET(OA_${basename}_LIBRARY ${OA_${basename}_LIBRARY_RELEASE} )
+ ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(OA_${basename}_LIBRARIES optimized ${OA_${basename}_LIBRARY_RELEASE} debug ${OA_${basename}_LIBRARY_DEBUG})
+ ENDIF (OA_${basename}_LIBRARY_DEBUG AND OA_${basename}_LIBRARY_RELEASE)
+
+ SET(OA_${basename}_LIBRARY ${OA_${basename}_LIBRARY} CACHE FILEPATH "The OpenAccess ${basename} library")
+
+ IF (OA_${basename}_LIBRARY)
+ SET(OA_${basename}_FOUND 1)
+ ENDIF (OA_${basename}_LIBRARY)
+
+ # Make variables changeble to the advanced user
+ MARK_AS_ADVANCED(OA_${basename}_LIBRARY OA_${basename}_LIBRARY_RELEASE OA_${basename}_LIBRARY_DEBUG OA_${basename}_INCLUDE_DIR)
+ ENDMACRO (_OA_ADJUST_LIB_VARS)
+
+ _OA_ADJUST_LIB_VARS(OACOMMON)
+ _OA_ADJUST_LIB_VARS(OABASE)
+ _OA_ADJUST_LIB_VARS(OADM)
+ _OA_ADJUST_LIB_VARS(OATECH)
+ _OA_ADJUST_LIB_VARS(OADESIGN)
+ _OA_ADJUST_LIB_VARS(OAWAFER)
+ _OA_ADJUST_LIB_VARS(OAPLUGIN)
+
+
+ IF (OA_INCLUDE_PATH AND OA_OACOMMON_LIBRARY AND OA_OABASE_LIBRARY
+ AND OA_OADM_LIBRARY AND OA_OATECH_LIBRARY AND OA_OADESIGN_LIBRARY
+ AND OA_OAWAFER_LIBRARY AND OA_OAPLUGIN_LIBRARY)
+ SET(OA_FOUND "YES")
+ IF (NOT OA_FIND_QUIETLY)
+ MESSAGE(STATUS "Found OpenAccess")
+ ENDIF( NOT OA_FIND_QUIETLY)
+ SET(OA_INCLUDE_DIR
+ ${OA_INCLUDE_PATH}
+ )
+ SET(OA_LIBRARIES
+ ${OA_OACOMMON_LIBRARY}
+ ${OA_OABASE_LIBRARY}
+ ${OA_OADM_LIBRARY}
+ ${OA_OATECH_LIBRARY}
+ ${OA_OADESIGN_LIBRARY}
+ ${OA_OAWAFER_LIBRARY}
+ ${OA_OAPLUGIN_LIBRARY}
+ )
+ ELSE (OA_INCLUDE_PATH AND OA_LIBRARY_PATH)
+ SET(OA_FOUND "NO")
+ IF(OA_FIND_REQUIRED)
+ MESSAGE( FATAL_ERROR "OpenAccess libraries, includes NOT found!")
+ ENDIF( OA_FIND_REQUIRED)
+ ENDIF (OA_INCLUDE_PATH AND OA_OACOMMON_LIBRARY AND OA_OABASE_LIBRARY
+ AND OA_OADM_LIBRARY AND OA_OATECH_LIBRARY AND OA_OADESIGN_LIBRARY
+ AND OA_OAWAFER_LIBRARY AND OA_OAPLUGIN_LIBRARY)
+
+ IF(OA_FOUND)
+ ADD_DEFINITIONS(-DHAVE_OPENACCESS)
+ ENDIF(OA_FOUND)
+
+ENDIF(UNIX)
diff --git a/crlcore/etc/CMakeLists.txt b/crlcore/etc/CMakeLists.txt
new file mode 100644
index 00000000..721d286b
--- /dev/null
+++ b/crlcore/etc/CMakeLists.txt
@@ -0,0 +1,6 @@
+ install ( FILES environment.alliance.xml DESTINATION /share/etc )
+ install ( FILES technology.symbolic.xml DESTINATION /share/etc )
+ install ( FILES technology.hcmos9.s2r.xml DESTINATION /share/etc )
+ install ( FILES technology.cmos065.s2r.xml DESTINATION /share/etc )
+ install ( FILES technology.fake.s2r.xml DESTINATION /share/etc )
+ install ( FILES display.xml DESTINATION /share/etc )
diff --git a/crlcore/etc/display.xml b/crlcore/etc/display.xml
new file mode 100644
index 00000000..0bbef9a0
--- /dev/null
+++ b/crlcore/etc/display.xml
@@ -0,0 +1,250 @@
+
+
+
+
+ true
+ Alliance Coriolis Look - black background
+ 3.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Alliance.Coriolis [black]
+ Alliance Coriolis Look - white background
+ 0.8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Alliance Standard Look - black background
+ 3.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Alliance.Classic [black]
+ Alliance Standard Look - white background
+ 3.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Alliance.Coriolis [black]
+ Ispd Global Route Look - black background
+ 3.0
+
+
+
+
+
+
+
+
+
+
+
+ Alliance.Coriolis [black]
+ Useful for debugging layout - black background
+ 3.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Layout Design
+ Useful for debugging layout - white background
+ 3.0
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crlcore/etc/environment.alliance.xml b/crlcore/etc/environment.alliance.xml
new file mode 100644
index 00000000..bcc062f7
--- /dev/null
+++ b/crlcore/etc/environment.alliance.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ ${CORIOLIS_TOP}/share/etc/technology.symbolic.xml
+
+
+ ${CORIOLIS_TOP}/share/etc/technology.hcmos9.s2r.xml
+
+
+ ${CORIOLIS_TOP}/share/etc/cmos.lef
+
+
+ ${CORIOLIS_TOP}/share/etc/display.xml
+
+
+
+ CATAL
+
+ .
+
+
+ ${CELL_TOP}/cells/sxlib
+ ${CELL_TOP}/cells/dp_sxlib
+ ${CELL_TOP}/cells/ramlib
+ ${CELL_TOP}/cells/romlib
+ ${CELL_TOP}/cells/rflib
+ ${CELL_TOP}/cells/rf2lib
+ ${CELL_TOP}/cells/pxlib
+ ${CORIOLIS_TOP}/share/cells/stratus2sxlib
+
+
+
+ 100
+
+ vst
+ ap
+
+
+
+
+ vdd
+ vss
+ ^ck$
+
+
diff --git a/crlcore/etc/technology.cmos065.s2r.xml b/crlcore/etc/technology.cmos065.s2r.xml
new file mode 100644
index 00000000..553df8e1
--- /dev/null
+++ b/crlcore/etc/technology.cmos065.s2r.xml
@@ -0,0 +1,29 @@
+
+
+
+ cmos065
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crlcore/etc/technology.fake.s2r.xml b/crlcore/etc/technology.fake.s2r.xml
new file mode 100644
index 00000000..e3d2308d
--- /dev/null
+++ b/crlcore/etc/technology.fake.s2r.xml
@@ -0,0 +1,29 @@
+
+
+
+ fake
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crlcore/etc/technology.hcmos9.s2r.xml b/crlcore/etc/technology.hcmos9.s2r.xml
new file mode 100644
index 00000000..0a38882e
--- /dev/null
+++ b/crlcore/etc/technology.hcmos9.s2r.xml
@@ -0,0 +1,29 @@
+
+
+
+ hcmos9
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crlcore/etc/technology.symbolic.xml b/crlcore/etc/technology.symbolic.xml
new file mode 100644
index 00000000..92c0bd70
--- /dev/null
+++ b/crlcore/etc/technology.symbolic.xml
@@ -0,0 +1,328 @@
+
+
+ Alliance
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2
+ 1.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crlcore/src/CMakeLists.txt b/crlcore/src/CMakeLists.txt
new file mode 100644
index 00000000..af026ef9
--- /dev/null
+++ b/crlcore/src/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_subdirectory(fonts)
+add_subdirectory(ccore)
+add_subdirectory(cyclop)
+add_subdirectory(x2y)
diff --git a/crlcore/src/ccore/AllianceFramework.cpp b/crlcore/src/ccore/AllianceFramework.cpp
new file mode 100644
index 00000000..b3bca90a
--- /dev/null
+++ b/crlcore/src/ccore/AllianceFramework.cpp
@@ -0,0 +1,498 @@
+
+// -*- C++ -*-
+
+#include "hurricane/Warning.h"
+#include "hurricane/Technology.h"
+#include "hurricane/DataBase.h"
+#include "hurricane/Library.h"
+#include "hurricane/viewer/Graphics.h"
+
+#include "crlcore/Utilities.h"
+#include "crlcore/GraphicsParser.h"
+#include "crlcore/SymbolicTechnologyParser.h"
+#include "crlcore/RealTechnologyParser.h"
+#include "crlcore/CellGauge.h"
+#include "crlcore/RoutingGauge.h"
+#include "crlcore/RoutingLayerGauge.h"
+#include "crlcore/AllianceFramework.h"
+
+
+namespace CRL {
+
+
+ using Hurricane::Warning;
+ using Hurricane::tab;
+ using Hurricane::Graphics;
+
+
+ AllianceFramework* AllianceFramework::_singleton = NULL;
+ const Name AllianceFramework::_parentLibraryName = "AllianceFramework";
+
+
+ AllianceFramework::AllianceFramework ()
+ : _environment()
+ , _parsers()
+ , _drivers()
+ , _catalog()
+ , _parentLibrary(NULL)
+ , _routingGauges()
+ {
+ DataBase* db = DataBase::getDB ();
+ if ( !db )
+ db = DataBase::create ();
+
+ _environment.loadFromShell ();
+ _environment.loadFromXml ();
+
+ string userEnvironment = Environment::getEnv ( "HOME", "" );
+ _environment.loadFromXml ( userEnvironment+"/.environment.alliance.xml", false );
+
+ SymbolicTechnologyParser::load ( db, _environment.getSYMBOLIC_TECHNOLOGY() );
+ RealTechnologyParser::load ( db, _environment.getREAL_TECHNOLOGY() );
+ GraphicsParser::load ( _environment.getDISPLAY() );
+
+ if ( !_environment.getDisplayStyle().empty() )
+ Graphics::setStyle ( _environment.getDisplayStyle() );
+
+ bool hasCatalog;
+ SearchPath& LIBRARIES = _environment.getLIBRARIES ();
+ Library* rootLibrary = db->getRootLibrary ();
+
+ cmess2 << " o Creating Alliance Framework root library." << endl;
+ if ( !rootLibrary )
+ rootLibrary = Library::create ( db, "RootLibrary" );
+
+ _parentLibrary = rootLibrary->getLibrary ( _parentLibraryName );
+ if ( !_parentLibrary )
+ _parentLibrary = Library::create ( rootLibrary, _parentLibraryName );
+
+ cmess2 << " o Loading libraries (working first)." << endl;
+ for ( unsigned i=0 ; igetTechnology();
+
+ 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.
+ ) );
+ addRoutingGauge ( sxlibRg );
+
+ CellGauge* sxlibCg = CellGauge::create ( "sxlib"
+ , "metal2" // pinLayerName.
+ , DbU::lambda( 5.0) // pitch.
+ , DbU::lambda(50.0) // sliceHeight.
+ , DbU::lambda( 5.0) // sliceStep.
+ );
+ addCellGauge ( sxlibCg );
+ }
+
+
+ AllianceFramework::~AllianceFramework ()
+ {
+ for ( size_t i=0 ; i<_libraries.size() ; i++ )
+ delete _libraries[i];
+
+ while ( !_routingGauges.empty() ) {
+ _routingGauges.begin()->second->destroy();
+ _routingGauges.erase ( _routingGauges.begin() );
+ }
+
+ while ( !_cellGauges.empty() ) {
+ _cellGauges.begin()->second->destroy();
+ _cellGauges.erase ( _cellGauges.begin() );
+ }
+ }
+
+
+ AllianceFramework* AllianceFramework::create ()
+ {
+ if ( !_singleton )
+ _singleton = new AllianceFramework ();
+
+ return _singleton;
+ }
+
+
+ AllianceFramework* AllianceFramework::get ()
+ {
+ return create ();
+ }
+
+
+ void AllianceFramework::destroy ()
+ {
+ delete this;
+ }
+
+
+ string AllianceFramework::getPrint () const
+ {
+ return _environment.getPrint ();
+ }
+
+
+ AllianceLibrary* AllianceFramework::getAllianceLibrary ( const Name &path , bool &flag )
+ {
+ 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();
+
+ flag = false;
+ if ( _catalog.loadFromFile(catalog,library->getLibrary()) ) flag = true;
+
+ 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;
+ }
+
+
+ Cell* AllianceFramework::getCell ( const string& name, unsigned int mode, unsigned int depth )
+ {
+ bool createCell = false;
+ Catalog::State* state = _catalog.getState ( name );
+ ParserFormatSlot* parser;
+
+ // The cell is not even in the Catalog : add an entry.
+ if ( state == NULL ) state = _catalog.getState ( name, true );
+
+ if ( state->isFlattenLeaf() ) depth = 0;
+ state->setDepth ( depth );
+
+ // Do not try to load.
+ if ( mode & Catalog::State::InMemory ) return state->getCell();
+
+ unsigned int loadMode;
+ for ( int i=0 ; i<2 ; i++ ) {
+ // Check is the view is requested for loading or already loaded.
+ switch ( i ) {
+ case 0: loadMode = mode & Catalog::State::Logical; break;
+ case 1: loadMode = mode & Catalog::State::Physical; break;
+ }
+ if ( loadMode == 0 ) continue;
+ if ( state->getFlags(loadMode) != 0 ) continue;
+
+ // Transmit all flags except thoses related to views.
+ loadMode |= (mode & (!Catalog::State::Views));
+
+ parser = & ( _parsers.getParserSlot ( name, loadMode, _environment ) );
+
+ // Try to open cell file (file extention is supplied by the parser).
+ if ( !_readLocate(name,loadMode) ) continue;
+
+ if ( state->getCell() == NULL ) {
+ state->setCell ( Cell::create ( _libraries[ _environment.getLIBRARIES().getIndex() ]->getLibrary() , name ) );
+ state->getCell ()->put ( CatalogProperty::create(state) );
+ state->getCell ()->setFlattenLeaf ( false );
+ createCell = true;
+ }
+
+ try {
+ // Call the parser function.
+ (parser->getParsCell())( _environment.getLIBRARIES().getSelected() , state->getCell() );
+ } catch ( ... ) {
+ if ( createCell )
+ state->getCell()->destroy();
+ throw;
+ }
+ }
+
+ // At least one view must have been loaded.
+ if ( state->getFlags(Catalog::State::Views) != 0 ) return state->getCell();
+
+ // Delete the empty cell.
+ if ( state->getCell() ) state->getCell()->destroy ();
+ _catalog.deleteState ( name );
+
+ return NULL;
+ }
+
+
+ Cell* AllianceFramework::createCell ( const string& name )
+ {
+ 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 ( !state->getCell() ) {
+ state->setPhysical ( true );
+ state->setLogical ( true );
+ state->setDepth ( 1 );
+
+ state->setCell ( Cell::create ( _libraries[0]->getLibrary() , name ) );
+ state->getCell ()->put ( CatalogProperty::create(state) );
+ state->getCell ()->setFlattenLeaf ( false );
+ }
+
+ return state->getCell ();
+ }
+
+
+ void AllianceFramework::saveCell ( Cell* cell , unsigned int mode )
+ {
+ if ( !cell ) return;
+
+ string name = getString(cell->getName());
+ DriverSlot* driver;
+ unsigned int saveMode;
+ unsigned int savedViews = 0;
+
+ for ( int i=0 ; i<2 ; i++ ) {
+ // Check is the view is requested for saving or already saved.
+ switch ( i ) {
+ case 0: saveMode = mode & Catalog::State::Logical; break;
+ case 1: saveMode = mode & Catalog::State::Physical; break;
+ }
+ if ( saveMode == 0 ) continue;
+ if ( ( savedViews & saveMode ) != 0 ) continue;
+
+ // Transmit all flags except thoses related to views.
+ saveMode |= (mode & (!Catalog::State::Views));
+
+ driver = & ( _drivers.getDriverSlot ( name, saveMode, _environment ) );
+
+ // Try to open cell file (file extention is supplied by the parser).
+ if ( !_writeLocate(name,saveMode,false) ) continue;
+
+ // Call the driver function.
+ (driver->getDrivCell())( _environment.getLIBRARIES().getSelected(), cell, savedViews );
+ }
+ }
+
+
+ Library* AllianceFramework::getLibrary ( unsigned index )
+ {
+ if ( index >= _libraries.size() )
+ return NULL;
+
+ return _libraries[ index ]->getLibrary();
+ }
+
+
+ unsigned int AllianceFramework::loadLibraryCells ( Library *library )
+ {
+ cmess2 << " " << tab++ << "+ Library: " << getString(library->getName()) << endl;
+
+ map* states = _catalog.getStates ();
+ map::iterator istate = states->begin ();
+
+ unsigned int count = 0;
+ for ( ; istate != states->end() ; istate++ ) {
+ if ( istate->second->getLibrary() == library ) {
+ getCell ( getString(istate->first), Catalog::State::Views );
+ count++;
+ }
+ }
+ tab--;
+
+ return count;
+ }
+
+
+ unsigned int AllianceFramework::loadLibraryCells ( const Name& name )
+ {
+ for ( size_t i=0 ; i<_libraries.size() ; i++ ) {
+ string spath = getString ( _libraries[i]->getPath() );
+ size_t slash = spath.rfind ('/');
+ Name libraryName = spath.substr ( (slash!=string::npos)?slash+1:0 );
+ if ( libraryName == name )
+ return loadLibraryCells ( _libraries[i]->getLibrary() );
+ }
+
+ return 0;
+ }
+
+
+ bool AllianceFramework::_readLocate ( const string& file, unsigned int mode, bool isLib )
+ {
+ string name;
+
+ SearchPath& LIBRARIES = _environment.getLIBRARIES ();
+ ParserFormatSlot& format = _parsers.getParserSlot ( file, mode, _environment );
+
+ if ( isLib ) {
+ // Try to open using the library parsers.
+ for ( format.lbegin() ; !format.lend() ; format++ ) {
+ name = file + "." + getString(format.getExt());
+
+ LIBRARIES.locate ( name );
+ if ( LIBRARIES.hasSelected() ) return true;
+ }
+ } else {
+ // Try to open using the cell parsers.
+ for ( format.cbegin() ; !format.cend() ; format++ ) {
+ name = file + "." + getString(format.getExt());
+
+ LIBRARIES.locate ( name );
+ if ( LIBRARIES.hasSelected() ) return true;
+ }
+ }
+
+ return false;
+ }
+
+
+ bool AllianceFramework::_writeLocate ( const string& file, unsigned int mode, bool isLib )
+ {
+ SearchPath& LIBRARIES = _environment.getLIBRARIES ();
+ DriverSlot& format = _drivers.getDriverSlot ( file, mode, _environment );
+ string name;
+
+ if ( isLib ) {
+ if ( !format.getDrivLib() ) return false;
+
+ // Try to open using the library driver.
+ name = file + "." + getString(format.getExtLib());
+
+ LIBRARIES.locate ( name, ios::out|ios::trunc, 0, 1 );
+ if ( LIBRARIES.hasSelected() ) return true;
+ } else {
+ if ( !format.getDrivCell() ) return false;
+
+ // Try to open using the cell driver.
+ name = file + "." + getString(format.getExtCell());
+
+ LIBRARIES.locate ( name, ios::out|ios::trunc, 0, 1 );
+ if ( LIBRARIES.hasSelected() ) return true;
+ }
+ return false;
+ }
+
+
+ RoutingGauge* AllianceFramework::getRoutingGauge ( const Name& name )
+ {
+ if ( name.isEmpty() ) return _defaultRoutingGauge;
+
+ map::iterator igauge = _routingGauges.find ( name );
+ if ( igauge != _routingGauges.end() )
+ return igauge->second;
+
+ return NULL;
+ }
+
+
+ void AllianceFramework::addRoutingGauge ( RoutingGauge* gauge )
+ {
+ if ( !gauge ) {
+ cerr << Warning("AllianceFramework::addRoutingGauge(): NULL gauge argument.") << endl;
+ return;
+ }
+
+ if ( getRoutingGauge(gauge->getName()) ) {
+ cerr << Warning("AllianceFramework::addRoutingGauge(): gauge %s already exists."
+ ,getString(gauge->getName()).c_str())
+ << endl;
+ return;
+ }
+
+ _routingGauges [ gauge->getName() ] = gauge;
+ _defaultRoutingGauge = gauge;
+ }
+
+
+ CellGauge* AllianceFramework::getCellGauge ( const Name& name )
+ {
+ if ( name.isEmpty() ) return _defaultCellGauge;
+
+ map::iterator igauge = _cellGauges.find ( name );
+ if ( igauge != _cellGauges.end() )
+ return igauge->second;
+
+ return NULL;
+ }
+
+
+ void AllianceFramework::addCellGauge ( CellGauge* gauge )
+ {
+ if ( !gauge ) {
+ cerr << Warning("AllianceFramework::addCellGauge(): NULL gauge argument.") << endl;
+ return;
+ }
+
+ if ( getCellGauge(gauge->getName()) ) {
+ cerr << Warning("AllianceFramework::addCellGauge(): gauge %s already exists."
+ ,getString(gauge->getName()).c_str())
+ << endl;
+ return;
+ }
+
+ _cellGauges [ gauge->getName() ] = gauge;
+ _defaultCellGauge = gauge;
+ }
+
+
+} // End of CRL namespace.
diff --git a/crlcore/src/ccore/AllianceLibrary.cpp b/crlcore/src/ccore/AllianceLibrary.cpp
new file mode 100644
index 00000000..2e468d3f
--- /dev/null
+++ b/crlcore/src/ccore/AllianceLibrary.cpp
@@ -0,0 +1,118 @@
+
+// -*- C++ -*-
+//
+// This file is part of the Coriolis Project.
+// Copyright (C) Laboratoire LIP6 - Departement ASIM
+// Universite Pierre et Marie Curie
+//
+// Main contributors :
+// Christophe Alexandre
+// Sophie Belloeil
+// Hugo Clément
+// Jean-Paul Chaput
+// Damien Dupuis
+// Christian Masson
+// Marek Sroka
+//
+// The Coriolis Project is free software; you can redistribute it
+// and/or modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2 of
+// the License, or (at your option) any later version.
+//
+// The Coriolis Project is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the Coriolis Project; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+//
+// License-Tag
+// Authors-Tag
+// ===================================================================
+//
+// $Id$
+//
+// x-----------------------------------------------------------------x
+// | |
+// | C O R I O L I S |
+// | Alliance / Hurricane Interface |
+// | |
+// | Author : Rémy Escassut |
+// | E-mail : Remy.Escassut@silvaco.com |
+// | =============================================================== |
+// | C++ Header : "./AllianceLibrary.cpp" |
+// | *************************************************************** |
+// | U p d a t e s |
+// | |
+// x-----------------------------------------------------------------x
+
+
+
+
+# include "hurricane/Library.h"
+
+# include "crlcore/Utilities.h"
+# include "crlcore/AllianceLibrary.h"
+
+
+
+
+namespace CRL {
+
+
+// -------------------------------------------------------------------
+// Class : "AllianceDirectory".
+
+ AllianceLibrary::AllianceLibrary ()
+ : _path("")
+ , _library(NULL)
+ {
+ }
+
+
+ AllianceLibrary::AllianceLibrary ( const Name& path, Library* library )
+ : _path(path)
+ , _library(library)
+ {
+ if ( _path.isEmpty() )
+ throw ( Error("Can't create "+_TName("AllianceLibrary")+" : empty path") );
+ }
+
+
+ AllianceLibrary& AllianceLibrary::operator= ( const AllianceLibrary& d )
+ {
+ _path = d._path;
+ _library = d._library;
+ return *this;
+ }
+
+
+ AllianceLibrary& AllianceLibrary::operator= ( const string& path )
+ {
+ _path = path;
+ _library = NULL;
+ return *this;
+ }
+
+
+ string AllianceLibrary::_getString () const
+ {
+ return ( "<" + _TName("AllianceLibrary") + " " + getString(_library->getName()) + ">" );
+ }
+
+
+ Record* AllianceLibrary::_getRecord() const
+ {
+ Record* record = new Record ( getString(this) );
+ record->add ( getSlot("Path" ,&_path ) );
+ record->add ( getSlot("Library", _library) );
+ return ( record );
+ }
+
+
+
+
+} // End of CRL namespace.
diff --git a/crlcore/src/ccore/Banner.cpp b/crlcore/src/ccore/Banner.cpp
new file mode 100644
index 00000000..434de5f3
--- /dev/null
+++ b/crlcore/src/ccore/Banner.cpp
@@ -0,0 +1,532 @@
+
+
+// This file is part of the Coriolis Project.
+// Copyright (C) Laboratoire LIP6 - Departement ASIM
+// Universite Pierre et Marie Curie
+//
+// Main contributors :
+// Christophe Alexandre
+// Sophie Belloeil
+// Hugo Clément
+// Jean-Paul Chaput
+// Damien Dupuis
+// Christian Masson
+// Marek Sroka
+//
+// The Coriolis Project is free software; you can redistribute it
+// and/or modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2 of
+// the License, or (at your option) any later version.
+//
+// The Coriolis Project is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the Coriolis Project; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+//
+// License-Tag
+// Authors-Tag
+// ===================================================================
+
+
+// -*- C++ -*-
+//
+// $Id$
+//
+// x-----------------------------------------------------------------x
+// | |
+// | C O R I O L I S |
+// | Alliance / Hurricane Interface |
+// | |
+// | Author : Jean-Paul CHAPUT |
+// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
+// | =============================================================== |
+// | C++ Header : "./Banner.cpp" |
+// | *************************************************************** |
+// | U p d a t e s |
+// | |
+// x-----------------------------------------------------------------x
+
+
+
+# include
+# include
+# include
+
+# include
+
+# include "crlcore/Banner.h"
+
+
+namespace {
+
+
+ using std::make_pair;
+ using std::cerr;
+ using std::endl;
+ using std::setw;
+
+
+ const char* badChar =
+ "BannerFont::operator[](): Font \"%s\" doesn't has character \'%c\'.\n";
+ const char* unevenCharWidth =
+ "BannerFont::BigChar::BigChar():\n"
+ " Character '%c' has an uneven width.\n"
+ " (line %d has a different width)\n\n";
+ const char* nullCharLine =
+ "BannerFont::BigChar::BigChar():\n"
+ " Character '%c' has an unitialized line.\n"
+ " (line %d has NULL pointer)\n";
+ const char* badHeight =
+ "BannerFont::addChar():\n"
+ " Character '%c' has not the same height as others in font \"%s\".\n"
+ " (font character height := %d)\n";
+ const char* dupChar =
+ "BannerFont::addChar(): Attempt to redefine character \'%c\' in font \"%s\".\n";
+ const char* badBannerWidth =
+ "Banner::_ReDraw() :\n\n"
+ " Banner \"%s\" doesnt't fit in screen width (%d characters).\n";
+
+
+# include "UnknownBoldNormal14.h"
+
+
+} // End of anonymous namespace.
+
+
+namespace CRL {
+
+
+ BannerFont::FontMap BannerFont::_fontMap;
+
+
+
+// -------------------------------------------------------------------
+// Class : "BannerFont::BigChar".
+
+
+ BannerFont::BigChar::BigChar ( char c
+ , int height
+ , const char* lines[]
+ , const BannerFont* font )
+ : _character(c)
+ , _height(height)
+ , _lines(lines)
+ , _font(font)
+ {
+ if ( lines[0] == NULL )
+ throw Error ( nullCharLine, _character, _height );
+
+ unsigned width = strlen ( lines[0] );
+
+ for ( int i=1 ; i<_height ; i++ ) {
+ if ( lines[i] == NULL )
+ throw Error ( nullCharLine, _character, _height );
+
+ if ( strlen(lines[i]) != width )
+ throw Error ( unevenCharWidth, _character, _height );
+ }
+ }
+
+
+ BannerFont::BigChar::~BigChar ()
+ { }
+
+
+ const char* BannerFont::BigChar::operator[] ( int line ) const
+ {
+ return _lines[line];
+ }
+
+
+ string BannerFont::BigChar::_getPrint () const
+ {
+ string s;
+ for ( int line=0 ; line<_height ; line++ ) {
+ s += _lines[line];
+ s += "\n";
+ }
+ return s;
+ }
+
+
+// -------------------------------------------------------------------
+// Class : "BannerFont::FontMap".
+
+
+ BannerFont::FontMap::FontMap (): map()
+ {
+# define ADDCHAR(c,t) (font->addChar((c),sizeof(t)/sizeof(char*),(t)))
+
+ BannerFont *font;
+
+ try {
+ font = new BannerFont ( "Unknown_Bold_Normal_14" );
+ // Digits.
+ ADDCHAR ( '0', Unknown_Bold_Normal_14_0 );
+ ADDCHAR ( '1', Unknown_Bold_Normal_14_1 );
+ ADDCHAR ( '2', Unknown_Bold_Normal_14_2 );
+ ADDCHAR ( '3', Unknown_Bold_Normal_14_3 );
+ ADDCHAR ( '4', Unknown_Bold_Normal_14_4 );
+ ADDCHAR ( '5', Unknown_Bold_Normal_14_5 );
+ ADDCHAR ( '6', Unknown_Bold_Normal_14_6 );
+ ADDCHAR ( '7', Unknown_Bold_Normal_14_7 );
+ ADDCHAR ( '8', Unknown_Bold_Normal_14_8 );
+ ADDCHAR ( '9', Unknown_Bold_Normal_14_9 );
+
+ // Alphabetical caps.
+ ADDCHAR ( 'A', Unknown_Bold_Normal_14_A );
+ ADDCHAR ( 'B', Unknown_Bold_Normal_14_B );
+ ADDCHAR ( 'C', Unknown_Bold_Normal_14_C );
+ ADDCHAR ( 'D', Unknown_Bold_Normal_14_D );
+ ADDCHAR ( 'E', Unknown_Bold_Normal_14_E );
+ ADDCHAR ( 'F', Unknown_Bold_Normal_14_F );
+ ADDCHAR ( 'G', Unknown_Bold_Normal_14_G );
+ ADDCHAR ( 'H', Unknown_Bold_Normal_14_H );
+ ADDCHAR ( 'I', Unknown_Bold_Normal_14_I );
+ ADDCHAR ( 'J', Unknown_Bold_Normal_14_J );
+ ADDCHAR ( 'K', Unknown_Bold_Normal_14_K );
+ ADDCHAR ( 'L', Unknown_Bold_Normal_14_L );
+ ADDCHAR ( 'M', Unknown_Bold_Normal_14_M );
+ ADDCHAR ( 'N', Unknown_Bold_Normal_14_N );
+ ADDCHAR ( 'O', Unknown_Bold_Normal_14_O );
+ ADDCHAR ( 'P', Unknown_Bold_Normal_14_P );
+ ADDCHAR ( 'Q', Unknown_Bold_Normal_14_Q );
+ ADDCHAR ( 'R', Unknown_Bold_Normal_14_R );
+ ADDCHAR ( 'S', Unknown_Bold_Normal_14_S );
+ ADDCHAR ( 'T', Unknown_Bold_Normal_14_T );
+ ADDCHAR ( 'U', Unknown_Bold_Normal_14_U );
+ ADDCHAR ( 'V', Unknown_Bold_Normal_14_V );
+ ADDCHAR ( 'W', Unknown_Bold_Normal_14_W );
+ ADDCHAR ( 'X', Unknown_Bold_Normal_14_X );
+ ADDCHAR ( 'Y', Unknown_Bold_Normal_14_Y );
+ ADDCHAR ( 'Z', Unknown_Bold_Normal_14_Z );
+
+ // Alphabetical.
+ ADDCHAR ( 'a', Unknown_Bold_Normal_14_a );
+ ADDCHAR ( 'b', Unknown_Bold_Normal_14_b );
+ ADDCHAR ( 'c', Unknown_Bold_Normal_14_c );
+ ADDCHAR ( 'd', Unknown_Bold_Normal_14_d );
+ ADDCHAR ( 'e', Unknown_Bold_Normal_14_e );
+ ADDCHAR ( 'f', Unknown_Bold_Normal_14_f );
+ ADDCHAR ( 'g', Unknown_Bold_Normal_14_g );
+ ADDCHAR ( 'h', Unknown_Bold_Normal_14_h );
+ ADDCHAR ( 'i', Unknown_Bold_Normal_14_i );
+ ADDCHAR ( 'j', Unknown_Bold_Normal_14_j );
+ ADDCHAR ( 'k', Unknown_Bold_Normal_14_k );
+ ADDCHAR ( 'l', Unknown_Bold_Normal_14_l );
+ ADDCHAR ( 'm', Unknown_Bold_Normal_14_m );
+ ADDCHAR ( 'n', Unknown_Bold_Normal_14_n );
+ ADDCHAR ( 'o', Unknown_Bold_Normal_14_o );
+ ADDCHAR ( 'p', Unknown_Bold_Normal_14_p );
+ ADDCHAR ( 'q', Unknown_Bold_Normal_14_q );
+ ADDCHAR ( 'r', Unknown_Bold_Normal_14_r );
+ ADDCHAR ( 's', Unknown_Bold_Normal_14_s );
+ ADDCHAR ( 't', Unknown_Bold_Normal_14_t );
+ ADDCHAR ( 'u', Unknown_Bold_Normal_14_u );
+ ADDCHAR ( 'v', Unknown_Bold_Normal_14_v );
+ ADDCHAR ( 'w', Unknown_Bold_Normal_14_w );
+ ADDCHAR ( 'x', Unknown_Bold_Normal_14_x );
+ ADDCHAR ( 'y', Unknown_Bold_Normal_14_y );
+ ADDCHAR ( 'z', Unknown_Bold_Normal_14_z );
+
+ insert ( make_pair("Unknown_Bold_Normal_14",font) );
+ }
+ catch ( Error &e ) {
+ cerr << e.what() << endl;
+ exit (1);
+ }
+
+# undef ADDCHAR
+ }
+
+
+ BannerFont::FontMap::~FontMap ()
+ {
+ for ( iterator it=begin() ; it != end() ; it++ )
+ delete it->second;
+ }
+
+
+ const BannerFont* BannerFont::FontMap::operator[] ( const string& name ) const
+ {
+ const_iterator it = find ( name );
+ if ( it != end() )
+ return it->second;
+
+ return (*this)[ "Unknown_Bold_Normal_14" ];
+ }
+
+
+// -------------------------------------------------------------------
+// Class : "BannerFont".
+
+
+ BannerFont::~BannerFont ()
+ {
+ CharMap::iterator ichar = _table.begin ();
+ for ( ; ichar != _table.end() ; ichar++ )
+ delete ichar->second;
+ }
+
+
+ const BannerFont* BannerFont::getBannerFont ( const string& name )
+ {
+ return _fontMap[name];
+ }
+
+
+ void BannerFont::addChar ( char character, int height, const char* lines[] )
+ {
+ CharMap::iterator it = _table.find ( character );
+ CharMap::iterator begin = _table.begin ();
+
+ if ( it != _table.end() )
+ throw Error ( dupChar, _name.c_str(), character );
+
+ _table [ character ] = new BigChar ( character, height, lines, this );
+
+ if ( begin == _table.end() ) _height = height;
+ if ( _height != height )
+ throw Error ( badHeight, _name.c_str(), _height, character );
+ }
+
+
+ const BannerFont::BigChar& BannerFont::operator[] ( char character ) const
+ {
+ CharMap::const_iterator it = _table.find ( character );
+
+ if ( it == _table.end() )
+ throw Error ( badChar, _name.c_str(), character );
+
+ return *(it->second);
+ }
+
+
+// -------------------------------------------------------------------
+// Class : "FontMap".
+
+
+// -------------------------------------------------------------------
+// Class : "Banner".
+
+
+ Banner::Banner ( string name
+ , string version
+ , string purpose
+ , string date
+ , string authors
+ , string contributors )
+ : _name(name)
+ , _version(version)
+ , _purpose(purpose)
+ , _date(date)
+ , _authors(authors)
+ , _contributors(contributors)
+ , _screenWidth(80)
+ , _font(BannerFont::getBannerFont("Unknown_Bold_Normal_14"))
+ , _lines(NULL)
+ , _banner()
+ {
+ _redraw ();
+ }
+
+
+ Banner::~Banner()
+ {
+ if ( _lines ) delete [] _lines;
+ }
+
+
+ void Banner::_redraw ()
+ {
+ if ( _lines ) delete [] _lines;
+
+ _lines = new string [ _font->getHeight() ];
+ _banner.str ("");
+ _banner << "\n";
+
+ // Concat all the caracters.
+ for ( unsigned i=0 ; i<_name.size() ; i++ ) {
+ for ( int line=0 ; line<_font->getHeight() ; line++ ) {
+ _lines[line] += ( *_font )[ _name[i] ][ line ];
+ _lines[line] += ' ';
+ }
+ }
+
+ // Check the banner width.
+ if ( _lines[0].size() > _screenWidth )
+ throw Error ( badBannerWidth, _name.c_str(), _screenWidth );
+
+ int half = ( _screenWidth - _lines[0].size() ) / 2;
+ string head ( half, ' ' );
+
+ // Concat & center all the lines.
+ for ( int line=0 ; line<_font->getHeight() ; line++ ) {
+ if ( _lines[line].find_first_not_of(" ") != string::npos )
+ _banner << head << _lines [ line ] << "\n";
+ }
+
+ // Draw the cartouche.
+ // Purpose.
+ if ( _purpose.size() ) {
+ half = ( _screenWidth - _purpose.size() ) / 2;
+ head.clear ();
+ head.append ( half, ' ' );
+
+ _banner << "\n" << head << _purpose << "\n";
+ }
+
+ half = ( _screenWidth - 44 ) / 2;
+ head.clear ();
+ head.append ( half, ' ' );
+
+ // Version.
+ if ( _version.size() ) {
+ string nameVersion = _name + " " + _version;
+ _banner << "\n" << head << "Coriolis CAD System 1.0,"
+ << setw(19) << nameVersion;
+ }
+
+ // Date.
+ if ( _date.size() ) {
+ time_t t;
+ time(&t);
+ _banner << "\n" << head << "Copyright (c) " << _date
+ << "-" << localtime(&t)->tm_year+1900 << ", ASIM/LIP6/UPMC";
+ }
+
+ // Authors.
+ if ( _authors.size() ) {
+ string author;
+ size_t end, token, tail, start;
+
+ end = _authors.size();
+ if ( end > 0 ) {
+ for ( token=0 ; token<=end ; token=tail ) {
+ tail = _authors.find ( ',' , token+1 );
+ start = (token==0) ? 0 : token+1;
+
+ author = _authors.substr ( start , tail-start );
+ if ( !token )
+ _banner << "\n" << head << "Author(s) :" << setw(32) << author;
+ else
+ _banner << "\n" << head << setw(43) << author;
+ }
+ }
+ }
+
+ // Contributors.
+ if ( _contributors.size() ) {
+ string contributor;
+ size_t end, token, tail, start;
+
+ end = _contributors.size();
+ if ( end > 0 ) {
+ for ( token=0 ; token<=end ; token=tail ) {
+ tail = _contributors.find ( ',' , token+1 );
+ start = (token==0) ? 0 : token+1;
+
+ contributor = _contributors.substr ( start , tail-start );
+ if ( !token )
+ _banner << "\n" << head << "Contributors(s) :" << setw(26) << contributor;
+ else
+ _banner << "\n" << head << setw(43) << contributor;
+ }
+ }
+ }
+
+ // E-mail.
+ _banner << "\n" << head << "E-mail : coriolis-cvs@asim.lip6.fr";
+
+ // Separate the banner from the following text.
+ _banner << "\n";
+ }
+
+
+ void Banner::setFont ( BannerFont* font )
+ {
+ if ( _font == font ) return;
+
+ _font = font;
+ _redraw ();
+ }
+
+
+ void Banner::setName ( string name )
+ {
+ if ( _name == name ) return;
+
+ _name = name;
+ _redraw ();
+ }
+
+
+ void Banner::setVersion ( string version )
+ {
+ if ( _version == version ) return;
+
+ _version = version;
+ _redraw ();
+ }
+
+
+ void Banner::setPurpose ( string purpose )
+ {
+ if ( _purpose == purpose ) return;
+
+ _purpose = purpose;
+ _redraw ();
+ }
+
+
+ void Banner::setDate ( string date )
+ {
+ if ( _date == date ) return;
+
+ _date = date;
+ _redraw ();
+ }
+
+
+ void Banner::setAuthors ( string authors )
+ {
+ if ( _authors == authors ) return;
+
+ _authors = authors;
+ _redraw ();
+ }
+
+
+ void Banner::setContributors ( string contributors )
+ {
+ if ( _contributors == contributors ) return;
+
+ _contributors = contributors;
+ _redraw ();
+ }
+
+
+ void Banner::setScreenWidth ( unsigned int screenWidth )
+ {
+ if ( _screenWidth == screenWidth ) return;
+
+ _screenWidth = screenWidth;
+ _redraw ();
+ }
+
+
+
+
+// x-----------------------------------------------------------------x
+// | Functions Definitions |
+// x-----------------------------------------------------------------x
+
+
+
+
+} // End of CRL namespace.
diff --git a/crlcore/src/ccore/CConfig.h.cmake b/crlcore/src/ccore/CConfig.h.cmake
new file mode 100644
index 00000000..2682acca
--- /dev/null
+++ b/crlcore/src/ccore/CConfig.h.cmake
@@ -0,0 +1 @@
+#cmakedefine CORIOLIS_TOP
diff --git a/crlcore/src/ccore/CConfig.h.in b/crlcore/src/ccore/CConfig.h.in
new file mode 100644
index 00000000..dd386f19
--- /dev/null
+++ b/crlcore/src/ccore/CConfig.h.in
@@ -0,0 +1,101 @@
+/* src/ccore/CConfig.h.in. Generated from configure.in by autoheader. */
+
+// -*- C++ -*-
+//
+// x-----------------------------------------------------------------x
+// | |
+// | C O R I O L I S |
+// | Alliance / Hurricane Interface |
+// | |
+// | Author : Jean-Paul CHAPUT |
+// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
+// | =============================================================== |
+// | C++ Header : "./CConfig.h" |
+// | *************************************************************** |
+// | U p d a t e s |
+// | |
+// x-----------------------------------------------------------------x
+//
+
+
+
+
+# ifndef __CCONFIG_H__
+# define __CCONFIG_H__
+
+
+/* The root directory where CORIOLIS is to be installed. */
+#undef CORIOLIS_TOP
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if LEF/DEF package has been found. */
+#undef HAVE_LEFDEF_LIB
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if OPENACCESS package has been found. */
+#undef HAVE_OPENACCESS_LIB
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_UNISTD_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define if using GNU regex */
+#undef WITH_REGEX
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+ `char[]'. */
+#undef YYTEXT_POINTER
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+# endif
+
diff --git a/crlcore/src/ccore/CMakeLists.txt b/crlcore/src/ccore/CMakeLists.txt
new file mode 100644
index 00000000..88b19f1b
--- /dev/null
+++ b/crlcore/src/ccore/CMakeLists.txt
@@ -0,0 +1,237 @@
+
+ include ( ${QT_USE_FILE} )
+
+ include_directories ( ${HURRICANE_INCLUDE_DIR} )
+ include_directories ( ${CRLCORE_SOURCE_DIR}/src/fonts
+ ${CRLCORE_SOURCE_DIR}/src/ccore
+ ${CRLCORE_SOURCE_DIR}/src/ccore/properties
+ ${CRLCORE_SOURCE_DIR}/src/ccore/bookshelf
+ ${CRLCORE_SOURCE_DIR}/src/ccore/cspice
+ ${CRLCORE_SOURCE_DIR}/src/ccore/lefdef
+ ${CRLCORE_SOURCE_DIR}/src/ccore/alliance/ap
+ ${CRLCORE_SOURCE_DIR}/src/ccore/alliance/vst
+ ${CRLCORE_SOURCE_DIR}/src/ccore/agds
+ ${CRLCORE_SOURCE_DIR}/src/ccore/cif
+ ${CRLCORE_SOURCE_DIR}/src/ccore/spice
+ ${CRLCORE_SOURCE_DIR}/src/ccore/liberty
+ ${CRLCORE_SOURCE_DIR}/src/ccore/toolbox
+ )
+
+ add_definitions ( -DCORIOLIS_TOP=\\"${PROJECT_BINARY_DIR}\\" )
+
+ set ( includes crlcore/Utilities.h
+ crlcore/Memory.h
+ crlcore/Banner.h
+ crlcore/COptions.h
+ crlcore/XmlParser.h
+ crlcore/GdsDriver.h
+ crlcore/CifDriver.h
+ crlcore/SearchPath.h
+ crlcore/Environment.h
+ crlcore/Catalog.h
+ crlcore/AllianceLibrary.h
+ crlcore/ParsersDrivers.h
+ crlcore/LefDefExtension.h
+ crlcore/Ioc.h
+ crlcore/NetExtension.h
+ crlcore/RoutingGauge.h
+ crlcore/RoutingLayerGauge.h
+ crlcore/CellGauge.h
+ crlcore/SymbolicTechnologyParser.h
+ crlcore/RealTechnologyParser.h
+ crlcore/GraphicsParser.h
+ crlcore/AllianceFramework.h
+ crlcore/ToolEngine.h
+ crlcore/ToolEngines.h
+ crlcore/ToolBox.h
+ crlcore/Hierarchy.h
+ crlcore/CellPath.h
+ crlcore/CellPaths.h
+ crlcore/TimingEvent.h
+ )
+ set ( mocincludes crlcore/GraphicToolEngine.h )
+ set ( ccore_cpps Utilities.cpp
+ Memory.cpp
+ Banner.cpp
+ COptions.cpp
+ XmlParser.cpp
+ GdsDriver.cpp
+ CifDriver.cpp
+ SearchPath.cpp
+ Environment.cpp
+ Catalog.cpp
+ AllianceLibrary.cpp
+ ParsersDrivers.cpp
+ RoutingGauge.cpp
+ CellGauge.cpp
+ RoutingLayerGauge.cpp
+ SymbolicTechnologyParser.cpp
+ RealTechnologyParser.cpp
+ GraphicsParser.cpp
+ AllianceFramework.cpp
+ ToolEngine.cpp
+ GraphicToolEngine.cpp
+ )
+ set ( spice_cpps spice/SpiceParser.cpp
+ spice/SpiceDriver.cpp
+ spice/Spice.cpp
+ )
+ set ( bookshelf_cpps bookshelf/BookshelfParser.cpp
+ bookshelf/BookshelfDriver.cpp
+ )
+ set ( ap_cpps alliance/ap/ApParser.cpp
+ alliance/ap/ApDriver.cpp
+ )
+ set ( agds_cpps agds/AgdsDriver.cpp
+ )
+ set ( cif_cpps cif/CifDriver.cpp
+ )
+ set ( toolbox_cpps toolbox/HyperNetPortOccurrences.cpp
+ toolbox/ToolBox.cpp
+ toolbox/UniqueCellOccurrences.cpp
+ toolbox/RoutingPads.cpp
+ )
+ set ( vst_driver_cpps alliance/vst/VstDriver.cpp )
+ set ( properties_cpps properties/NetExtension.cpp )
+# set ( liberty_cpps liberty/CellPath.cpp
+# liberty/LuTableTemplate.cpp
+# liberty/LibertyTechnology.cpp
+# liberty/TimingEvent.cpp
+# liberty/LuTable.cpp
+# )
+ set ( lefdef_cpps lefdef/LefDef.h
+ lefdef/LefDefExtension.cpp
+ lefdef/LefParser.cpp
+ lefdef/DefParser.cpp
+ lefdef/DefDriver.cpp
+ )
+
+ if ( OA_FOUND )
+ include_directories ( ${OA_INCLUDE_DIR} )
+ set( openaccess_cpps openaccess/COpenAccessBridgeLayer.cpp
+ openaccess/OAWrapper.cpp
+ )
+ endif ( OA_FOUND )
+ if ( LEFDEF_FOUND )
+ include_directories ( ${LEFDEF_INCLUDE_DIR} )
+ endif ( LEFDEF_FOUND )
+ set (openaccess_cpps ${openaccess_cpps}
+ openaccess/OpenAccessWrapper.cpp )
+
+ set ( VstParserSourceDir ${CRLCORE_SOURCE_DIR}/src/ccore/alliance/vst )
+ set ( VstParserBinaryDir ${CRLCORE_BINARY_DIR}/src/ccore/alliance/vst )
+ set ( VstParserScanner ${VstParserSourceDir}/VstParserScanner.ll )
+ set ( VstParserGrammar ${VstParserSourceDir}/VstParserGrammar.yy )
+ set ( VstParserScannerCpp ${VstParserBinaryDir}/VstParserScanner.cpp )
+ set ( VstParserGrammarCpp ${VstParserBinaryDir}/VstParserGrammar.cpp )
+ add_subdirectory ( alliance )
+ add_custom_target ( VstParser echo "Creating VST parser" )
+ add_custom_command ( SOURCE ${VstParserScanner}
+ COMMAND ${FLEX_EXECUTABLE}
+ ARGS -PVST -o${VstParserScannerCpp} ${VstParserScanner}
+ TARGET VstParser
+ OUTPUTS ${VstParserScannerCpp}
+ )
+ add_custom_command ( SOURCE ${VstParserGrammar}
+ COMMAND ${BISON_EXECUTABLE}
+ ARGS -d -v -p VST -y ${VstParserGrammar} -o ${VstParserGrammarCpp}
+ TARGET VstParser
+ DEPENDS ${VstParserScannerCpp}
+ OUTPUTS ${VstParserGrammarCpp}
+ )
+ include_directories ( ${VstParserBinaryDir} )
+ set ( vst_parser_cpps ${VstParserScannerCpp}
+ ${VstParserGrammarCpp}
+ )
+ set_source_files_properties ( ${VstParserScannerCpp} GENERATED )
+ set_source_files_properties ( ${VstParserGrammarCpp} GENERATED )
+
+
+ set ( IocParserSourceDir ${CRLCORE_SOURCE_DIR}/src/ccore/ioc )
+ set ( IocParserBinaryDir ${CRLCORE_BINARY_DIR}/src/ccore/ioc )
+ set ( IocParserScanner ${IocParserSourceDir}/IocParserScanner.ll )
+ set ( IocParserGrammar ${IocParserSourceDir}/IocParserGrammar.yy )
+ set ( IocParserScannerCpp ${IocParserBinaryDir}/IocParserScanner.cpp )
+ set ( IocParserGrammarCpp ${IocParserBinaryDir}/IocParserGrammar.cpp )
+ add_subdirectory ( ioc )
+ add_custom_target ( IocParser echo "Creating IOC parser" )
+ add_custom_command ( SOURCE ${IocParserScanner}
+ COMMAND ${FLEX_EXECUTABLE}
+ ARGS -PIoc -o${IocParserScannerCpp} ${IocParserScanner}
+ TARGET IocParser
+ OUTPUTS ${IocParserScannerCpp}
+ )
+ add_custom_command ( SOURCE ${IocParserGrammar}
+ COMMAND ${BISON_EXECUTABLE}
+ ARGS -d -v -p Ioc -y ${IocParserGrammar} -o ${IocParserGrammarCpp}
+ TARGET IocParser
+ DEPENDS ${IocParserScannerCpp}
+ OUTPUTS ${IocParserGrammarCpp}
+ )
+ include_directories ( ${IocParserBinaryDir} )
+ set ( ioc_parser_cpps ${IocParserScannerCpp}
+ ${IocParserGrammarCpp}
+ )
+ set_source_files_properties ( ${IocParserScannerCpp} GENERATED )
+ set_source_files_properties ( ${IocParserGrammarCpp} GENERATED )
+
+
+# # set ( LibertyParserSourceDir ${CRLCORE_SOURCE_DIR}/src/ccore/liberty )
+# # set ( LibertyParserBinaryDir ${CRLCORE_BINARY_DIR}/src/ccore/liberty )
+# # set ( LibertyParserScanner ${LibertyParserSourceDir}/LibertyParserScanner.ll )
+# # set ( LibertyParserGrammar ${LibertyParserSourceDir}/LibertyParserGrammar.yy )
+# # set ( LibertyParserScannerCpp ${LibertyParserBinaryDir}/LibertyParserScanner.cpp )
+# # set ( LibertyParserGrammarCpp ${LibertyParserBinaryDir}/LibertyParserGrammar.cpp )
+# # add_subdirectory ( liberty )
+# # add_custom_target ( LibertyParser echo "Creating LIBERTY parser" )
+# # add_custom_command ( SOURCE ${LibertyParserScanner}
+# COMMAND ${FLEX_EXECUTABLE}
+# ARGS -PLIBERTY -o${LibertyParserScannerCpp} ${LibertyParserScanner}
+# TARGET LibertyParser
+# OUTPUTS ${LibertyParserScannerCpp}
+# )
+# add_custom_command ( SOURCE ${LibertyParserGrammar}
+# COMMAND ${BISON_EXECUTABLE}
+# ARGS -d -v -p LIBERTY -y ${LibertyParserGrammar} -o ${LibertyParserGrammarCpp}
+# TARGET LibertyParser
+# DEPENDS ${LibertyParserScannerCpp}
+# OUTPUTS ${LibertyParserGrammarCpp}
+# )
+# include_directories ( ${LibertyParserBinaryDir} )
+# set ( liberty_parser_cpps ${LibertyParserScannerCpp}
+# ${LibertyParserGrammarCpp}
+# )
+# set_source_files_properties ( ${LibertyParserScannerCpp} GENERATED )
+# set_source_files_properties ( ${LibertyParserGrammarCpp} GENERATED )
+
+
+ qt4_wrap_cpp ( moc_cpps ${mocincludes} )
+ install ( FILES ${includes} ${mocincludes} DESTINATION /include/coriolis/crlcore )
+
+ add_library ( crlcore ${ccore_cpps}
+ ${moc_cpps}
+ ${ap_cpps}
+ ${agds_cpps}
+ ${cif_cpps}
+ ${toolbox_cpps}
+ ${vst_parser_cpps}
+ ${vst_driver_cpps}
+ ${properties_cpps}
+ ${ioc_parser_cpps}
+ ${liberty_cpps}
+ ${liberty_parser_cpps}
+ ${bookshelf_cpps}
+ ${spice_cpps}
+ ${lefdef_cpps}
+ ${openaccess_cpps}
+ )
+ target_link_libraries ( crlcore ${HURRICANE_LIBRARIES}
+ ${HURRICANE_GRAPHICAL_LIBRARIES}
+ ${QT_LIBRARIES}
+ ${IO_LIBRARIES}
+ ${LEFDEF_LIBRARIES}
+ ${OA_LIBRARIES}
+ ${AGDS_LIBRARY}
+ ${CIF_LIBRARY}
+ )
+ install ( TARGETS crlcore DESTINATION /lib )
diff --git a/crlcore/src/ccore/COptions.cpp b/crlcore/src/ccore/COptions.cpp
new file mode 100644
index 00000000..bc4d723d
--- /dev/null
+++ b/crlcore/src/ccore/COptions.cpp
@@ -0,0 +1,597 @@
+
+
+// This file is part of the Coriolis Project.
+// Copyright (C) Laboratoire LIP6 - Departement ASIM
+// Universite Pierre et Marie Curie
+//
+// Main contributors :
+// Christophe Alexandre
+// Sophie Belloeil
+// Hugo Clément
+// Jean-Paul Chaput
+// Damien Dupuis
+// Christian Masson
+// Marek Sroka
+//
+// The Coriolis Project is free software; you can redistribute it
+// and/or modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2 of
+// the License, or (at your option) any later version.
+//
+// The Coriolis Project is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the Coriolis Project; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+//
+// License-Tag
+// Authors-Tag
+// ===================================================================
+
+// -*- C++ -*-
+//
+// $Id: COptions.cpp,v 1.7 2006/02/19 00:52:46 jpc Exp $
+//
+// x-----------------------------------------------------------------x
+// | |
+// | C O R I O L I S |
+// | Alliance / Hurricane Interface |
+// | |
+// | Author : Jean-Paul CHAPUT |
+// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
+// | =============================================================== |
+// | C++ Module : "./COptions.cpp" |
+// | *************************************************************** |
+// | U p d a t e s |
+// | |
+// x-----------------------------------------------------------------x
+
+
+
+
+# include
+
+# include "crlcore/COptions.h"
+
+
+
+
+namespace {
+
+ using namespace std;
+
+ // -----------------------------------------------------------------
+ // Begin of local namespace (internal objects).
+
+
+// -------------------------------------------------------------------
+// Class : "::_Frag()".
+
+ class _Frag {
+ public: string _val;
+ public: int _order;
+
+ public: _Frag ( string val, int order )
+ : _val(val), _order(order) { };
+ };
+
+ typedef vector<_Frag> _FragVect;
+
+
+
+
+ // ---------------------------------------------------------------
+ // Pre-defined objects.
+
+
+
+// -------------------------------------------------------------------
+// Function : "badShort()".
+
+inline string badShort ( const string &name )
+{
+ string m;
+
+ m += "COptions::Add() :";
+ m += "\n\n";
+ m += " Short options must have exactly one character \"" + name + "\".\n";
+
+ return ( m );
+}
+
+
+
+// -------------------------------------------------------------------
+// Function : "dupOption()".
+
+inline string dupOption ( const string &name )
+{
+ string m;
+
+ m += "COptions::Add() :";
+ m += "\n\n";
+ m += " Duplicate option \"" + name + "\".\n";
+
+ return ( m );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Function : "unknownOption()".
+
+inline string unknownOption ( const string &name )
+{
+ string m;
+
+ m += "COptions::Parse() :";
+ m += "\n\n";
+ m += " Unknown option \"" + name + "\".\n";
+
+ return ( m );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Function : "unknownKey()".
+
+inline string unknownKey ( const string &name )
+{
+ string m;
+
+ m += "COptions::Parse() :";
+ m += "\n\n";
+ m += " Unknown option key \"" + name + "\".\n";
+
+ return ( m );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Function : "missingArg()".
+
+inline string missingArg ( const string &name )
+{
+ string m;
+
+ m += "COptions::Parse() :";
+ m += "\n\n";
+ m += " Missing mandatory argument of option \"" + name + "\"\n";
+
+ return ( m );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Function : "reParse()".
+
+inline string reParse ()
+{
+ string m;
+
+ m += "COptions::Parse() :";
+ m += "\n\n";
+ m += " Attempt to re-parse options. You must explicitely clear\n";
+ m += " the COptions object before calling another COptions::Parse().\n";
+
+ return ( m );
+}
+
+
+ // -----------------------------------------------------------------
+ // End of local namespace (internal objects).
+
+}
+
+
+namespace CRL {
+
+
+
+
+// x-----------------------------------------------------------------x
+// | Global Definitions |
+// x-----------------------------------------------------------------x
+
+
+ const string COptions::_true = "__true";
+ const string COptions::_false = "__false";
+ const string COptions::_remains = "__remains";
+ const string COptions::_argvzero = "__argv[0]";
+ const string COptions::_missing = "__missing";
+
+
+
+
+// x-----------------------------------------------------------------x
+// | Methods Definitions |
+// x-----------------------------------------------------------------x
+
+
+// -------------------------------------------------------------------
+// Conversion : "COptions::Option::operator string()".
+
+COptions::Option::operator string ()
+{
+ if ( _times == 0 ) return ( COptions::_false );
+ if ( _times <= _select ) return ( COptions::_false );
+ if ( ! _hasArg ) return ( COptions::_true );
+
+ return ( _args[ _select ] );
+}
+
+
+ string& COptions::Option::getArg ( size_t i )
+ {
+ return _args[i];
+ }
+
+
+
+
+// -------------------------------------------------------------------
+// Constructor : "COptions::COptions()".
+
+COptions::COptions () : _clear(true)
+ , _argHelp(false)
+ , _argVerbose(false)
+ , _argVeryVerbose(false)
+ , _argCatchCore(false)
+ , _missingBuiltin("",_missing)
+{
+ // Special option holding all remaining non options arguments.
+ Add ( "", _remains , true );
+ Add ( "", _argvzero, true );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::Find()".
+
+COptions::OptionVect::iterator COptions::Find ( string name )
+{
+ OptionVect::iterator it;
+ OptionVect::iterator end = _options.end ();
+
+ if ( name.size() == 0 ) return ( end );
+ if ( name.size() == 1 ) {
+ for ( it=_options.begin() ; it!=end ; it++ ) {
+ if ( it->getShort() == name ) break;
+ }
+ } else {
+ for ( it=_options.begin() ; it!=end ; it++ ) {
+ if ( it->getLong() == name ) break;
+ }
+ }
+
+ return ( it );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::Add()".
+
+void COptions::Add ( string nameShort
+ , string nameLong
+ , bool hasArg
+ , string defaultArg )
+{
+ OptionVect::iterator it;
+ OptionVect::iterator end = _options.end ();
+
+ if ( nameShort.size() > 1 ) throw ( Error(badShort(nameShort)) );
+
+ if ( ( it=Find(nameShort) ) == end ) {
+ if ( ( it=Find(nameLong) ) == end ) {
+ _options.push_back ( Option(nameShort,nameLong,hasArg,defaultArg) );
+ } else
+ throw ( Error (dupOption(nameLong)) );
+ } else
+ throw ( Error (dupOption(nameShort)) );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::AddHelp()".
+
+void COptions::AddHelp ()
+{
+ Add ( "h", "help" );
+ _argHelp = true;
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::AddVerbose()".
+
+void COptions::AddVerbose ()
+{
+ Add ( "v", "verbose" );
+ _argVerbose = true;
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::AddVeryVerbose()".
+
+void COptions::AddVeryVerbose ()
+{
+ Add ( "V", "very-verbose" );
+ _argVeryVerbose = true;
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::AddVeryVerbose()".
+
+void COptions::AddCatchCore ()
+{
+ Add ( "D", "core-dump" );
+ _argCatchCore = true;
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::getHelp()".
+
+COptions::Option &COptions::getHelp ()
+{
+ if ( ! _argHelp ) return ( _missingBuiltin );
+
+ return ( (*this)["help"] );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::getVerbose()".
+
+COptions::Option &COptions::getVerbose ()
+{
+ if ( ! _argVerbose ) return ( _missingBuiltin );
+
+ return ( (*this)["verbose"] );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::getVeryVerbose()".
+
+COptions::Option &COptions::getVeryVerbose ()
+{
+ if ( ! _argVeryVerbose ) return ( _missingBuiltin );
+
+ return ( (*this)["very-verbose"] );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::getCatchCore()".
+
+COptions::Option &COptions::getCatchCore ()
+{
+ if ( ! _argCatchCore ) return ( _missingBuiltin );
+
+ return ( (*this)["core-dump"] );
+}
+
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::Parse()".
+
+void COptions::Parse ( int argc, char *argv[] )
+{
+ if ( ! _clear ) throw ( Error(reParse()) );
+ _clear = false;
+
+ _FragVect fragOpts;
+ _FragVect fragArgs;
+ string arg;
+ size_t equal;
+ int order = 0;
+ bool longOpt;
+
+
+ // First step : separate options from arguments in two
+ // indexed list (index is relative to the argv[] ordering.
+ for ( int i=1 ; i_val );
+
+ if ( opt == _options.end() ) throw ( Error(unknownOption(itOpt->_val)) );
+
+ if ( opt->getHasArg() ) {
+ if ( (itArg != endArg ) && ( itArg->_order == itOpt->_order+1 ) )
+ { opt->AddArg ( itArg->_val ); itArg++; continue; }
+
+ if ( opt->getDefault().size() > 0 )
+ { opt->AddArg ( opt->getDefault() ); continue; }
+
+ throw ( Error(missingArg(itOpt->_val)) );
+ }
+
+ opt->AddArg ( "__true" );
+ }
+
+
+ // Third step : set default arguments (if not found on
+ // the command line).
+ for ( opt=_options.begin() ; opt!=_options.end() ; opt++ ) {
+ if ( ( opt->getDefault().size() > 0 ) && ( opt->getTimes() == 0 ) )
+ opt->AddArg ( opt->getDefault() );
+ }
+
+
+ // Storing argv[0] (program's name).
+ Find ( _argvzero )->AddArg ( argv[0] );
+
+ // Storing all non-options remaining arguments.
+ opt = Find ( _remains );
+ for ( ; itArg != endArg ; itArg++ )
+ opt->AddArg ( itArg->_val );
+}
+
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::Clear()".
+
+void COptions::Clear ()
+{
+ OptionVect::iterator it;
+ OptionVect::iterator end = _options.end ();
+
+ for ( it=_options.begin() ; it!=end ; it++ ) it->Clear ();
+
+ _clear = true;
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Operator : "COptions::operator[]()".
+
+COptions::Option &COptions::operator[] ( string key )
+{
+ size_t separ = key.find ( '/' );
+ int index = 0;
+
+ if ( separ < key.size() ) {
+ istringstream sindex ( key.substr ( separ + 1 ) );
+ sindex >> index;
+ }
+
+ OptionVect::iterator opt = Find ( key.substr(0,separ) );
+ if ( opt == _options.end () ) {
+ throw ( Error(unknownKey(key)) );
+ }
+
+ opt->SetSelect ( index );
+ return ( *opt );
+}
+
+
+
+
+// -------------------------------------------------------------------
+// Method : "COptions::_getPrint()".
+
+string COptions::_getPrint ()
+{
+ ostringstream os;
+ ostringstream key;
+ OptionVect::iterator it;
+ OptionVect::iterator end = _options.end ();
+ string name;
+ string minus;
+
+
+ os << (string)(*this)[_argvzero];
+
+ for ( it=_options.begin() ; it!=end ; it++ ) {
+ if ( it->getLong() == _argvzero ) continue;
+ if ( it->getLong() == _remains ) continue;
+ if ( it->getLong().size() > 0 ) {
+ minus = "--";
+ name = it->getLong();
+ } else {
+ minus = "-";
+ name = it->getShort();
+ }
+
+ for ( int i=0; i < it->getTimes(); i++ ) {
+ if ( it->getHasArg() ) {
+ key.str ("");
+ key << name << "/" << i;
+ os << " " << minus << name << "=" << (string)(*this)[ key.str() ];
+ } else
+ os << " " << minus << name;
+ }
+ }
+
+ it = Find ( _remains );
+ for ( int i=0; i < it->getTimes(); i++ ) {
+ key.str ("");
+ key << _remains << "/" << i;
+ os << " " << (string)(*this)[ key.str() ];
+ }
+
+ return ( os.str() );
+}
+
+
+
+
+}
diff --git a/crlcore/src/ccore/Catalog.cpp b/crlcore/src/ccore/Catalog.cpp
new file mode 100644
index 00000000..fe932ba2
--- /dev/null
+++ b/crlcore/src/ccore/Catalog.cpp
@@ -0,0 +1,307 @@
+
+// -*- C++ -*-
+//
+// This file is part of the Coriolis Software.
+// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
+//
+// ===================================================================
+//
+// $Id$
+//
+// x-----------------------------------------------------------------x
+// | |
+// | C O R I O L I S |
+// | Alliance / Hurricane Interface |
+// | |
+// | Author : Jean-Paul CHAPUT |
+// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
+// | =============================================================== |
+// | C++ Module : "./Catalog.cpp" |
+// | *************************************************************** |
+// | U p d a t e s |
+// | |
+// x-----------------------------------------------------------------x
+
+
+# include
+using namespace std;
+
+#include "hurricane/Collection.h"
+#include "hurricane/Library.h"
+#include "hurricane/Name.h"
+
+#include "crlcore/Utilities.h"
+#include "crlcore/Catalog.h"
+
+
+namespace CRL {
+
+
+ const char* MissingStateProperty = "%s:\n\n Missing Catalog State Property in cell \"%s\".\n";
+
+
+// -------------------------------------------------------------------
+// Class : "Catalog::State".
+
+
+ Catalog::State::~State ()
+ {
+ if ( _cell )
+ _cell->removeProperty ( CatalogProperty::getPropertyName() );
+ }
+
+
+ void Catalog::State::merge ( const State& other )
+ {
+ if ( (_cell ==NULL) && other._cell ) _cell = other._cell;
+ if ( (_library==NULL) && other._library ) _library = other._library;
+
+ _flags |= other._flags;
+ _depth = max ( _depth, other._depth );
+ }
+
+
+ string Catalog::State::_getString () const
+ {
+ string s;
+
+ if ( isFlattenLeaf() ) s += 'C';
+ if ( isFeed() ) s += 'F';
+ if ( isGds() ) s += 'G';
+ if ( isDelete() ) s += 'D';
+
+ return s;
+ }
+
+
+ Record* Catalog::State::_getRecord () const
+ {
+ Record* record = new Record ( "" );
+ if ( record != NULL ) {
+ record->add ( getSlot("_flags" , _flags ) );
+ record->add ( getSlot("_depth" , _depth ) );
+ record->add ( getSlot("_cell" , _cell ) );
+ record->add ( getSlot("_library", _library) );
+ }
+ return record;
+ }
+
+
+// -------------------------------------------------------------------
+// Class : "Catalog".
+
+ Catalog::~Catalog ()
+ {
+ clear ();
+ }
+
+
+ Catalog::State* Catalog::getState ( const Name& name, bool add )
+ {
+ map::iterator it;
+
+ if ( (it=_states.find(name)) != _states.end() ) return it->second;
+
+ State *state = NULL;
+ if ( add ) {
+ state = new State ();
+ _states [ name ] = state;
+ }
+ return ( state );
+ }
+
+
+ void Catalog::mergeState ( const Name& name, const State& other )
+ {
+ map::iterator it;
+ State* state;
+
+ if ( (it=_states.find(name)) == _states.end() )
+ state = getState ( name, true );
+ else
+ state = it->second;
+
+ state->merge ( other );
+ }
+
+
+ bool Catalog::deleteState ( const Name& name )
+ {
+ map::iterator it;
+
+ if ( (it=_states.find(name)) == _states.end() ) return false;
+
+ State *state = it->second;
+
+ delete state;
+ _states.erase ( it );
+
+ return true;
+ }
+
+
+ void Catalog::clear ()
+ {
+ map::const_iterator istate;
+ for ( istate=_states.begin() ; istate!=_states.end() ; istate++ ) {
+ delete istate->second;
+ }
+ _states.clear ();
+ }
+
+
+ bool Catalog::readLine ( const string& s, string& name, State* state )
+ {
+ static string spaceChars = " ";
+
+ size_t start = s.find_first_not_of ( spaceChars );
+ size_t stop = s.find_first_of ( spaceChars, start );
+
+ if ( stop == string::npos ) return false;
+
+ name = s.substr ( start, stop-start );
+
+ start = s.find_first_not_of ( spaceChars, stop );
+ if ( start == string::npos ) return false;
+
+ for ( ; startsetFlattenLeaf ( true ); break;
+ case 'F': state->setFeed ( true ); break;
+ case 'G': state->setGds ( true ); break;
+ case 'D': state->setDelete ( true ); break;
+ default: return false;
+ }
+ }
+
+ return true;
+ }
+
+
+ bool Catalog::loadFromFile ( const string& path, Library* library )
+ {
+ IoFile catalogFile ( path );
+
+ catalogFile.open ( "r" );
+ if ( !catalogFile.isOpen() ) return false;
+
+ string cellName;
+ char rawLine[1024];
+
+ while ( !catalogFile.eof() ) {
+ State cellState;
+ cellState.setLibrary ( library );
+
+ string line = catalogFile.readLine(rawLine,1023);
+ if ( !line.size() ) continue;
+
+ if ( !readLine (line,cellName,&cellState) ) {
+ cerr << "[WARNING] Catalog::LoadFromFile() :\n"
+ << " Malformed catalog line \"" << line
+ << "\"\n (file: " << path << ", line: " << catalogFile.getLineNumber() << ")" << endl;
+ continue;
+ }
+ mergeState ( cellName, cellState );
+ }
+ catalogFile.close ();
+
+ return true;
+ }
+
+
+ string Catalog::_getPrint () const
+ {
+ map::const_iterator it;
+ ostringstream s;
+
+ for ( it=_states.begin() ; it!=_states.end() ; it++ ) {
+ s << left << setw(30) << getString(it->first) << getString(it->second) << endl;
+ }
+
+ return s.str();
+ }
+
+
+ string Catalog::_getString () const
+ {
+ ostringstream s;
+
+ s << "";
+ return s.str();
+ }
+
+
+ Record* Catalog::_getRecord () const
+ {
+ map::const_iterator it;
+
+ Record* record = new Record ( "" );
+
+ record->add ( getSlot ( "States", &_states ) );
+
+ return record;
+ }
+
+
+// -------------------------------------------------------------------
+// Class : "CatalogProperty"
+
+
+ Name CatalogProperty::_name = "Alliance Catalog State";
+
+
+ CatalogProperty* CatalogProperty::create ( Catalog::State* state )
+ {
+ CatalogProperty *property = new CatalogProperty ( state );
+
+ property->_postCreate ();
+ return property;
+ }
+
+
+ void CatalogProperty::onReleasedBy ( DBo* owner )
+ {
+ _state->setCell ( NULL );
+ PrivateProperty::onReleasedBy ( owner );
+ }
+
+
+ Name CatalogProperty::getPropertyName ()
+ {
+ return _name;
+ }
+
+
+ Name CatalogProperty::getName () const
+ {
+ return getPropertyName();
+ }
+
+
+ string CatalogProperty::_getTypeName () const
+ {
+ return _TName ( "CatalogProperty" );
+ }
+
+
+ string CatalogProperty::_getString () const
+ {
+ string s = PrivateProperty::_getString ();
+ s.insert ( s.length() - 1 , " " + getString(_state) );
+
+ return s;
+ }
+
+
+ Record* CatalogProperty::_getRecord () const
+ {
+ Record* record = PrivateProperty::_getRecord();
+ if ( record ) {
+ record->add( getSlot("_name" ,_name ) );
+ record->add( getSlot("_state",_state) );
+ }
+ return record;
+ }
+
+
+} // End of CRL namespace.
diff --git a/crlcore/src/ccore/CellGauge.cpp b/crlcore/src/ccore/CellGauge.cpp
new file mode 100644
index 00000000..1dc49891
--- /dev/null
+++ b/crlcore/src/ccore/CellGauge.cpp
@@ -0,0 +1,141 @@
+
+
+// -*- C++ -*-
+//
+// This file is part of the Coriolis Software.
+// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
+//
+// ===================================================================
+//
+// $Id$
+//
+// x-----------------------------------------------------------------x
+// | |
+// | C O R I O L I S |
+// | Alliance / Hurricane Interface |
+// | |
+// | Author : Jean-Paul CHAPUT |
+// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
+// | =============================================================== |
+// | C++ Header : "./CellGauge.cpp" |
+// | *************************************************************** |
+// | U p d a t e s |
+// | |
+// x-----------------------------------------------------------------x
+
+
+
+
+#include
+
+#include "crlcore/CellGauge.h"
+
+
+
+
+namespace {
+
+
+ const char *missingMandatoryAttr =
+ "CRoutingGauge::createFromXml () :\n\n"
+ " Can't found mandatory attribute \"%s\".\n";
+
+ const char *badAttrValue =
+ "CRoutingGauge::createFromXml () :\n\n"
+ " Invalid value \"%s\" for attribute \"%s\".\n";
+
+// const char *missingCellGaugeTag =
+// "::createCellGaugeFromXml () :\n\n"
+// " Can't found \"cellgauge\" tag.\n"
+// " (XML file := \"%s\").\n";
+
+// const char *missingCellGaugeNameAttr =
+// "::createCellGaugeFromXml () :\n\n"
+// " Can't found cellgauge name tag attribute.\n";
+
+// const char *emptyCellGaugeNameAttr =
+// "::createCellGaugeFromXml () :\n\n"
+// " cellgauge name tag attribute is empty.\n";
+
+
+} // End of Anonymous namespace.
+
+
+
+
+namespace CRL {
+
+
+// -------------------------------------------------------------------
+// Class : "CRL::CellGauge".
+
+
+ CellGauge::CellGauge ( const char* name
+ , const char* pinLayerName
+ , const DbU::Unit pitch
+ , const DbU::Unit sliceHeight
+ , const DbU::Unit sliceStep
+ ) : _name(name)
+ , _pinLayerName(pinLayerName)
+ , _pitch(pitch)
+ , _sliceHeight(sliceHeight)
+ , _sliceStep(sliceStep)
+ { }
+
+
+ CellGauge* CellGauge::create ( const char* name
+ , const char* pinLayerName
+ , const DbU::Unit pitch
+ , const DbU::Unit sliceHeight
+ , const DbU::Unit sliceStep
+ )
+ {
+ if ( !name || (name[0] == '\0') )
+ throw Error ( "CellGauge::create() : Empty name." );
+
+ CellGauge* gauge = new CellGauge ( name, pinLayerName, pitch, sliceHeight, sliceStep );
+
+ if ( gauge == NULL )
+ throw Error ( BadCreate, "CRL::CellGauge::create()" );
+
+ return gauge;
+ }
+
+
+ CellGauge::~CellGauge()
+ { }
+
+
+ void CellGauge::destroy ()
+ { delete this; }
+
+
+ string CellGauge::_getTypeName () const
+ { return _TName("CellGauge"); }
+
+
+ string CellGauge::_getString () const
+ {
+ return ( "<" + _TName("CellGauge ")
+ + getString(_name)
+ //+ " pinLayerName=" + getString(_pinLayerName)
+ //+ " pitch=" + getValueString(_pitch)
+ //+ " height=" + getValueString(_sliceHeight)
+ //+ " step=" + getValueString(_sliceStep)
+ + ">" );
+ }
+
+
+ Record* CellGauge::_getRecord () const
+ {
+ Record* record = new Record ( getString(this) );
+ record->add ( getSlot ( "Name" , &_name ) );
+ record->add ( getSlot ( "PinLayerName" , &_pinLayerName) );
+ record->add ( getSlot ( "pitch" , _pitch ) );
+ record->add ( getSlot ( "sliceHeight" , _sliceHeight ) );
+ record->add ( getSlot ( "sliceStep" , _sliceStep ) );
+ return ( record );
+ }
+
+
+} // End of CRL namespace.
diff --git a/crlcore/src/ccore/CifDriver.cpp b/crlcore/src/ccore/CifDriver.cpp
new file mode 100644
index 00000000..03b71c96
--- /dev/null
+++ b/crlcore/src/ccore/CifDriver.cpp
@@ -0,0 +1,18 @@
+// author : Damien Dupuis
+// date : 24.02.2010
+// -*- C++ -*-
+
+#include "hurricane/Cell.h"
+using namespace Hurricane;
+
+#include "crlcore/CifDriver.h"
+#include "cif/Cif.h"
+
+namespace CRL {
+ CifDriver::CifDriver(Cell* cell) : _cell(cell), _name(""), _units(""), _scale(0) {}
+
+ bool CifDriver::save(const string& filePath) {
+ CRL::cifDriver(filePath, _cell, _name, _units, _scale);
+ return true;
+ }
+}// namespace CRL
diff --git a/crlcore/src/ccore/Environment.cpp b/crlcore/src/ccore/Environment.cpp
new file mode 100644
index 00000000..921b647a
--- /dev/null
+++ b/crlcore/src/ccore/Environment.cpp
@@ -0,0 +1,716 @@
+
+// -*- C++ -*-
+//
+// This file is part of the Coriolis Software.
+// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
+//
+// ===================================================================
+//
+// $Id$
+//
+// x-----------------------------------------------------------------x
+// | |
+// | C O R I O L I S |
+// | Alliance / Hurricane Interface |
+// | |
+// | Author : Jean-Paul CHAPUT |
+// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
+// | =============================================================== |
+// | C++ Module : "./Environnment.h" |
+// | *************************************************************** |
+// | U p d a t e s |
+// | |
+// x-----------------------------------------------------------------x
+
+
+#include
+#include
+#include