@@ -1269,17 +1269,14 @@ static void load_block_rr_indices(RRGraphBuilder& rr_graph_builder,
1269
1269
for (int x = 0 ; x < (int )grid.width (); x++) {
1270
1270
for (int y = 0 ; y < (int )grid.height (); y++) {
1271
1271
// Process each block from its root location
1272
- if (grid.get_width_offset ({x, y, layer}) == 0 && grid.get_height_offset ({x, y, layer}) == 0 ) {
1273
- t_physical_tile_type_ptr physical_type = grid.get_physical_type ({x,
1274
- y,
1275
- layer});
1272
+ if (grid.is_root_location ({x, y, layer})) {
1273
+ t_physical_tile_type_ptr physical_type = grid.get_physical_type ({x, y, layer});
1274
+
1276
1275
// Assign indices for SINKs and SOURCEs
1277
1276
// Note that SINKS/SOURCES have no side, so we always use side 0
1278
- std::vector<int > class_num_vec;
1279
- std::vector<int > pin_num_vec;
1277
+ std::vector<int > class_num_vec = get_tile_root_classes (physical_type) ;
1278
+ std::vector<int > pin_num_vec = get_tile_root_pins (physical_type) ;
1280
1279
1281
- class_num_vec = get_tile_root_classes (physical_type);
1282
- pin_num_vec = get_tile_root_pins (physical_type);
1283
1280
add_classes_spatial_lookup (rr_graph_builder,
1284
1281
physical_type,
1285
1282
class_num_vec,
@@ -1376,17 +1373,14 @@ static void add_pins_spatial_lookup(RRGraphBuilder& rr_graph_builder,
1376
1373
}
1377
1374
}
1378
1375
1379
- for (auto pin_num : pin_num_vec) {
1376
+ for (const int pin_num : pin_num_vec) {
1380
1377
bool assigned_to_rr_node = false ;
1381
- std::vector<int > x_offset;
1382
- std::vector<int > y_offset;
1383
- std::vector<e_side> pin_sides;
1384
- std::tie (x_offset, y_offset, pin_sides) = get_pin_coordinates (physical_type_ptr, pin_num, wanted_sides);
1385
- auto pin_type = get_pin_type_from_pin_physical_num (physical_type_ptr, pin_num);
1378
+ const auto [x_offset, y_offset, pin_sides] = get_pin_coordinates (physical_type_ptr, pin_num, wanted_sides);
1379
+ e_pin_type pin_type = get_pin_type_from_pin_physical_num (physical_type_ptr, pin_num);
1386
1380
for (int pin_coord_idx = 0 ; pin_coord_idx < (int )pin_sides.size (); pin_coord_idx++) {
1387
1381
int x_tile = root_x + x_offset[pin_coord_idx];
1388
1382
int y_tile = root_y + y_offset[pin_coord_idx];
1389
- auto side = pin_sides[pin_coord_idx];
1383
+ e_side side = pin_sides[pin_coord_idx];
1390
1384
if (pin_type == DRIVER) {
1391
1385
rr_graph_builder.node_lookup ().add_node (RRNodeId (*index ), layer, x_tile, y_tile, OPIN, pin_num, side);
1392
1386
assigned_to_rr_node = true ;
@@ -1429,8 +1423,8 @@ static void add_classes_spatial_lookup(RRGraphBuilder& rr_graph_builder,
1429
1423
}
1430
1424
}
1431
1425
1432
- for (auto class_num : class_num_vec) {
1433
- auto class_type = get_class_type_from_class_physical_num (physical_type_ptr, class_num);
1426
+ for (const int class_num : class_num_vec) {
1427
+ e_pin_type class_type = get_class_type_from_class_physical_num (physical_type_ptr, class_num);
1434
1428
e_rr_type node_type = SINK;
1435
1429
if (class_type == DRIVER) {
1436
1430
node_type = SOURCE;
@@ -1451,16 +1445,7 @@ static void add_classes_spatial_lookup(RRGraphBuilder& rr_graph_builder,
1451
1445
}
1452
1446
}
1453
1447
1454
- /* As the rr_indices builders modify a local copy of indices, use the local copy in the builder
1455
- * TODO: these building functions should only talk to a RRGraphBuilder object
1456
- * The biggest and fatal issue is
1457
- * - the rr_graph2.h is included in the rr_graph_storage.h,
1458
- * which is included in the rr_graph_builder.h
1459
- * If we include rr_graph_builder.h in rr_graph2.h, this creates a loop
1460
- * for C++ compiler to identify data structures, which cannot be solved!!!
1461
- * This will block us when putting the RRGraphBuilder object as an input arguement
1462
- * of this function
1463
- */
1448
+ /* As the rr_indices builders modify a local copy of indices, use the local copy in the builder */
1464
1449
void alloc_and_load_rr_node_indices (RRGraphBuilder& rr_graph_builder,
1465
1450
const t_chan_width* nodes_per_chan,
1466
1451
const DeviceGrid& grid,
0 commit comments