Skip to content

Commit b1788cb

Browse files
committed
update load_perturbed_connection_block_pattern
1 parent ceae381 commit b1788cb

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

vpr/src/route/rr_graph.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ static void load_perturbed_connection_block_pattern(vtr::NdMatrix<int, 6>& track
295295
const std::vector<t_pin_loc>& pin_locations,
296296
const int x_chan_width,
297297
const int y_chan_width,
298-
const int Fc,
298+
const vtr::Matrix<int>& Fc,
299+
const int seg_index,
299300
const enum e_directionality directionality);
300301

301302
static std::vector<bool> alloc_and_load_perturb_opins(const t_physical_tile_type_ptr type, const vtr::Matrix<int>& Fc_out, const int max_chan_width, const std::vector<t_segment_inf>& segment_inf);
@@ -3269,10 +3270,11 @@ static vtr::NdMatrix<std::vector<int>, 5> alloc_and_load_pin_to_track_map(const
32693270
* as a whole */
32703271
for (auto type_layer_index : type_layer) {
32713272
for (int ipin = 0; ipin < Type->num_pins; ipin++) {
3273+
int cur_Fc = Fc[ipin][seg_inf[iseg].seg_index];
32723274
for (int iwidth = 0; iwidth < Type->width; iwidth++) {
32733275
for (int iheight = 0; iheight < Type->height; iheight++) {
32743276
for (int iside = 0; iside < 4; iside++) {
3275-
for (int iconn = 0; iconn < max_Fc; iconn++) {
3277+
for (int iconn = 0; iconn < cur_Fc; iconn++) {
32763278
for (auto connected_layer : get_layers_pin_is_connected_to(Type, type_layer_index, ipin)) {
32773279
int relative_track_ind = pin_to_seg_type_map[ipin][iwidth][iheight][connected_layer][iside][iconn];
32783280
if (relative_track_ind != OPEN) {
@@ -3476,7 +3478,7 @@ static vtr::NdMatrix<int, 6> alloc_and_load_pin_to_seg_type(const e_pin_type pin
34763478
if (perturb_switch_pattern) {
34773479
load_perturbed_connection_block_pattern(tracks_connected_to_pin,
34783480
pin_ordering,
3479-
num_seg_type_tracks, num_seg_type_tracks, max_Fc, directionality);
3481+
num_seg_type_tracks, num_seg_type_tracks, Fc, seg_index, directionality);
34803482
} else {
34813483
load_uniform_connection_block_pattern(tracks_connected_to_pin,
34823484
pin_ordering, Fc, seg_index,
@@ -3838,7 +3840,8 @@ static void load_perturbed_connection_block_pattern(vtr::NdMatrix<int, 6>& track
38383840
const std::vector<t_pin_loc>& pin_locations,
38393841
const int x_chan_width,
38403842
const int y_chan_width,
3841-
const int Fc,
3843+
const vtr::Matrix<int>& Fc,
3844+
const int seg_index,
38423845
enum e_directionality directionality) {
38433846
/* Loads the tracks_connected_to_pin array with an unevenly distributed *
38443847
* set of switches across the channel. This is done for inputs when *
@@ -3853,10 +3856,6 @@ static void load_perturbed_connection_block_pattern(vtr::NdMatrix<int, 6>& track
38533856

38543857
VTR_ASSERT(directionality == BI_DIRECTIONAL);
38553858

3856-
int Fc_dense = (Fc / 2) + 1;
3857-
int Fc_sparse = Fc - Fc_dense; /* Works for even or odd Fc */
3858-
int Fc_half[2];
3859-
38603859
int num_phys_pins = pin_locations.size();
38613860

38623861
for (int i = 0; i < num_phys_pins; ++i) {
@@ -3866,8 +3865,13 @@ static void load_perturbed_connection_block_pattern(vtr::NdMatrix<int, 6>& track
38663865
int height = pin_locations[i].height_offset;
38673866
int layer = pin_locations[i].layer_offset;
38683867

3868+
int pin_Fc = Fc[pin][seg_index];
3869+
int Fc_dense = ( pin_Fc / 2) + 1;
3870+
int Fc_sparse = pin_Fc - Fc_dense;
3871+
int Fc_half[2];
3872+
38693873
int max_chan_width = (((side == TOP) || (side == BOTTOM)) ? x_chan_width : y_chan_width);
3870-
float step_size = (float)max_chan_width / (float)(Fc * num_phys_pins);
3874+
float step_size = (float)max_chan_width / (float)(pin_Fc * num_phys_pins);
38713875

38723876
float spacing_dense = (float)max_chan_width / (float)(2 * Fc_dense);
38733877
float spacing_sparse = (float)max_chan_width / (float)(2 * Fc_sparse);

0 commit comments

Comments
 (0)