diff --git a/nimbus/CMakeLists.txt b/nimbus/CMakeLists.txt index 92d6f987..44833376 100644 --- a/nimbus/CMakeLists.txt +++ b/nimbus/CMakeLists.txt @@ -13,6 +13,8 @@ setup_boost(program_options filesystem python regex) find_package(Qt4 REQUIRED) + find_package(PythonLibs REQUIRED) + find_package(PythonSitePackages REQUIRED) find_package(VLSISAPD REQUIRED) find_package(HURRICANE REQUIRED) find_package(CORIOLIS REQUIRED) diff --git a/nimbus/src/CMakeLists.txt b/nimbus/src/CMakeLists.txt index a157aaf2..c1dcb84d 100644 --- a/nimbus/src/CMakeLists.txt +++ b/nimbus/src/CMakeLists.txt @@ -6,53 +6,71 @@ ${CORIOLIS_INCLUDE_DIR} ${CONFIGURATION_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} + ${PYTHON_INCLUDE_PATH} ) - set ( includes nimbus/Configuration.h - nimbus/SplitterContact.h nimbus/SplitterContacts.h - nimbus/Splitter.h nimbus/Splitters.h - nimbus/Fence.h nimbus/Fences.h - nimbus/HFence.h - nimbus/VFence.h - nimbus/FrontLine.h - nimbus/FenceProperty.h - nimbus/StepProperty.h - nimbus/GCell.h nimbus/GCells.h - nimbus/Grid.h - nimbus/NimbusEngine.h - nimbus/RoutTools.h + set ( includes nimbus/Configuration.h + nimbus/SplitterContact.h nimbus/SplitterContacts.h + nimbus/Splitter.h nimbus/Splitters.h + nimbus/Fence.h nimbus/Fences.h + nimbus/HFence.h + nimbus/VFence.h + nimbus/FrontLine.h + nimbus/FenceProperty.h + nimbus/StepProperty.h + nimbus/GCell.h nimbus/GCells.h + nimbus/Grid.h + nimbus/NimbusEngine.h + nimbus/RoutTools.h ) - set ( cpps Configuration.cpp - SplitterContact.cpp - Splitter.cpp - Fence.cpp - FenceProperty.cpp - HFence.cpp - VFence.cpp - FrontLine.cpp - GCell.cpp - Grid.cpp - StepProperty.cpp - NimbusEngine.cpp - RoutTools.cpp + set ( pyIncludes nimbus/PyNimbusEngine.h + ) + set ( cpps Configuration.cpp + SplitterContact.cpp + Splitter.cpp + Fence.cpp + FenceProperty.cpp + HFence.cpp + VFence.cpp + FrontLine.cpp + GCell.cpp + Grid.cpp + StepProperty.cpp + NimbusEngine.cpp + RoutTools.cpp + ) + set ( pyCpps PyNimbus.cpp + PyNimbusEngine.cpp ) - add_library ( nimbus ${cpps} ) - set_target_properties ( nimbus PROPERTIES VERSION 1.0 SOVERSION 1 ) - target_link_libraries ( nimbus ${CORIOLIS_LIBRARIES} - ${HURRICANE_PYTHON_LIBRARIES} - ${HURRICANE_GRAPHICAL_LIBRARIES} - ${HURRICANE_LIBRARIES} - ${CONFIGURATION_LIBRARY} - ${CIF_LIBRARY} - ${AGDS_LIBRARY} - ${LEFDEF_LIBRARIES} - ${OA_LIBRARIES} - ${QT_LIBRARIES} - ${Boost_LIBRARIES} - ${LIBXML2_LIBRARIES} - ${PYTHON_LIBRARIES} -lutil + add_library ( nimbus ${cpps} ${pyCpps} ) + set_target_properties ( nimbus PROPERTIES VERSION 1.0 SOVERSION 1 ) + target_link_libraries ( nimbus ${CORIOLIS_LIBRARIES} + ${HURRICANE_PYTHON_LIBRARIES} + ${HURRICANE_GRAPHICAL_LIBRARIES} + ${HURRICANE_LIBRARIES} + ${CONFIGURATION_LIBRARY} + ${CIF_LIBRARY} + ${AGDS_LIBRARY} + ${LEFDEF_LIBRARIES} + ${OA_LIBRARIES} + ${QT_LIBRARIES} + ${Boost_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${PYTHON_LIBRARIES} -lutil ) - install ( TARGETS nimbus DESTINATION lib${LIB_SUFFIX} ) - install ( FILES ${includes} DESTINATION include/coriolis2/nimbus ) + + add_library ( pyNimbus MODULE ${pyCpps} ) + set_target_properties ( pyNimbus PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -D__PYTHON_MODULE__=1" + PREFIX "" + OUTPUT_NAME "Nimbus" + ) + target_link_libraries ( pyNimbus nimbus + ${CORIOLIS_PYTHON_LIBRARIES} + ) + + install ( TARGETS nimbus DESTINATION lib${LIB_SUFFIX} ) + install ( TARGETS pyNimbus DESTINATION ${PYTHON_SITE_PACKAGES} ) + install ( FILES ${includes} + ${pyIncludes} DESTINATION include/coriolis2/nimbus ) diff --git a/nimbus/src/nimbus/NimbusEngine.h b/nimbus/src/nimbus/NimbusEngine.h index 1b722416..16a90794 100644 --- a/nimbus/src/nimbus/NimbusEngine.h +++ b/nimbus/src/nimbus/NimbusEngine.h @@ -57,27 +57,29 @@ class NimbusEngine : public ToolEngine { // Constructors // ************ - private: NimbusEngine (Cell* cell, const Box& workzone); - - public: static void _preCreate(Cell*); - public: static NimbusEngine* create (Cell* cell, const Box& workZone=Box()); + private: + NimbusEngine (Cell* cell, const Box& workzone); + public: + static NimbusEngine* create (Cell* cell, const Box& workZone=Box()); + static void _preCreate (Cell*); // Accessors // ********* public: - virtual const Name& getName () const; - static const Name& staticGetName (); - static NimbusEngine* get ( Cell* ); - inline Configuration* getConfiguration (); - inline bool doPinsPlacement () const; - inline double getAspectRatio () const; - inline double getMargin () const; - inline const Box& getWorkZone () const; - inline DbU::Unit getPitch () const; - inline DbU::Unit getSliceHeight () const; - inline DbU::Unit getSliceStep () const; + virtual const Name& getName () const; + static const Name& staticGetName (); + static NimbusEngine* get ( Cell* ); + inline Configuration* getConfiguration (); + inline void printConfiguration () const; + inline bool doPinsPlacement () const; + inline double getAspectRatio () const; + inline double getMargin () const; + inline const Box& getWorkZone () const; + inline DbU::Unit getPitch () const; + inline DbU::Unit getSliceHeight () const; + inline DbU::Unit getSliceStep () const; inline const std::vector& - getLayerGauges () const; + getLayerGauges () const; public: Grid* getGrid() { return _grid; }; public: unsigned getDepth() { return _depth; }; @@ -164,16 +166,17 @@ class NimbusEngine : public ToolEngine { }; - inline Configuration* NimbusEngine::getConfiguration () { return _configuration; } - inline bool NimbusEngine::doPinsPlacement () const { return _configuration->doPinsPlacement(); } - inline double NimbusEngine::getAspectRatio () const { return _configuration->getAspectRatio(); } - inline double NimbusEngine::getMargin () const { return _configuration->getMargin(); } - inline const Box& NimbusEngine::getWorkZone () const { return _configuration->getWorkZone(); } - inline DbU::Unit NimbusEngine::getPitch () const { return _configuration->getPitch(); } - inline DbU::Unit NimbusEngine::getSliceHeight () const { return _configuration->getSliceHeight(); } - inline DbU::Unit NimbusEngine::getSliceStep () const { return _configuration->getSliceStep(); } - inline const std::vector& - NimbusEngine::getLayerGauges () const { return _configuration->getLayerGauges(); } + inline Configuration* NimbusEngine::getConfiguration () { return _configuration; } + inline void NimbusEngine::printConfiguration () const { _configuration->print(getCell()); } + inline bool NimbusEngine::doPinsPlacement () const { return _configuration->doPinsPlacement(); } + inline double NimbusEngine::getAspectRatio () const { return _configuration->getAspectRatio(); } + inline double NimbusEngine::getMargin () const { return _configuration->getMargin(); } + inline const Box& NimbusEngine::getWorkZone () const { return _configuration->getWorkZone(); } + inline DbU::Unit NimbusEngine::getPitch () const { return _configuration->getPitch(); } + inline DbU::Unit NimbusEngine::getSliceHeight () const { return _configuration->getSliceHeight(); } + inline DbU::Unit NimbusEngine::getSliceStep () const { return _configuration->getSliceStep(); } + inline const std::vector& + NimbusEngine::getLayerGauges () const { return _configuration->getLayerGauges(); } } // namespace Nimbus