Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoC SAT Routing #2564

Merged
merged 42 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
23d9ddc
add or-tools as a submodule
soheilshahrouz Mar 6, 2024
52f9d23
add is_turn_legal() and get_all_illegal_turns()
soheilshahrouz Mar 7, 2024
f35f137
add get_noc_router_incoming_links() method to NocStorage
soheilshahrouz Mar 7, 2024
168642e
congestion-free NoC routes pass SAT constraints
soheilshahrouz Mar 9, 2024
aabcee8
add sort_noc_links_in_chain_order()
soheilshahrouz Mar 10, 2024
9193b25
sanity checks for CP-SAT routes
soheilshahrouz Mar 10, 2024
8327121
fix infinite loop in sort_noc_links_in_chain_order
soheilshahrouz Mar 10, 2024
952745c
optimize aggregate bandwidth using or-tools
soheilshahrouz Mar 10, 2024
fdf6a98
remove submodule or-tools
soheilshahrouz Mar 12, 2024
fcff150
move passed by value names
soheilshahrouz Mar 12, 2024
38fb924
invoke sat routing at the end of placement when NoC congestion is not…
soheilshahrouz Mar 12, 2024
a37458c
first try at solving NoC placement and routing in a single shot
soheilshahrouz Mar 13, 2024
e1af609
add noc_sat_place_and_route()
soheilshahrouz Mar 13, 2024
936f6c6
remove lexicographic optimization in noc_sat_place_and_route()
soheilshahrouz Mar 13, 2024
c570313
namespace alias for operations_research::sat
soheilshahrouz Mar 13, 2024
37d626b
replace congestion constraints with an objective to minimize the numb…
soheilshahrouz Mar 15, 2024
6ce5f78
add hints for cp-sat
soheilshahrouz Mar 15, 2024
6d56791
report NoC metrics after sat routing
soheilshahrouz Mar 15, 2024
792e527
Merge branch 'master' into add_or_tools
soheilshahrouz Mar 18, 2024
7d7c2f8
types and const ref
soheilshahrouz Mar 19, 2024
7213a5d
Merge branch 'master' into add_or_tools
soheilshahrouz May 22, 2024
0bf839c
add comments
soheilshahrouz May 23, 2024
edf3191
add --noc_sat_routing_bandwidth_resolution command line option
soheilshahrouz May 23, 2024
8f3bae3
add more comments
soheilshahrouz May 23, 2024
959e188
remove add_distance_constraints() and add command line options for we…
soheilshahrouz May 23, 2024
87aed01
add create_objective()
soheilshahrouz May 24, 2024
e697f64
noc_sat_routing_num_workers and noc_sat_routing_log_search_progress c…
soheilshahrouz May 24, 2024
d76d7b5
check or-tools dependency in CMakeLists.txt
soheilshahrouz May 27, 2024
5d2695d
Merge branch 'master' into add_or_tools
soheilshahrouz May 28, 2024
2aac478
fix unit test compilation error
soheilshahrouz May 28, 2024
85c5ba2
fix test_setup_noc.cpp compilation error
soheilshahrouz May 28, 2024
c1b7aa8
change the converter for --noc_sat_routing_log_search_progress
soheilshahrouz May 29, 2024
b8e95fc
Merge branch 'master' into add_or_tools
soheilshahrouz May 31, 2024
63e7cfc
check if all links have the same bandwidth in SAT router
soheilshahrouz May 31, 2024
3fa4fa8
check latency equality for routers and links
soheilshahrouz May 31, 2024
d509ecd
add comments and subroutines
soheilshahrouz Jun 5, 2024
2fe22e8
add comments in is_turn_legal() overrides
soheilshahrouz Jun 5, 2024
09b5802
move DEFAULT_MAX_TRAFFIC_FLOW_LATENCY to NocTrafficFlows
soheilshahrouz Jun 5, 2024
90d4938
specify the domain of latency overrun vars based on the noc dimensions
soheilshahrouz Jun 5, 2024
3b8795f
use --noc_sat_routing_num_workers only when it is explicitly specified
soheilshahrouz Jun 5, 2024
b7bf7b5
conditional inclusion of sat_router
soheilshahrouz Jun 5, 2024
2ed4497
fix segfault in NoC cost report
soheilshahrouz Jun 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
url = https://github.com/catchorg/Catch2.git
[submodule "libs/EXTERNAL/sockpp"]
path = libs/EXTERNAL/sockpp
#url = [email protected]:fpagliughi/sockpp.git
url = [email protected]:w0lek/sockpp.git # fork where in branch v1.0.0_no_complication_warnings there are compilation warnings fixes for upstream tag v1.0.0 of sockpp
url = https://github.com/w0lek/sockpp.git # fork where in branch v1.0.0_no_complication_warnings there are compilation warnings fixes for upstream tag v1.0.0 of sockpp
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ option(VPR_USE_SERVER "Specify whether vpr enables the server mode" ON)
#VPR option --enable_analytic_placer is also required for Analytic Placement
option(VPR_ANALYTIC_PLACE "Enable analytic placement in VPR." ON)
option(VPR_ENABLE_INTERCHANGE "Enable FPGA interchange." ON)
option(VPR_ENABLE_NOC_SAT_ROUTING "Enable NoC SAT routing." OFF)

option(WITH_BLIFEXPLORER "Enable build with blifexplorer" OFF)

Expand Down Expand Up @@ -220,12 +221,12 @@ endforeach()
set(FLEX_BISON_WARN_SUPPRESS_FLAGS "")
set(FLEX_BISON_WARN_SUPPRESS_FLAGS_TO_CHECK
"-Wno-redundant-decls" #Flex/bison generate code with redundant declarations
"-Wno-switch-default" #Flex/bison generate switch statments w/o default cases
"-Wno-switch-default" #Flex/bison generate switch statements w/o default cases
"-Wno-unused-parameter" #Flex produces functions with unused params in re-entrant mode
"-Wno-missing-declarations" #Flex misses some declarations in re-entrant mode
"-Wimplicit-fallthrough=0" #Bison produces some cases with explicit
"-Wno-sign-compare" #Flex generates code which performs some signed/unsigned comparison
"-Wno-null-dereference" #Bison produces some cases with potenetial null derefs
"-Wno-null-dereference" #Bison produces some cases with potential null derefs
)
foreach(flag ${FLEX_BISON_WARN_SUPPRESS_FLAGS_TO_CHECK})
CHECK_CXX_COMPILER_FLAG(${flag} CXX_COMPILER_SUPPORTS_${flag})
Expand Down
2 changes: 1 addition & 1 deletion libs/EXTERNAL/libargparse/src/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ namespace argparse {
//Sets the hlep text
Argument& help(std::string help_str);

//Sets the defuault value
//Sets the default value
Argument& default_value(const std::string& default_val);
Argument& default_value(const std::vector<std::string>& default_val);
Argument& default_value(const std::initializer_list<std::string>& default_val);
Expand Down
8 changes: 5 additions & 3 deletions libs/libvtrutil/src/vtr_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "vtr_log.h"
#include "vtr_rusage.h"

#include <utility>

namespace vtr {

int f_timer_depth = 0;
Expand Down Expand Up @@ -30,7 +32,7 @@ float Timer::delta_max_rss_mib() const {

///@brief Constructor
ScopedActionTimer::ScopedActionTimer(std::string action_str)
: action_(action_str)
: action_(std::move(action_str))
, depth_(f_timer_depth++) {
}

Expand Down Expand Up @@ -69,7 +71,7 @@ int ScopedActionTimer::depth() const {

///@brief Constructor
ScopedFinishTimer::ScopedFinishTimer(std::string action_str)
: ScopedActionTimer(action_str) {
: ScopedActionTimer(std::move(action_str)) {
}

///@brief Destructor
Expand All @@ -83,7 +85,7 @@ ScopedFinishTimer::~ScopedFinishTimer() {

///@brief Constructor
ScopedStartFinishTimer::ScopedStartFinishTimer(std::string action_str)
: ScopedActionTimer(action_str) {
: ScopedActionTimer(std::move(action_str)) {
vtr::printf_info("%s%s\n", pad().c_str(), action().c_str());
}

Expand Down
6 changes: 3 additions & 3 deletions libs/libvtrutil/src/vtr_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Timer {
///@brief Scoped time class which prints the time elapsed for the specifid action
class ScopedActionTimer : public Timer {
public:
ScopedActionTimer(const std::string action);
ScopedActionTimer(std::string action);
~ScopedActionTimer();

void quiet(bool value);
Expand Down Expand Up @@ -71,7 +71,7 @@ class ScopedActionTimer : public Timer {
*/
class ScopedFinishTimer : public ScopedActionTimer {
public:
ScopedFinishTimer(const std::string action);
ScopedFinishTimer(std::string action);
~ScopedFinishTimer();
};

Expand All @@ -91,7 +91,7 @@ class ScopedFinishTimer : public ScopedActionTimer {
*/
class ScopedStartFinishTimer : public ScopedActionTimer {
public:
ScopedStartFinishTimer(const std::string action);
ScopedStartFinishTimer(std::string action);
~ScopedStartFinishTimer();
};
} // namespace vtr
Expand Down
18 changes: 16 additions & 2 deletions vpr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ if(${VPR_ANALYTIC_PLACE})
endif(TARGET Eigen3::Eigen)
endif()

if (${VPR_ENABLE_NOC_SAT_ROUTING})
message(STATUS "VPR NoC SAT Routing: Requested")
find_package(ortools CONFIG REQUIRED)
if (TARGET ortools::ortools)
message(STATUS "VPR NoC SAT Routing dependency (or-tools): Found")
message(STATUS "VPR NoC SAT Routing: Enabled")
target_link_libraries(libvpr ortools::ortools)
target_compile_definitions(libvpr PUBLIC -DENABLE_NOC_SAT_ROUTING)
else ()
message(STATUS "VPR NoC SAT Routing dependency (or-tools): Not Found (You may need to set CMAKE_PREFIX_PATH in order for CMake to find your OR-Tools installation)")
message(STATUS "VPR NoC SAT Routing: Disabled")
endif (TARGET ortools::ortools)
endif ()

set_target_properties(libvpr PROPERTIES PREFIX "") #Avoid extra 'lib' prefix

#Specify link-time dependencies
Expand Down Expand Up @@ -161,7 +175,7 @@ add_executable(vpr ${EXEC_SOURCES})
target_link_libraries(vpr libvpr)


#Supress IPO link warnings if IPO is enabled
#Suppress IPO link warnings if IPO is enabled
get_target_property(VPR_USES_IPO vpr INTERPROCEDURAL_OPTIMIZATION)
if (VPR_USES_IPO)
set_property(TARGET vpr APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS})
Expand Down Expand Up @@ -292,7 +306,7 @@ target_link_libraries(test_vpr
Catch2::Catch2WithMain
libvpr)

#Supress IPO link warnings if IPO is enabled
#Suppress IPO link warnings if IPO is enabled
get_target_property(TEST_VPR_USES_IPO vpr INTERPROCEDURAL_OPTIMIZATION)
if (TEST_VPR_USES_IPO)
set_property(TARGET test_vpr APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS})
Expand Down
13 changes: 12 additions & 1 deletion vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,9 +744,20 @@ static void SetupNocOpts(const t_options& Options, t_noc_opts* NocOpts) {
NocOpts->noc_latency_constraints_weighting = Options.noc_latency_constraints_weighting;
NocOpts->noc_latency_weighting = Options.noc_latency_weighting;
NocOpts->noc_congestion_weighting = Options.noc_congestion_weighting;
NocOpts->noc_swap_percentage = Options.noc_swap_percentage;
NocOpts->noc_centroid_weight = Options.noc_centroid_weight;
NocOpts->noc_swap_percentage = Options.noc_swap_percentage;
NocOpts->noc_sat_routing_bandwidth_resolution = Options.noc_sat_routing_bandwidth_resolution;
NocOpts->noc_sat_routing_latency_overrun_weighting = Options.noc_sat_routing_latency_overrun_weighting_factor;
NocOpts->noc_sat_routing_congestion_weighting = Options.noc_sat_routing_congestion_weighting_factor;
if (Options.noc_sat_routing_num_workers.provenance() == argparse::Provenance::SPECIFIED) {
NocOpts->noc_sat_routing_num_workers = Options.noc_sat_routing_num_workers;
} else {
NocOpts->noc_sat_routing_num_workers = (int)Options.num_workers;
}
NocOpts->noc_sat_routing_log_search_progress = Options.noc_sat_routing_log_search_progress;
NocOpts->noc_placement_file_name = Options.noc_placement_file_name;


}

static void SetupServerOpts(const t_options& Options, t_server_opts* ServerOpts) {
Expand Down
4 changes: 4 additions & 0 deletions vpr/src/base/ShowSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,10 @@ static void ShowNocOpts(const t_noc_opts& NocOpts) {
VTR_LOG("NocOpts.noc_latency_weighting: %f\n", NocOpts.noc_latency_weighting);
VTR_LOG("NocOpts.noc_congestion_weighting: %f\n", NocOpts.noc_congestion_weighting);
VTR_LOG("NocOpts.noc_swap_percentage: %d%%\n", NocOpts.noc_swap_percentage);
VTR_LOG("NocOpts.noc_sat_routing_bandwidth_resolution: %d\n", NocOpts.noc_sat_routing_bandwidth_resolution);
VTR_LOG("NocOpts.noc_sat_routing_latency_overrun_weighting: %d\n", NocOpts.noc_sat_routing_latency_overrun_weighting);
VTR_LOG("NocOpts.noc_sat_routing_congestion_weighting: %d\n", NocOpts.noc_sat_routing_congestion_weighting);
VTR_LOG("NocOpts.noc_sat_routing_num_workers: %d\n", NocOpts.noc_sat_routing_num_workers);
VTR_LOG("NocOpts.noc_routing_algorithm: %s\n", NocOpts.noc_placement_file_name.c_str());
VTR_LOG("\n");
}
13 changes: 5 additions & 8 deletions vpr/src/base/echo_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ void setEchoEnabled(bool echo_enabled) {
}

void setAllEchoFileEnabled(bool value) {
int i;
for (i = 0; i < (int)E_ECHO_END_TOKEN; i++) {
for (int i = 0; i < (int)E_ECHO_END_TOKEN; i++) {
echoFileEnabled[i] = value;
}
}
Expand Down Expand Up @@ -67,7 +66,7 @@ void alloc_and_load_echo_file_info() {
echoFileNames = new char*[(int)E_ECHO_END_TOKEN];
for (auto i = 0; i < (int)E_ECHO_END_TOKEN; i++) {
echoFileEnabled[i] = false;
echoFileNames[i] = NULL;
echoFileNames[i] = nullptr;
}

setAllEchoFileEnabled(getEchoEnabled());
Expand Down Expand Up @@ -136,9 +135,8 @@ void alloc_and_load_echo_file_info() {
}

void free_echo_file_info() {
int i;
if (echoFileEnabled != nullptr) {
for (i = 0; i < (int)E_ECHO_END_TOKEN; i++) {
for (int i = 0; i < (int)E_ECHO_END_TOKEN; i++) {
if (echoFileNames[i] != nullptr) {
delete[] echoFileNames[i];
}
Expand All @@ -165,7 +163,7 @@ char* getOutputFileName(enum e_output_files ename) {
return outputFileNames[(int)ename];
}

void alloc_and_load_output_file_names(const std::string default_name) {
void alloc_and_load_output_file_names(const std::string& default_name) {
std::string name;

if (outputFileNames == nullptr) {
Expand All @@ -185,9 +183,8 @@ void alloc_and_load_output_file_names(const std::string default_name) {
}

void free_output_file_names() {
int i;
if (outputFileNames != nullptr) {
for (i = 0; i < (int)E_FILE_END_TOKEN; i++) {
for (int i = 0; i < (int)E_FILE_END_TOKEN; i++) {
if (outputFileNames[i] != nullptr) {
delete[] outputFileNames[i];
outputFileNames[i] = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/base/echo_files.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void free_echo_file_info();

void setOutputFileName(enum e_output_files ename, const char* name, const char* default_name);
char* getOutputFileName(enum e_output_files ename);
void alloc_and_load_output_file_names(const std::string default_name);
void alloc_and_load_output_file_names(const std::string& default_name);
void free_output_file_names();

#endif
8 changes: 4 additions & 4 deletions vpr/src/base/place_and_route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,
t_det_routing_arch* det_routing_arch,
std::vector<t_segment_inf>& segment_inf,
NetPinsMatrix<float>& net_delay,
std::shared_ptr<SetupHoldTimingInfo> timing_info,
std::shared_ptr<RoutingDelayCalculator> delay_calc,
const std::shared_ptr<SetupHoldTimingInfo>& timing_info,
const std::shared_ptr<RoutingDelayCalculator>& delay_calc,
bool is_flat) {
vtr::vector<ParentNetId, vtr::optional<RouteTree>> best_routing; /* Saves the best routing found so far. */
int current, low, high, final;
Expand Down Expand Up @@ -101,7 +101,7 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,
graph_directionality = (det_routing_arch->directionality == BI_DIRECTIONAL ? GRAPH_BIDIR : GRAPH_UNIDIR);
}

VTR_ASSERT(net_delay.size());
VTR_ASSERT(!net_delay.empty());

if (det_routing_arch->directionality == BI_DIRECTIONAL)
udsd_multiplier = 1;
Expand Down Expand Up @@ -298,7 +298,7 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,
current = current + current % udsd_multiplier;
}

/* The binary search above occassionally does not find the minimum *
/* The binary search above occasionally does not find the minimum *
* routeable channel width. Sometimes a circuit that will not route *
* in 19 channels will route in 18, due to router flukiness. If *
* verify_binary_search is set, the code below will ensure that FPGAs *
Expand Down
4 changes: 2 additions & 2 deletions vpr/src/base/place_and_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,
t_det_routing_arch* det_routing_arch,
std::vector<t_segment_inf>& segment_inf,
NetPinsMatrix<float>& net_delay,
std::shared_ptr<SetupHoldTimingInfo> timing_info,
std::shared_ptr<RoutingDelayCalculator> delay_calc,
const std::shared_ptr<SetupHoldTimingInfo>& timing_info,
const std::shared_ptr<RoutingDelayCalculator>& delay_calc,
bool is_flat);

t_chan_width init_chan(int cfactor,
Expand Down
Loading
Loading