diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8035b7e0834..aa6d003fe6b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -139,57 +139,68 @@ jobs: { name: 'Basic', params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on', - suite: 'vtr_reg_basic' + suite: 'vtr_reg_basic', + extra_pkgs: "" }, { name: 'Basic with highest assertion level', params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=4 -DWITH_BLIFEXPLORER=on', - suite: 'vtr_reg_basic' + suite: 'vtr_reg_basic', + extra_pkgs: "" }, { name: 'Basic_odin', params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_PARMYS=OFF -DWITH_ODIN=on', - suite: 'vtr_reg_basic_odin' + suite: 'vtr_reg_basic_odin', + extra_pkgs: "" }, { name: 'Basic with NO_GRAPHICS', params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=off', - suite: 'vtr_reg_basic' + suite: 'vtr_reg_basic', + extra_pkgs: "" }, { name: 'Basic with NO_SERVER', params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=on -DVPR_USE_SERVER=off', - suite: 'vtr_reg_basic' + suite: 'vtr_reg_basic', + extra_pkgs: "" }, { name: 'Basic with CAPNPROTO disabled', params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_CAPNPROTO=off', - suite: 'vtr_reg_basic' + suite: 'vtr_reg_basic', + extra_pkgs: "" }, { name: 'Basic with VTR_ENABLE_DEBUG_LOGGING', params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_DEBUG_LOGGING=on', - suite: 'vtr_reg_basic' + suite: 'vtr_reg_basic', + extra_pkgs: "" }, { name: 'Basic_odin with VTR_ENABLE_DEBUG_LOGGING', params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_DEBUG_LOGGING=on -DWITH_PARMYS=OFF -DWITH_ODIN=on', - suite: 'vtr_reg_basic_odin' + suite: 'vtr_reg_basic_odin', + extra_pkgs: "" }, { name: 'Strong', params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on', - suite: 'vtr_reg_strong' + suite: 'vtr_reg_strong', + extra_pkgs: "libeigen3-dev" }, { name: 'Strong_odin', params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_PARMYS=OFF -DWITH_ODIN=on', - suite: 'vtr_reg_strong_odin' + suite: 'vtr_reg_strong_odin', + extra_pkgs: "" }, { name: 'Valgrind Memory', params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_ODIN=on', - suite: 'vtr_reg_valgrind_small' + suite: 'vtr_reg_valgrind_small', + extra_pkgs: "" } ] name: 'R: ${{ matrix.name }}' @@ -198,10 +209,17 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.10.10 + - uses: actions/checkout@v4 with: submodules: 'true' - - run: ./.github/scripts/install_dependencies.sh + + - name: Install dependencies + run: ./.github/scripts/install_dependencies.sh + + - name: Install external libraries + run: sudo apt install -y ${{ matrix.extra_pkgs }} + if: ${{ matrix.extra_pkgs }} - uses: hendrikmuhs/ccache-action@v1.2 diff --git a/vpr/CMakeLists.txt b/vpr/CMakeLists.txt index 0cbaec216a6..4e3ccc0b12c 100644 --- a/vpr/CMakeLists.txt +++ b/vpr/CMakeLists.txt @@ -76,15 +76,27 @@ add_library(libvpr STATIC target_include_directories(libvpr PUBLIC ${LIB_INCLUDE_DIRS}) + +# Find if Eigen is installed. Eigen is used within the Analytical Solver of the +# Analytical Placement flow. If Eigen is not installed, certain solvers cannot +# be used. +find_package(Eigen3 3.3 NO_MODULE) +if (TARGET Eigen3::Eigen) + target_link_libraries (libvpr Eigen3::Eigen) + target_compile_definitions(libvpr PUBLIC -DEIGEN_INSTALLED) + message(STATUS "Eigen3: Found") +else () + message(STATUS "Eigen3: Not Found. Some features may be disabled.") +endif (TARGET Eigen3::Eigen) + #VPR_ANALYTIC_PLACE is initialized in the root CMakeLists -#Check Eigen dependency +# NOTE: This is the cluster-level Analytical Placement which existed before the +# flat Analytical Placement flow. if(${VPR_ANALYTIC_PLACE}) message(STATUS "VPR Analytic Placement: Requested") - find_package(Eigen3 3.3 NO_MODULE) if (TARGET Eigen3::Eigen) message(STATUS "VPR Analytic Placement dependency (Eigen3): Found") message(STATUS "VPR Analytic Placement: Enabled") - target_link_libraries (libvpr Eigen3::Eigen) target_compile_definitions(libvpr PUBLIC -DENABLE_ANALYTIC_PLACE) else () message(STATUS "VPR Analytic Placement dependency (Eigen3): Not Found (Download manually with sudo apt install libeigen3-dev, and rebuild)") diff --git a/vpr/src/analytical_place/analytical_solver.cpp b/vpr/src/analytical_place/analytical_solver.cpp index 730eea7ccda..c1bd982965c 100644 --- a/vpr/src/analytical_place/analytical_solver.cpp +++ b/vpr/src/analytical_place/analytical_solver.cpp @@ -7,11 +7,6 @@ */ #include "analytical_solver.h" -#include -#include -#include -#include -#include #include #include #include @@ -23,12 +18,27 @@ #include "vtr_assert.h" #include "vtr_vector.h" +#ifdef EIGEN_INSTALLED +#include +#include +#include +#include +#include +#endif // EIGEN_INSTALLED + std::unique_ptr make_analytical_solver(e_analytical_solver solver_type, const APNetlist& netlist) { // Based on the solver type passed in, build the solver. switch (solver_type) { case e_analytical_solver::QP_HYBRID: +#ifdef EIGEN_INSTALLED return std::make_unique(netlist); +#else + (void)netlist; + VPR_FATAL_ERROR(VPR_ERROR_AP, + "QP Hybrid Solver requires the Eigen library"); + break; +#endif // EIGEN_INSTALLED default: VPR_FATAL_ERROR(VPR_ERROR_AP, "Unrecognized analytical solver type"); @@ -57,6 +67,8 @@ AnalyticalSolver::AnalyticalSolver(const APNetlist& netlist) } } +#ifdef EIGEN_INSTALLED + void QPHybridSolver::init_linear_system() { // Count the number of star nodes that the netlist will have. size_t num_star_nodes = 0; @@ -248,3 +260,5 @@ void QPHybridSolver::solve(unsigned iteration, PartialPlacement &p_placement) { } } +#endif // EIGEN_INSTALLED + diff --git a/vpr/src/analytical_place/analytical_solver.h b/vpr/src/analytical_place/analytical_solver.h index 115fbbe3fb9..7cb37bec6c8 100644 --- a/vpr/src/analytical_place/analytical_solver.h +++ b/vpr/src/analytical_place/analytical_solver.h @@ -9,11 +9,14 @@ #pragma once #include -#include "Eigen/Sparse" #include "ap_netlist_fwd.h" #include "vtr_strong_id.h" #include "vtr_vector.h" +#ifdef EIGEN_INSTALLED +#include "Eigen/Sparse" +#endif // EIGEN_INSTALLED + // Forward declarations class PartialPlacement; class APNetlist; @@ -105,6 +108,10 @@ class AnalyticalSolver { std::unique_ptr make_analytical_solver(e_analytical_solver solver_type, const APNetlist &netlist); +// The Eigen library is used to solve matrix equations in the following solvers. +// The solver cannot be built if Eigen is not installed. +#ifdef EIGEN_INSTALLED + /** * @brief An Analytical Solver which tries to minimize the quadratic HPWL * objective: @@ -203,3 +210,5 @@ class QPHybridSolver : public AnalyticalSolver { void solve(unsigned iteration, PartialPlacement &p_placement) final; }; +#endif // EIGEN_INSTALLED + diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/task_list.txt b/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/task_list.txt deleted file mode 100644 index 1d020ceef11..00000000000 --- a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/task_list.txt +++ /dev/null @@ -1,5 +0,0 @@ -# This extra task list is for running just the basic_ap tasks in isolation. -regression_tests/vtr_reg_basic/basic_ap/single_wire -regression_tests/vtr_reg_basic/basic_ap/single_ff -regression_tests/vtr_reg_basic/basic_ap/ch_intrinsics -regression_tests/vtr_reg_basic/basic_ap/diffeq1 diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/task_list.txt b/vtr_flow/tasks/regression_tests/vtr_reg_basic/task_list.txt index 64d01d32ee0..386b06be76d 100644 --- a/vtr_flow/tasks/regression_tests/vtr_reg_basic/task_list.txt +++ b/vtr_flow/tasks/regression_tests/vtr_reg_basic/task_list.txt @@ -1,7 +1,3 @@ -regression_tests/vtr_reg_basic/basic_ap/single_wire -regression_tests/vtr_reg_basic/basic_ap/single_ff -regression_tests/vtr_reg_basic/basic_ap/ch_intrinsics -regression_tests/vtr_reg_basic/basic_ap/diffeq1 regression_tests/vtr_reg_basic/basic_no_timing regression_tests/vtr_reg_basic/basic_timing regression_tests/vtr_reg_basic/basic_timing_no_sdc diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/ch_intrinsics/ch_intrinsics_fixed_io.xml b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/ch_intrinsics/ch_intrinsics_fixed_io.xml similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/ch_intrinsics/ch_intrinsics_fixed_io.xml rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/ch_intrinsics/ch_intrinsics_fixed_io.xml diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/ch_intrinsics/config/config.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/ch_intrinsics/config/config.txt similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/ch_intrinsics/config/config.txt rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/ch_intrinsics/config/config.txt diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/ch_intrinsics/config/golden_results.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/ch_intrinsics/config/golden_results.txt similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/ch_intrinsics/config/golden_results.txt rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/ch_intrinsics/config/golden_results.txt diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/diffeq1/config/config.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/diffeq1/config/config.txt similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/diffeq1/config/config.txt rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/diffeq1/config/config.txt diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/diffeq1/config/golden_results.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/diffeq1/config/golden_results.txt similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/diffeq1/config/golden_results.txt rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/diffeq1/config/golden_results.txt diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/diffeq1/diffeq1_fixed_io.xml b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/diffeq1/diffeq1_fixed_io.xml similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/diffeq1/diffeq1_fixed_io.xml rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/diffeq1/diffeq1_fixed_io.xml diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_ff/config/config.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_ff/config/config.txt similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_ff/config/config.txt rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_ff/config/config.txt diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_ff/config/golden_results.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_ff/config/golden_results.txt similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_ff/config/golden_results.txt rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_ff/config/golden_results.txt diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_ff/single_ff_fixed_io.xml b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_ff/single_ff_fixed_io.xml similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_ff/single_ff_fixed_io.xml rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_ff/single_ff_fixed_io.xml diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_wire/config/config.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_wire/config/config.txt similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_wire/config/config.txt rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_wire/config/config.txt diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_wire/config/golden_results.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_wire/config/golden_results.txt similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_wire/config/golden_results.txt rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_wire/config/golden_results.txt diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_wire/single_wire_fixed_io.xml b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_wire/single_wire_fixed_io.xml similarity index 100% rename from vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_ap/single_wire/single_wire_fixed_io.xml rename to vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/single_wire/single_wire_fixed_io.xml diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/task_list.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/task_list.txt new file mode 100644 index 00000000000..d6c7b6615b4 --- /dev/null +++ b/vtr_flow/tasks/regression_tests/vtr_reg_strong/basic_ap/task_list.txt @@ -0,0 +1,5 @@ +# This extra task list is for running just the basic_ap tasks in isolation. +regression_tests/vtr_reg_strong/basic_ap/single_wire +regression_tests/vtr_reg_strong/basic_ap/single_ff +regression_tests/vtr_reg_strong/basic_ap/ch_intrinsics +regression_tests/vtr_reg_strong/basic_ap/diffeq1 diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_strong/task_list.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/task_list.txt index 73f97a8867b..ed092987917 100644 --- a/vtr_flow/tasks/regression_tests/vtr_reg_strong/task_list.txt +++ b/vtr_flow/tasks/regression_tests/vtr_reg_strong/task_list.txt @@ -1,3 +1,7 @@ +regression_tests/vtr_reg_strong/basic_ap/single_wire +regression_tests/vtr_reg_strong/basic_ap/single_ff +regression_tests/vtr_reg_strong/basic_ap/ch_intrinsics +regression_tests/vtr_reg_strong/basic_ap/diffeq1 regression_tests/vtr_reg_strong/strong_absorb_buffers regression_tests/vtr_reg_strong/strong_analysis_only regression_tests/vtr_reg_strong/strong_analytic_placer