Skip to content

Commit a7624e3

Browse files
committed
[vpr][route][crr] add get_crr_switch_name
1 parent 73edb0f commit a7624e3

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

vpr/src/route/rr_graph_generation/tileable_rr_graph/crr_generator/crr_connection_builder.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,10 @@ void CRRConnectionBuilder::calculate_segment_coordinates(const SegmentInfo& info
396396
y_low = y - tap + 1;
397397
break;
398398
default:
399-
x_high = x_low = x;
400-
y_high = y_low = y;
399+
x_high = x;
400+
x_low = x;
401+
y_high = y;
402+
y_low = y;
401403
break;
402404
}
403405
} else {
@@ -427,8 +429,10 @@ void CRRConnectionBuilder::calculate_segment_coordinates(const SegmentInfo& info
427429
y_low = y - seg_length + tap;
428430
break;
429431
default:
430-
x_high = x_low = x;
431-
y_high = y_low = y;
432+
x_high = x;
433+
x_low = x;
434+
y_high = y;
435+
y_low = y;
432436
break;
433437
}
434438
}

vpr/src/route/rr_graph_generation/tileable_rr_graph/crr_generator/crr_connection_builder.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#pragma once
22

3+
/**
4+
* @file crr_connection_builder.h
5+
* @brief Implements functions used to retrieve source and sink Node IDs
6+
* which should be connected together based on switch block templates.
7+
*/
8+
39
#include "rr_graph_view.h"
410
#include "physical_types.h"
511

vpr/src/route/rr_graph_generation/tileable_rr_graph/crr_generator/crr_edge_builder.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
#include "physical_types.h"
55
#include "crr_connection_builder.h"
66

7-
static t_arch_switch_inf create_crr_switch(const int delay_ps) {
8-
std::string switch_name;
7+
static std::string get_crr_switch_name(const int delay_ps) {
98
if (delay_ps == 0) {
10-
switch_name = "sw_zero";
9+
return "sw_zero";
1110
} else {
12-
switch_name = "sw_" + std::to_string(delay_ps);
11+
return "sw_" + std::to_string(delay_ps);
1312
}
13+
}
14+
15+
static t_arch_switch_inf create_crr_switch(const int delay_ps) {
16+
std::string switch_name = get_crr_switch_name(delay_ps);
17+
1418
t_arch_switch_inf arch_switch_inf;
1519
arch_switch_inf.set_type(e_switch_type::MUX);
1620
arch_switch_inf.name = switch_name;
@@ -28,14 +32,9 @@ static t_arch_switch_inf create_crr_switch(const int delay_ps) {
2832
}
2933

3034
static RRSwitchId find_or_create_crr_switch_id(const int delay_ps) {
31-
auto& all_sw_inf = g_vpr_ctx.mutable_device().all_sw_inf;
32-
std::string switch_name;
35+
std::vector<t_arch_switch_inf>& all_sw_inf = g_vpr_ctx.mutable_device().all_sw_inf;
36+
std::string switch_name = get_crr_switch_name(delay_ps);
3337
int found_sw_id = -1;
34-
if (delay_ps == 0) {
35-
switch_name = "sw_zero";
36-
} else {
37-
switch_name = "sw_" + std::to_string(delay_ps);
38-
}
3938
for (int sw_id = 0; sw_id < (int)all_sw_inf.size(); sw_id++) {
4039
if (all_sw_inf[sw_id].name == switch_name) {
4140
found_sw_id = sw_id;

0 commit comments

Comments
 (0)