Make FLUTE an independant tool in the Coriolis git repository.

* Change: To allow multiple tools, and not only Knik, to link and use
    FLUTE, remove it from Knik and put it at top level.
      Bootsrap must compile this new tool and the library must be
    included in all CMakeLists.txt depending on Knik (and soon
    Anabatic).
This commit is contained in:
Jean-Paul Chaput 2019-02-12 12:48:52 +01:00
parent ea4fdfd230
commit 6fd383ad51
16 changed files with 35 additions and 43 deletions

View File

@ -14,6 +14,7 @@ projects = [
, { 'name' : "coriolis"
, 'tools' : [ "bootstrap"
, "lefdef"
, "flute"
, "vlsisapd"
, "hurricane"
, "crlcore"

View File

@ -85,8 +85,8 @@
set(ADDTIONAL_FLAGS "")
set(CXX_STANDARD "c++11")
endif()
set(CMAKE_C_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE)
set(CMAKE_C_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE)
set(CMAKE_C_FLAGS_DEBUG " -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE)
set(CMAKE_C_FLAGS_RELEASE " -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE)

View File

@ -23,6 +23,7 @@
find_package(PythonSitePackages REQUIRED)
find_package(LEFDEF REQUIRED)
find_package(VLSISAPD REQUIRED)
find_package(FLUTE REQUIRED)
find_package(HURRICANE REQUIRED)
find_package(CORIOLIS REQUIRED)
find_package(ANABATIC REQUIRED)

View File

@ -85,6 +85,7 @@
${CONFIGURATION_LIBRARY}
${CIF_LIBRARY}
${AGDS_LIBRARY}
${FLUTE_LIBRARIES}
${LEFDEF_LIBRARIES}
${OA_LIBRARIES}
${QWT_LIBRARY}

View File

@ -18,6 +18,7 @@
find_package(PythonLibs 2 REQUIRED)
find_package(PythonSitePackages REQUIRED)
find_package(FLUTE REQUIRED)
find_package(VLSISAPD REQUIRED)
find_package(HURRICANE REQUIRED)
find_package(CORIOLIS REQUIRED)

View File

@ -23,6 +23,7 @@
find_package(PythonLibs 2 REQUIRED)
find_package(PythonSitePackages REQUIRED)
find_package(LEFDEF REQUIRED)
find_package(FLUTE REQUIRED)
find_package(VLSISAPD REQUIRED)
find_package(HURRICANE REQUIRED)
find_package(CORIOLIS REQUIRED)

View File

@ -95,6 +95,7 @@
${CIF_LIBRARY}
${AGDS_LIBRARY}
${UTILITIES_LIBRARY}
${FLUTE_LIBRARIES}
${LEFDEF_LIBRARIES}
${OA_LIBRARIES}
${QtX_LIBRARIES}

View File

@ -19,6 +19,7 @@
find_package(LibXml2 REQUIRED)
find_package(PythonLibs 2 REQUIRED)
find_package(PythonSitePackages REQUIRED)
find_package(FLUTE REQUIRED)
find_package(VLSISAPD REQUIRED)
find_package(LEFDEF REQUIRED)
find_package(HURRICANE REQUIRED)

View File

@ -5,6 +5,7 @@
${CORIOLIS_INCLUDE_DIR}
${HURRICANE_INCLUDE_DIR}
${CONFIGURATION_INCLUDE_DIR}
${FLUTE_INCLUDE_DIR}
${WtX_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_PATH}
@ -85,6 +86,7 @@
${CIF_LIBRARY}
${AGDS_LIBRARY}
${UTILITIES_LIBRARY}
${FLUTE_LIBRARIES}
${LEFDEF_LIBRARIES}
${OA_LIBRARIES}
${QtX_LIBRARIES}

View File

@ -16,9 +16,10 @@
setup_boost(program_options filesystem python regex)
setup_qt()
find_package(VLSISAPD REQUIRED)
find_package(FLUTE REQUIRED)
find_package(VLSISAPD REQUIRED)
find_package(HURRICANE REQUIRED)
find_package(CORIOLIS REQUIRED)
find_package(CORIOLIS REQUIRED)
add_subdirectory(src)
add_subdirectory(cmake_modules)

View File

@ -3,6 +3,7 @@
# include ( ${QT_USE_FILE} )
include_directories ( ${KNIK_SOURCE_DIR}/src
${KNIK_SOURCE_DIR}/src/flute-3.1/src
${FLUTE_INCLUDE_DIR}
${HURRICANE_INCLUDE_DIR}
${CORIOLIS_INCLUDE_DIR}
${UTILITIES_INCLUDE_DIR}
@ -39,35 +40,12 @@
KnikEngine.cpp
GraphicKnikEngine.cpp
)
set ( fluteIncludes flute-3.1/src/knik/flute.h
flute-3.1/src/knik/dl.h
flute-3.1/src/knik/mst2.h
flute-3.1/src/knik/err.h
flute-3.1/src/knik/heap.h
flute-3.1/src/knik/dist.h
flute-3.1/src/knik/global.h
flute-3.1/src/knik/neighbors.h
)
set ( fluteCpps flute-3.1/src/flute.cpp
flute-3.1/src/flute_mst.cpp
flute-3.1/src/dist.cpp
flute-3.1/src/dl.cpp
flute-3.1/src/err.cpp
flute-3.1/src/mst2.cpp
flute-3.1/src/heap.cpp
flute-3.1/src/neighbors.cpp
)
qtX_wrap_cpp ( mocCpps ${mocIncludes} )
add_library ( flute ${fluteCpps} )
set_target_properties ( flute PROPERTIES VERSION 3.1 SOVERSION 3 )
target_link_libraries ( flute ${HURRICANE_LIBRARIES}
${CORIOLIS_LIBRARIES}
)
add_library ( knik ${cpps} ${mocCpps} )
set_target_properties ( knik PROPERTIES VERSION 1.0 SOVERSION 1 )
target_link_libraries ( knik flute
target_link_libraries ( knik ${FLUTE_LIBRARY}
${HURRICANE_PYTHON_LIBRARIES}
${HURRICANE_GRAPHICAL_LIBRARIES}
${HURRICANE_LIBRARIES}
@ -83,9 +61,6 @@
${PYTHON_LIBRARIES} -lutil
)
install ( TARGETS knik flute DESTINATION lib${LIB_SUFFIX} )
install ( TARGETS knik DESTINATION lib${LIB_SUFFIX} )
install ( FILES ${includes}
${mocIncludes}
${fluteIncludes} DESTINATION include/coriolis2/knik )
install ( FILES flute-3.1/etc/POST9.dat
flute-3.1/etc/POWV9.dat DESTINATION share/coriolis2/flute-3.1 )
${mocIncludes} DESTINATION include/coriolis2/knik )

View File

@ -4,6 +4,8 @@
#include <algorithm>
#include <memory>
#include "flute.h"
#include "hurricane/DebugSession.h"
#include "hurricane/Warning.h"
#include "hurricane/Error.h"
@ -33,7 +35,6 @@
#include "knik/VEdge.h"
#include "knik/KnikEngine.h"
#include "knik/flute.h"
//#define __USE_SLICINGTREE__
#define __USE_MATRIXVERTEX__
@ -1524,14 +1525,14 @@ void Graph::Monotonic()
//#endif
}
FTree* Graph::createFluteTree()
Tree* Graph::createFluteTree()
// ****************************
{
int accuracy = 3; // accuracy for flute (by default 3)
int d = _vertexes_to_route.size(); // degre du net, ie nombre de routingPads
int *x = new int [d]; // x coordinates of the vertexes
int *y = new int [d]; // y coordinates of the vertexes
FTree* flutetree = new FTree; // the flute Steiner Tree
Tree* flutetree = new Tree; // the flute Steiner Tree
//cout << "Net : " << _working_net << endl;
// scans _working_net to find x,y coordinates and fill x, y and d
@ -1548,7 +1549,7 @@ FTree* Graph::createFluteTree()
assert ( d == cpt );
*flutetree = flute ( d, x, y, accuracy );
*flutetree = Flute::flute ( d, x, y, accuracy );
//printtree ( flutetree );
//plottree ( flutetree );
//cout << endl;
@ -1561,9 +1562,9 @@ void Graph::UpdateEstimateCongestion ( bool create )
if ( _vertexes_to_route.size() < 2 )
return;
//cerr << "Running FLUTE for net : " << _working_net << endl;
unique_ptr<FTree> flutetree ( createFluteTree() );
unique_ptr<Tree> flutetree ( createFluteTree() );
//parcours des branches du FTree pour créer la congestion estimée
//parcours des branches du Tree pour créer la congestion estimée
for ( int i = 0 ; i < 2*flutetree->deg-2 ; i++ ) {
// int sourceX = flutetree->branch[i].x;
// int sourceY = flutetree->branch[i].y;

View File

@ -15,6 +15,7 @@
#include <climits>
#include "flute.h"
#include "hurricane/Warning.h"
#include "hurricane/Property.h"
#include "hurricane/NetRoutingProperty.h"
@ -40,7 +41,6 @@
#include "knik/RoutingGrid.h"
#include "knik/NetExtension.h"
#include "knik/KnikEngine.h"
#include "knik/flute.h"
#define MAX_RUNTIME 86400
@ -134,7 +134,7 @@ void KnikEngine::_postCreate()
Inherit::_postCreate();
// For Flute : readLUT to be able to use POWV9.dat & POST9.dat
readLUT();
Flute::readLUT( AllianceFramework::get()->getEnvironment()->getCORIOLIS_TOP() );
return;
}

View File

@ -28,7 +28,11 @@
#include "knik/SlicingTree.h"
#include "knik/RoutingGrid.h"
struct FTree;
namespace Flute {
struct Tree;
}
using Flute::Tree;
namespace Knik {
@ -153,7 +157,7 @@ namespace Knik {
int initRouting ( Net* net );
void Dijkstra ();
void Monotonic ();
FTree* createFluteTree ();
Tree* createFluteTree ();
void CleanRoutingState ();
void UpdateEstimateCongestion ( bool create = false );
void UpdateMaxEstimateCongestion ();

View File

@ -20,6 +20,7 @@
find_package(PythonSitePackages REQUIRED)
find_package(LEFDEF REQUIRED)
find_package(COLOQUINTE)
find_package(FLUTE REQUIRED)
find_package(VLSISAPD REQUIRED)
find_package(HURRICANE REQUIRED)
find_package(CORIOLIS REQUIRED)

View File

@ -64,6 +64,7 @@
${UTILITIES_LIBRARY}
${CONFIGURATION_LIBRARY}
${COLOQUINTE_LIBRARIES}
${FLUTE_LIBRARIES}
${LEFDEF_LIBRARIES}
${OA_LIBRARIES}
${QtX_LIBRARIES}