Added Python for FLUTE (for fast RSMT in HFNS).

* New: In flute, added a Python binding. Contains two methods: "readLUT()",
    to load the POWV9.dat and POST9.dat and "flute()" to build a RSMT.
    "flute()" takes a tuple of positions (themselves 2-uple) like:
        ( (x0,y0), (x1,y1,), ... (xN,yM) )
    and returns a tuple of 3-uple of branches:
        ( (n0,x0,y0), (n1,x1,y1), ... )
    In "flute.h", set the distance type (DTYPE) to int64_t to always
    accomodate DbU::Unit.
      As it now uses the Hurricane Python interface and the path utilities
    from CRL Core, move it's compilation *after* them (see build.conf in
    bootstrap).
This commit is contained in:
Jean-Paul Chaput 2020-09-30 11:52:22 +02:00
parent ea94175eb4
commit 18405599e8
6 changed files with 61 additions and 36 deletions

View File

@ -14,11 +14,11 @@ projects = [
, { 'name' : "coriolis" , { 'name' : "coriolis"
, 'tools' : [ "bootstrap" , 'tools' : [ "bootstrap"
, "lefdef" , "lefdef"
, "flute"
, "coloquinte" , "coloquinte"
, "vlsisapd" , "vlsisapd"
, "hurricane" , "hurricane"
, "crlcore" , "crlcore"
, "flute"
, "etesian" , "etesian"
, "anabatic" , "anabatic"
, "katana" , "katana"

View File

@ -16,5 +16,11 @@
check_distribution() check_distribution()
setup_sysconfdir( "${CMAKE_INSTALL_PREFIX}" ) setup_sysconfdir( "${CMAKE_INSTALL_PREFIX}" )
find_package(PythonLibs 2 REQUIRED)
find_package(PythonSitePackages REQUIRED)
find_package(VLSISAPD REQUIRED)
find_package(HURRICANE REQUIRED)
find_package(CORIOLIS REQUIRED)
add_subdirectory( src ) add_subdirectory( src )
add_subdirectory( cmake_modules ) add_subdirectory( cmake_modules )

View File

@ -1,31 +1,50 @@
# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt<flute/src/3.1>" -*- # -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt<flute/src/3.1>" -*-
include_directories ( ${FLUTE_SOURCE_DIR}/src/3.1 include_directories( ${FLUTE_SOURCE_DIR}/src/3.1
) ${CORIOLIS_LIBRARIES}
${HURRICANE_INCLUDE_DIR}
${CONFIGURATION_INCLUDE_DIR}
${PYTHON_INCLUDE_PATH}
)
set ( includes flute.h set( includes flute.h
dl.h dl.h
mst2.h mst2.h
err.h err.h
heap.h heap.h
dist.h dist.h
global.h global.h
neighbors.h neighbors.h
) )
set ( cpps flute.cpp set( cpps flute.cpp
flute_mst.cpp flute_mst.cpp
dist.cpp dist.cpp
dl.cpp dl.cpp
err.cpp err.cpp
mst2.cpp mst2.cpp
heap.cpp heap.cpp
neighbors.cpp neighbors.cpp
) )
add_library( flute ${cpps} )
set_target_properties( flute PROPERTIES VERSION 3.1 SOVERSION 3 )
set( pyCpps PyFlute.cpp )
set( depLibs flute
${CORIOLIS_LIBRARIES}
${HURRICANE_PYTHON_LIBRARIES}
${UTILITIES_LIBRARY}
${PYTHON_LIBRARIES}
-lutil
)
add_library ( flute ${cpps} ) add_python_module( "${pyCpps}"
set_target_properties ( flute PROPERTIES VERSION 3.1 SOVERSION 3 ) None
"pyflute;1.0;1"
Flute
"${depLibs}"
include/coriolis2/flute
)
install ( TARGETS flute DESTINATION lib${LIB_SUFFIX} ) install( TARGETS flute DESTINATION lib${LIB_SUFFIX} )
install ( FILES ${includes} DESTINATION include/flute/3.1 ) install( FILES ${includes} DESTINATION include/flute/3.1 )
install ( FILES POST9.dat install( FILES POST9.dat
POWV9.dat DESTINATION share/flute/3.1 ) POWV9.dat DESTINATION share/flute/3.1 )

View File

@ -19,7 +19,7 @@ namespace Flute {
#define REMOVE_DUPLICATE_PIN 0 // Remove dup. pin for flute_wl() & flute() #define REMOVE_DUPLICATE_PIN 0 // Remove dup. pin for flute_wl() & flute()
#ifndef DTYPE // Data type for distance #ifndef DTYPE // Data type for distance
#define DTYPE int #define DTYPE int64_t
#endif #endif

View File

@ -446,9 +446,9 @@ namespace Katana {
updateEstimateDensityOfPath( this, targets[0], targets[1], weight ); updateEstimateDensityOfPath( this, targets[0], targets[1], weight );
return; return;
default: default:
{ int accuracy = 3; { int accuracy = 3;
int* xs = new int [targets.size()]; int64_t* xs = new int64_t [targets.size()];
int* ys = new int [targets.size()]; int64_t* ys = new int64_t [targets.size()];
for ( size_t itarget=0 ; itarget<targets.size() ; ++itarget ) { for ( size_t itarget=0 ; itarget<targets.size() ; ++itarget ) {
Point center = targets[itarget]->getCenter(); Point center = targets[itarget]->getCenter();

View File

@ -1528,11 +1528,11 @@ void Graph::Monotonic()
Tree* Graph::createFluteTree() Tree* Graph::createFluteTree()
// **************************** // ****************************
{ {
int accuracy = 3; // accuracy for flute (by default 3) int accuracy = 3; // accuracy for flute (by default 3)
int d = _vertexes_to_route.size(); // degre du net, ie nombre de routingPads int d = _vertexes_to_route.size(); // degre du net, ie nombre de routingPads
int *x = new int [d]; // x coordinates of the vertexes int64_t *x = new int64_t [d]; // x coordinates of the vertexes
int *y = new int [d]; // y coordinates of the vertexes int64_t *y = new int64_t [d]; // y coordinates of the vertexes
Tree* flutetree = new Tree; // the flute Steiner Tree Tree* flutetree = new Tree; // the flute Steiner Tree
//cout << "Net : " << _working_net << endl; //cout << "Net : " << _working_net << endl;
// scans _working_net to find x,y coordinates and fill x, y and d // scans _working_net to find x,y coordinates and fill x, y and d