cmake: Make HeAP placer always-enabled

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2023-03-17 09:27:36 +01:00 committed by myrtle
parent 4111cc25d6
commit e4fcd3740d
12 changed files with 12 additions and 102 deletions

View File

@ -14,7 +14,6 @@ check_ipo_supported(RESULT ipo_supported)
option(BUILD_GUI "Build GUI" OFF) option(BUILD_GUI "Build GUI" OFF)
option(BUILD_PYTHON "Build Python Integration" ON) option(BUILD_PYTHON "Build Python Integration" ON)
option(BUILD_TESTS "Build tests" OFF) option(BUILD_TESTS "Build tests" OFF)
option(BUILD_HEAP "Build HeAP analytic placer" ON)
option(USE_OPENMP "Use OpenMP to accelerate analytic placer" OFF) option(USE_OPENMP "Use OpenMP to accelerate analytic placer" OFF)
option(COVERAGE "Add code coverage info" OFF) option(COVERAGE "Add code coverage info" OFF)
option(STATIC_BUILD "Create static build" OFF) option(STATIC_BUILD "Create static build" OFF)
@ -230,11 +229,8 @@ endif()
include_directories(common/kernel/ common/place/ common/route/ json/ frontend/ 3rdparty/json11/ ${PYBIND11_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) include_directories(common/kernel/ common/place/ common/route/ json/ frontend/ 3rdparty/json11/ ${PYBIND11_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS})
if(BUILD_HEAP) find_package (Eigen3 REQUIRED NO_MODULE)
find_package (Eigen3 REQUIRED NO_MODULE) link_libraries(Eigen3::Eigen)
link_libraries(Eigen3::Eigen)
add_definitions(-DWITH_HEAP)
endif()
aux_source_directory(common/kernel/ KERNEL_SRC_FILES) aux_source_directory(common/kernel/ KERNEL_SRC_FILES)
aux_source_directory(common/place/ PLACE_SRC_FILES) aux_source_directory(common/place/ PLACE_SRC_FILES)

View File

@ -195,7 +195,7 @@ Additional notes for building nextpnr
The following runs a debug build of the iCE40 architecture without GUI, without Python support, without the HeAP analytic placer and only HX1K support: The following runs a debug build of the iCE40 architecture without GUI, without Python support, without the HeAP analytic placer and only HX1K support:
``` ```
cmake . -DARCH=ice40 -DCMAKE_BUILD_TYPE=Debug -DBUILD_PYTHON=OFF -DBUILD_HEAP=OFF -DICE40_HX1K_ONLY=1 cmake . -DARCH=ice40 -DCMAKE_BUILD_TYPE=Debug -DBUILD_PYTHON=OFF -DICE40_HX1K_ONLY=1
make -j$(nproc) make -j$(nproc)
``` ```

View File

@ -31,8 +31,6 @@
* - To make the placer timing-driven, the bound2bound weights are multiplied by (1 + 10 * crit^2) * - To make the placer timing-driven, the bound2bound weights are multiplied by (1 + 10 * crit^2)
*/ */
#ifdef WITH_HEAP
#include "placer_heap.h" #include "placer_heap.h"
#include <Eigen/Core> #include <Eigen/Core>
#include <Eigen/IterativeLinearSolvers> #include <Eigen/IterativeLinearSolvers>
@ -1842,22 +1840,3 @@ PlacerHeapCfg::PlacerHeapCfg(Context *ctx)
} }
NEXTPNR_NAMESPACE_END NEXTPNR_NAMESPACE_END
#else
#include "log.h"
#include "nextpnr.h"
#include "placer_heap.h"
NEXTPNR_NAMESPACE_BEGIN
bool placer_heap(Context *ctx, PlacerHeapCfg cfg)
{
log_error("nextpnr was built without the HeAP placer\n");
return false;
}
PlacerHeapCfg::PlacerHeapCfg(Context *ctx) {}
NEXTPNR_NAMESPACE_END
#endif

View File

@ -1238,17 +1238,9 @@ WireId Arch::get_bank_eclk(int bank, int eclk)
return get_wire_by_loc_basename(Location(0, 0), "G_BANK" + std::to_string(bank) + "ECLK" + std::to_string(eclk)); return get_wire_by_loc_basename(Location(0, 0), "G_BANK" + std::to_string(bank) + "ECLK" + std::to_string(eclk));
} }
#ifdef WITH_HEAP
const std::string Arch::defaultPlacer = "heap"; const std::string Arch::defaultPlacer = "heap";
#else
const std::string Arch::defaultPlacer = "sa";
#endif
const std::vector<std::string> Arch::availablePlacers = {"sa", const std::vector<std::string> Arch::availablePlacers = {"sa", "heap"};
#ifdef WITH_HEAP
"heap"
#endif
};
const std::string Arch::defaultRouter = "router1"; const std::string Arch::defaultRouter = "router1";
const std::vector<std::string> Arch::availableRouters = {"router1", "router2"}; const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};

View File

@ -1116,17 +1116,9 @@ std::string Arch::get_part() const
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#ifdef WITH_HEAP
const std::string Arch::defaultPlacer = "heap"; const std::string Arch::defaultPlacer = "heap";
#else
const std::string Arch::defaultPlacer = "sa";
#endif
const std::vector<std::string> Arch::availablePlacers = {"sa", const std::vector<std::string> Arch::availablePlacers = {"sa", "heap"};
#ifdef WITH_HEAP
"heap"
#endif
};
const std::string Arch::defaultRouter = "router2"; const std::string Arch::defaultRouter = "router2";
const std::vector<std::string> Arch::availableRouters = {"router1", "router2"}; const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};

View File

@ -707,17 +707,9 @@ bool Arch::isBelLocationValid(BelId bel, bool explain_invalid) const
return cellsCompatible(cells.data(), int(cells.size())); return cellsCompatible(cells.data(), int(cells.size()));
} }
#ifdef WITH_HEAP
const std::string Arch::defaultPlacer = "heap"; const std::string Arch::defaultPlacer = "heap";
#else
const std::string Arch::defaultPlacer = "sa";
#endif
const std::vector<std::string> Arch::availablePlacers = {"sa", const std::vector<std::string> Arch::availablePlacers = {"sa", "heap"};
#ifdef WITH_HEAP
"heap"
#endif
};
const std::string Arch::defaultRouter = "router1"; const std::string Arch::defaultRouter = "router1";
const std::vector<std::string> Arch::availableRouters = {"router1", "router2"}; const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};

View File

@ -2341,17 +2341,9 @@ bool Arch::isBelLocationValid(BelId bel, bool explain_invalid) const
return cellsCompatible(cells.data(), int(cells.size())); return cellsCompatible(cells.data(), int(cells.size()));
} }
#ifdef WITH_HEAP
const std::string Arch::defaultPlacer = "heap"; const std::string Arch::defaultPlacer = "heap";
#else
const std::string Arch::defaultPlacer = "sa";
#endif
const std::vector<std::string> Arch::availablePlacers = {"sa", const std::vector<std::string> Arch::availablePlacers = {"sa", "heap"};
#ifdef WITH_HEAP
"heap"
#endif
};
const std::string Arch::defaultRouter = "router1"; const std::string Arch::defaultRouter = "router1";
const std::vector<std::string> Arch::availableRouters = {"router1", "router2"}; const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};

View File

@ -1289,17 +1289,9 @@ BoundingBox Arch::getRouteBoundingBox(WireId src, WireId dst) const
return bb; return bb;
} }
#ifdef WITH_HEAP
const std::string Arch::defaultPlacer = "heap"; const std::string Arch::defaultPlacer = "heap";
#else
const std::string Arch::defaultPlacer = "sa";
#endif
const std::vector<std::string> Arch::availablePlacers = {"sa", const std::vector<std::string> Arch::availablePlacers = {"sa", "heap"};
#ifdef WITH_HEAP
"heap"
#endif
};
const std::string Arch::defaultRouter = "router1"; const std::string Arch::defaultRouter = "router1";
const std::vector<std::string> Arch::availableRouters = {"router1", "router2"}; const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};

View File

@ -81,7 +81,7 @@ git clone git@github.com:cr1901/nextpnr.git
cd nextpnr cd nextpnr
git checkout machxo2 git checkout machxo2
git submodule update --init --recursive git submodule update --init --recursive
cmake . -DARCH=machxo2 -DBUILD_GUI=OFF -DTRELLIS_INSTALL_PREFIX=/usr -DBUILD_PYTHON=OFF -DBUILD_HEAP=OFF cmake . -DARCH=machxo2 -DBUILD_GUI=OFF -DTRELLIS_INSTALL_PREFIX=/usr -DBUILD_PYTHON=OFF
make make
``` ```

View File

@ -486,17 +486,9 @@ bool Arch::isBelLocationValid(BelId bel, bool explain_invalid) const
return true; return true;
} }
#ifdef WITH_HEAP
const std::string Arch::defaultPlacer = "heap"; const std::string Arch::defaultPlacer = "heap";
#else
const std::string Arch::defaultPlacer = "sa";
#endif
const std::vector<std::string> Arch::availablePlacers = {"sa", const std::vector<std::string> Arch::availablePlacers = {"sa", "heap"};
#ifdef WITH_HEAP
"heap"
#endif
};
const std::string Arch::defaultRouter = "router1"; const std::string Arch::defaultRouter = "router1";
const std::vector<std::string> Arch::availableRouters = {"router1", "router2"}; const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};

View File

@ -499,17 +499,9 @@ bool Arch::route()
return result; return result;
} }
#ifdef WITH_HEAP
const std::string Arch::defaultPlacer = "heap"; const std::string Arch::defaultPlacer = "heap";
#else
const std::string Arch::defaultPlacer = "sa";
#endif
const std::vector<std::string> Arch::availablePlacers = {"sa", const std::vector<std::string> Arch::availablePlacers = {"sa", "heap"};
#ifdef WITH_HEAP
"heap"
#endif
};
const std::string Arch::defaultRouter = "router2"; const std::string Arch::defaultRouter = "router2";
const std::vector<std::string> Arch::availableRouters = {"router1", "router2"}; const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};

View File

@ -1122,18 +1122,9 @@ bool Arch::getClusterPlacement(ClusterId cluster, BelId root_bel,
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#ifdef WITH_HEAP
const std::string Arch::defaultPlacer = "heap"; const std::string Arch::defaultPlacer = "heap";
#else
const std::string Arch::defaultPlacer = "sa";
#endif
const std::vector<std::string> Arch::availablePlacers = {"sa", const std::vector<std::string> Arch::availablePlacers = {"sa", "heap"};
#ifdef WITH_HEAP
"heap"
#endif
};
const std::string Arch::defaultRouter = "router2"; const std::string Arch::defaultRouter = "router2";
const std::vector<std::string> Arch::availableRouters = {"router1", "router2"}; const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};