@@ -295,7 +295,8 @@ static void load_perturbed_connection_block_pattern(vtr::NdMatrix<int, 6>& track
295
295
const std::vector<t_pin_loc>& pin_locations,
296
296
const int x_chan_width,
297
297
const int y_chan_width,
298
- const int Fc,
298
+ const vtr::Matrix<int >& Fc,
299
+ const int seg_index,
299
300
const enum e_directionality directionality);
300
301
301
302
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
3269
3270
* as a whole */
3270
3271
for (auto type_layer_index : type_layer) {
3271
3272
for (int ipin = 0 ; ipin < Type->num_pins ; ipin++) {
3273
+ int cur_Fc = Fc[ipin][seg_inf[iseg].seg_index ];
3272
3274
for (int iwidth = 0 ; iwidth < Type->width ; iwidth++) {
3273
3275
for (int iheight = 0 ; iheight < Type->height ; iheight++) {
3274
3276
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++) {
3276
3278
for (auto connected_layer : get_layers_pin_is_connected_to (Type, type_layer_index, ipin)) {
3277
3279
int relative_track_ind = pin_to_seg_type_map[ipin][iwidth][iheight][connected_layer][iside][iconn];
3278
3280
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
3476
3478
if (perturb_switch_pattern) {
3477
3479
load_perturbed_connection_block_pattern (tracks_connected_to_pin,
3478
3480
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);
3480
3482
} else {
3481
3483
load_uniform_connection_block_pattern (tracks_connected_to_pin,
3482
3484
pin_ordering, Fc, seg_index,
@@ -3838,7 +3840,8 @@ static void load_perturbed_connection_block_pattern(vtr::NdMatrix<int, 6>& track
3838
3840
const std::vector<t_pin_loc>& pin_locations,
3839
3841
const int x_chan_width,
3840
3842
const int y_chan_width,
3841
- const int Fc,
3843
+ const vtr::Matrix<int >& Fc,
3844
+ const int seg_index,
3842
3845
enum e_directionality directionality) {
3843
3846
/* Loads the tracks_connected_to_pin array with an unevenly distributed *
3844
3847
* 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
3853
3856
3854
3857
VTR_ASSERT (directionality == BI_DIRECTIONAL);
3855
3858
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
-
3860
3859
int num_phys_pins = pin_locations.size ();
3861
3860
3862
3861
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
3866
3865
int height = pin_locations[i].height_offset ;
3867
3866
int layer = pin_locations[i].layer_offset ;
3868
3867
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
+
3869
3873
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);
3871
3875
3872
3876
float spacing_dense = (float )max_chan_width / (float )(2 * Fc_dense);
3873
3877
float spacing_sparse = (float )max_chan_width / (float )(2 * Fc_sparse);
0 commit comments