@@ -77,11 +77,16 @@ static void find_all_the_macro(int* num_of_macro, std::vector<ClusterBlockId>& p
77
77
78
78
num_macro = 0 ;
79
79
for (auto blk_id : cluster_ctx.clb_nlist .blocks ()) {
80
+ auto logical_block = cluster_ctx.clb_nlist .block_type (blk_id);
81
+ auto physical_tile = pick_random_physical_type (logical_block);
82
+
80
83
num_blk_pins = cluster_ctx.clb_nlist .block_type (blk_id)->pb_type ->num_pins ;
81
84
for (to_iblk_pin = 0 ; to_iblk_pin < num_blk_pins; to_iblk_pin++) {
85
+ int to_phy_pin = get_physical_pin (physical_tile, logical_block, to_iblk_pin);
86
+
82
87
to_net_id = cluster_ctx.clb_nlist .block_net (blk_id, to_iblk_pin);
83
- to_idirect = f_idirect_from_blk_pin[cluster_ctx. clb_nlist . block_type (blk_id) ->index ][to_iblk_pin ];
84
- to_src_or_sink = f_direct_type_from_blk_pin[cluster_ctx. clb_nlist . block_type (blk_id) ->index ][to_iblk_pin ];
88
+ to_idirect = f_idirect_from_blk_pin[physical_tile ->index ][to_phy_pin ];
89
+ to_src_or_sink = f_direct_type_from_blk_pin[physical_tile ->index ][to_phy_pin ];
85
90
86
91
// Identify potential macro head blocks (i.e. start of a macro)
87
92
//
@@ -97,9 +102,11 @@ static void find_all_the_macro(int* num_of_macro, std::vector<ClusterBlockId>& p
97
102
|| (is_constant_clb_net (to_net_id)
98
103
&& !net_is_driven_by_direct (to_net_id)))) {
99
104
for (from_iblk_pin = 0 ; from_iblk_pin < num_blk_pins; from_iblk_pin++) {
105
+ int from_phy_pin = get_physical_pin (physical_tile, logical_block, from_iblk_pin);
106
+
100
107
from_net_id = cluster_ctx.clb_nlist .block_net (blk_id, from_iblk_pin);
101
- from_idirect = f_idirect_from_blk_pin[cluster_ctx. clb_nlist . block_type (blk_id) ->index ][from_iblk_pin ];
102
- from_src_or_sink = f_direct_type_from_blk_pin[cluster_ctx. clb_nlist . block_type (blk_id) ->index ][from_iblk_pin ];
108
+ from_idirect = f_idirect_from_blk_pin[physical_tile ->index ][from_phy_pin ];
109
+ from_src_or_sink = f_direct_type_from_blk_pin[physical_tile ->index ][from_phy_pin ];
103
110
104
111
// Confirm whether this is a head macro
105
112
//
@@ -129,8 +136,8 @@ static void find_all_the_macro(int* num_of_macro, std::vector<ClusterBlockId>& p
129
136
next_blk_id = cluster_ctx.clb_nlist .net_pin_block (curr_net_id, 1 );
130
137
131
138
// Assume that the from_iblk_pin index is the same for the next block
132
- VTR_ASSERT (f_idirect_from_blk_pin[cluster_ctx. clb_nlist . block_type (next_blk_id) ->index ][from_iblk_pin ] == from_idirect
133
- && f_direct_type_from_blk_pin[cluster_ctx. clb_nlist . block_type (next_blk_id) ->index ][from_iblk_pin ] == SOURCE);
139
+ VTR_ASSERT (f_idirect_from_blk_pin[physical_tile ->index ][from_phy_pin ] == from_idirect
140
+ && f_direct_type_from_blk_pin[physical_tile ->index ][from_phy_pin ] == SOURCE);
134
141
next_net_id = cluster_ctx.clb_nlist .block_net (next_blk_id, from_iblk_pin);
135
142
136
143
// Mark down this block as a member of the macro
0 commit comments