[lib] now link clock arch supports tap and driver default switches

This commit is contained in:
tangxifan 2024-06-21 16:52:22 -07:00
parent 9ccd14bf4d
commit 1ab75cf76c
1 changed files with 28 additions and 6 deletions

View File

@ -32,18 +32,40 @@ static int link_clock_network_rr_segments(ClockNetwork& clk_ntwk,
*******************************************************************/
static int link_clock_network_rr_switches(ClockNetwork& clk_ntwk,
const RRGraphView& rr_graph) {
/* default switch id */
std::string default_switch_name = clk_ntwk.default_switch_name();
/* default tap switch id */
int status = CMD_EXEC_FATAL_ERROR;
std::string default_tap_switch_name = clk_ntwk.default_tap_switch_name();
for (size_t rr_switch_id = 0; rr_switch_id < rr_graph.num_rr_switches();
++rr_switch_id) {
if (std::string(rr_graph.rr_switch_inf(RRSwitchId(rr_switch_id)).name) ==
default_switch_name) {
clk_ntwk.set_default_switch(RRSwitchId(rr_switch_id));
return CMD_EXEC_SUCCESS;
default_tap_switch_name) {
clk_ntwk.set_default_tap_switch(RRSwitchId(rr_switch_id));
status = CMD_EXEC_SUCCESS;
break;
}
}
if (status != CMD_EXEC_SUCCESS) {
VTR_LOG("Unable to find the default tap switch '%s' in VPR architecture description!\n", default_tap_switch_name.c_str());
return CMD_EXEC_FATAL_ERROR;
}
/* default driver switch id */
status = CMD_EXEC_FATAL_ERROR;
std::string default_driver_switch_name = clk_ntwk.default_driver_switch_name();
for (size_t rr_switch_id = 0; rr_switch_id < rr_graph.num_rr_switches();
++rr_switch_id) {
if (std::string(rr_graph.rr_switch_inf(RRSwitchId(rr_switch_id)).name) ==
default_driver_switch_name) {
clk_ntwk.set_default_driver_switch(RRSwitchId(rr_switch_id));
status = CMD_EXEC_SUCCESS;
break;
}
}
if (status != CMD_EXEC_SUCCESS) {
VTR_LOG("Unable to find the default driver switch '%s' in VPR architecture description!\n", default_driver_switch_name.c_str());
return CMD_EXEC_FATAL_ERROR;
}
return CMD_EXEC_FATAL_ERROR;
return status;
}
int link_clock_network_rr_graph(ClockNetwork& clk_ntwk,