@@ -86,6 +86,7 @@ static vtr::NdMatrix<std::vector<int>, 4> alloc_and_load_pin_to_track_map(const
86
86
static vtr::NdMatrix<int , 5 > alloc_and_load_pin_to_seg_type (const e_pin_type pin_type,
87
87
const int seg_type_tracks,
88
88
const int Fc,
89
+ const std::vector<int > seg_type_Fc,
89
90
const t_physical_tile_type_ptr Type,
90
91
const bool perturb_switch_pattern,
91
92
const e_directionality directionality);
@@ -1696,21 +1697,6 @@ static vtr::NdMatrix<std::vector<int>, 4> alloc_and_load_pin_to_track_map(const
1696
1697
const e_directionality directionality,
1697
1698
const int num_seg_types,
1698
1699
const int * sets_per_seg_type) {
1699
- /* get the maximum number of tracks that any pin can connect to */
1700
- size_t max_pin_tracks = 0 ;
1701
- for (int iseg = 0 ; iseg < num_seg_types; iseg++) {
1702
- /* determine the maximum Fc to this segment type across all pins */
1703
- int max_Fc = 0 ;
1704
- for (int pin_index = 0 ; pin_index < Type->num_pins ; ++pin_index) {
1705
- int pin_class = Type->pin_class [pin_index];
1706
- if (Fc[pin_index][iseg] > max_Fc && Type->class_inf [pin_class].type == pin_type) {
1707
- max_Fc = Fc[pin_index][iseg];
1708
- }
1709
- }
1710
-
1711
- max_pin_tracks += max_Fc;
1712
- }
1713
-
1714
1700
/* allocate 'result' matrix and initialize entries to OPEN. also allocate and intialize matrix which will be
1715
1701
* used to index into the correct entries when loading up 'result' */
1716
1702
@@ -1733,17 +1719,21 @@ static vtr::NdMatrix<std::vector<int>, 4> alloc_and_load_pin_to_track_map(const
1733
1719
int num_seg_type_tracks = fac * sets_per_seg_type[iseg];
1734
1720
1735
1721
/* determine the maximum Fc to this segment type across all pins */
1722
+ std::vector<int > seg_type_Fc;
1736
1723
int max_Fc = 0 ;
1737
1724
for (int pin_index = 0 ; pin_index < Type->num_pins ; ++pin_index) {
1738
1725
int pin_class = Type->pin_class [pin_index];
1726
+
1727
+ seg_type_Fc.push_back (Fc[pin_index][iseg]); // Create Fc values for pins
1728
+
1739
1729
if (Fc[pin_index][iseg] > max_Fc && Type->class_inf [pin_class].type == pin_type) {
1740
1730
max_Fc = Fc[pin_index][iseg];
1741
1731
}
1742
1732
}
1743
1733
1744
1734
/* get pin connections to tracks of the current segment type */
1745
1735
auto pin_to_seg_type_map = alloc_and_load_pin_to_seg_type (pin_type,
1746
- num_seg_type_tracks, max_Fc, Type, perturb_switch_pattern[iseg], directionality);
1736
+ num_seg_type_tracks, max_Fc, seg_type_Fc, Type, perturb_switch_pattern[iseg], directionality);
1747
1737
1748
1738
/* connections in pin_to_seg_type_map are within that seg type -- i.e. in the [0,num_seg_type_tracks-1] range.
1749
1739
* now load up 'result' array with these connections, but offset them so they are relative to the channel
@@ -1770,20 +1760,23 @@ static vtr::NdMatrix<std::vector<int>, 4> alloc_and_load_pin_to_track_map(const
1770
1760
/* next seg type will start at this track index */
1771
1761
seg_type_start_track += num_seg_type_tracks;
1772
1762
}
1773
-
1774
1763
return result;
1775
1764
}
1776
1765
1777
1766
static vtr::NdMatrix<int , 5 > alloc_and_load_pin_to_seg_type (const e_pin_type pin_type,
1778
1767
const int num_seg_type_tracks,
1779
1768
const int Fc,
1769
+ const std::vector<int > seg_type_Fc,
1780
1770
const t_physical_tile_type_ptr Type,
1781
1771
const bool perturb_switch_pattern,
1782
1772
const e_directionality directionality) {
1783
1773
/* Note: currently a single value of Fc is used across each pin. In the future
1784
1774
* the looping below will have to be modified if we want to account for pin-based
1785
1775
* Fc values */
1786
1776
1777
+ /* Note: Added support for pin-based Fc values
1778
+ */
1779
+
1787
1780
/* NB: This wastes some space. Could set tracks_..._pin[ipin][ioff][iside] =
1788
1781
* NULL if there is no pin on that side, or that pin is of the wrong type.
1789
1782
* Probably not enough memory to worry about, esp. as it's temporary.
@@ -1848,7 +1841,7 @@ static vtr::NdMatrix<int, 5> alloc_and_load_pin_to_seg_type(const e_pin_type pin
1848
1841
for (int width = 0 ; width < Type->width ; ++width) {
1849
1842
for (int height = 0 ; height < Type->height ; ++height) {
1850
1843
for (e_side side : SIDES) {
1851
- if (Type->pinloc [width][height][side][pin] == 1 ) {
1844
+ if (Type->pinloc [width][height][side][pin] == 1 && seg_type_Fc[pin] > 0 ) {
1852
1845
dir_list[width][height][side][num_dir[width][height][side]] = pin;
1853
1846
num_dir[width][height][side]++;
1854
1847
}
0 commit comments