@@ -43,17 +43,13 @@ static void log_single_overused_node_status(int overuse_index, RRNodeId inode);
43
43
*
44
44
* @param os The output stream to write the information to.
45
45
* @param physical_type The physical type of the block.
46
- * @param layer The layer number of the block.
47
- * @param root_x The x coordinate of the root of the block.
48
- * @param root_y The y coordinate of the root of the block.
46
+ * @param root_loc The coordinates of the root of the block.
49
47
* @param pin_physical_num The physical number of the pin.
50
48
* @param rr_node_to_net_map A map of RR nodes to the nets that pass through them.
51
49
*/
52
50
static void print_block_pins_nets (std::ostream& os,
53
51
t_physical_tile_type_ptr physical_type,
54
- int layer,
55
- int root_x,
56
- int root_y,
52
+ const t_physical_tile_loc& root_loc,
57
53
int pin_physical_num,
58
54
const std::map<RRNodeId, std::set<ParentNetId>>& rr_node_to_net_map);
59
55
/* *
@@ -231,31 +227,29 @@ static void report_overused_ipin_opin(std::ostream& os,
231
227
const auto & rr_graph = device_ctx.rr_graph ;
232
228
const auto & place_ctx = g_vpr_ctx.placement ();
233
229
234
- auto grid_x = rr_graph.node_xlow (node_id);
235
- auto grid_y = rr_graph.node_ylow (node_id);
236
- auto grid_layer = rr_graph.node_layer (node_id);
230
+ t_physical_tile_loc grid_loc;
231
+ grid_loc.x = rr_graph.node_xlow (node_id);
232
+ grid_loc.y = rr_graph.node_ylow (node_id);
233
+ grid_loc.layer_num = rr_graph.node_layer (node_id);
234
+ const t_physical_tile_type_ptr physical_type = device_ctx.grid .get_physical_type (grid_loc);
237
235
238
- VTR_ASSERT_MSG (
239
- grid_x == rr_graph.node_xhigh (node_id) && grid_y == rr_graph.node_yhigh (node_id),
240
- " Non-track RR node should not span across multiple grid blocks." );
236
+ VTR_ASSERT_MSG (grid_loc.x == rr_graph.node_xhigh (node_id) && grid_loc.y == rr_graph.node_yhigh (node_id),
237
+ " Non-track RR node should not span across multiple grid blocks." );
241
238
242
239
os << " Pin physical number = " << rr_graph.node_pin_num (node_id) << ' \n ' ;
243
240
if (is_inter_cluster_node (rr_graph, node_id)) {
244
241
os << " On Tile Pin"
245
242
<< " \n " ;
246
243
} else {
247
- auto pb_type_name = get_pb_graph_node_from_pin_physical_num (device_ctx.grid .get_physical_type ({grid_x, grid_y, grid_layer} ),
244
+ auto pb_type_name = get_pb_graph_node_from_pin_physical_num (device_ctx.grid .get_physical_type (grid_loc ),
248
245
rr_graph.node_ptc_num (node_id))
249
246
->pb_type ->name ;
250
- auto pb_pin = get_pb_pin_from_pin_physical_num (device_ctx.grid .get_physical_type ({grid_x, grid_y, grid_layer}),
251
- rr_graph.node_ptc_num (node_id));
247
+ auto pb_pin = get_pb_pin_from_pin_physical_num (physical_type, rr_graph.node_ptc_num (node_id));
252
248
os << " Intra-Tile Pin - Port : " << pb_pin->port ->name << " - PB Type : " << std::string (pb_type_name) << " \n " ;
253
249
}
254
250
print_block_pins_nets (os,
255
- device_ctx.grid .get_physical_type ({grid_x, grid_y, grid_layer}),
256
- grid_layer,
257
- grid_x - device_ctx.grid .get_width_offset ({grid_x, grid_y, grid_layer}),
258
- grid_y - device_ctx.grid .get_height_offset ({grid_x, grid_y, grid_layer}),
251
+ physical_type,
252
+ device_ctx.grid .get_root_location (grid_loc),
259
253
rr_graph.node_ptc_num (node_id),
260
254
rr_node_to_net_map);
261
255
os << " Side = " << rr_graph.node_side_string (node_id) << " \n\n " ;
@@ -264,19 +258,19 @@ static void report_overused_ipin_opin(std::ostream& os,
264
258
const auto & clb_nlist = g_vpr_ctx.clustering ().clb_nlist ;
265
259
const auto & grid_info = place_ctx.grid_blocks ();
266
260
267
- os << " Grid location: X = " << grid_x << " , Y = " << grid_y << ' \n ' ;
268
- os << " Number of blocks currently occupying this grid location = " << grid_info.get_usage ({grid_x, grid_y, grid_layer} ) << ' \n ' ;
261
+ os << " Grid location: X = " << grid_loc. x << " , Y = " << grid_loc. y << ' \n ' ;
262
+ os << " Number of blocks currently occupying this grid location = " << grid_info.get_usage (grid_loc ) << ' \n ' ;
269
263
270
264
size_t iblock = 0 ;
271
- for (int isubtile = 0 ; isubtile < (int )grid_info.num_blocks_at_location ({grid_x, grid_y, grid_layer} ); ++isubtile) {
265
+ for (int isubtile = 0 ; isubtile < (int )grid_info.num_blocks_at_location (grid_loc ); ++isubtile) {
272
266
// Check if there is a valid block at this subtile location
273
- if (grid_info.is_sub_tile_empty ({grid_x, grid_y, grid_layer} , isubtile)) {
267
+ if (grid_info.is_sub_tile_empty (grid_loc , isubtile)) {
274
268
continue ;
275
269
}
276
270
277
271
// Print out the block index, name and type
278
272
// TODO: Needs to be updated when RR Graph Nodes know their layer_num
279
- ClusterBlockId block_id = grid_info.block_at_location ({grid_x, grid_y, isubtile, grid_layer });
273
+ ClusterBlockId block_id = grid_info.block_at_location ({grid_loc, isubtile});
280
274
os << " Block #" << iblock << " : " ;
281
275
os << " Block name = " << clb_nlist.block_pb (block_id)->name << " , " ;
282
276
os << " Block type = " << clb_nlist.block_type (block_id)->name << ' \n ' ;
@@ -459,9 +453,7 @@ static void log_single_overused_node_status(int overuse_index, RRNodeId node_id)
459
453
460
454
static void print_block_pins_nets (std::ostream& os,
461
455
t_physical_tile_type_ptr physical_type,
462
- int layer,
463
- int root_x,
464
- int root_y,
456
+ const t_physical_tile_loc& root_loc,
465
457
int pin_physical_num,
466
458
const std::map<RRNodeId, std::set<ParentNetId>>& rr_node_to_net_map) {
467
459
const auto & rr_graph = g_vpr_ctx.device ().rr_graph ;
@@ -489,7 +481,7 @@ static void print_block_pins_nets(std::ostream& os,
489
481
490
482
for (int pin = pin_num_range.low ; pin <= pin_num_range.high ; pin++) {
491
483
e_rr_type rr_type = (get_pin_type_from_pin_physical_num (physical_type, pin) == e_pin_type::DRIVER) ? e_rr_type::OPIN : e_rr_type::IPIN;
492
- RRNodeId node_id = get_pin_rr_node_id (rr_graph.node_lookup (), physical_type, layer, root_x, root_y , pin);
484
+ RRNodeId node_id = get_pin_rr_node_id (rr_graph.node_lookup (), physical_type, root_loc , pin);
493
485
// When flat router is enabled, RR Node chains collapse into a single node. Thus, when
494
486
// looking up the RR Node ID, it may return an invalid node ID. In this case, we skip
495
487
// this pin.
0 commit comments