@@ -180,11 +180,13 @@ struct RR_Graph_Builder {
180
180
181
181
std::unordered_map<std::tuple<int , int >,
182
182
int ,
183
- hash_tuple::hash<std::tuple<int ,int >>> wire_to_node_;
183
+ hash_tuple::hash<std::tuple<int , int >>>
184
+ wire_to_node_;
184
185
std::unordered_map<int , std::set<location>> node_to_locs_;
185
186
std::unordered_map<std::tuple<int , int > /* <node, tile_id>*/ ,
186
187
int /* segment type*/ ,
187
- hash_tuple::hash<std::tuple<int ,int >>> node_tile_to_segment_;
188
+ hash_tuple::hash<std::tuple<int , int >>>
189
+ node_tile_to_segment_;
188
190
std::unordered_map<int , std::pair<float , float >> node_to_RC_;
189
191
int total_node_count_;
190
192
@@ -445,7 +447,7 @@ struct RR_Graph_Builder {
445
447
int max_height = 0 ;
446
448
for (const auto & tile : ar_.getTileList ()) {
447
449
tile_to_loc_[tile.getName ()] = location (tile.getCol () + 1 , tile.getRow () + 1 );
448
- max_height = std::max (max_height, (int )(tile.getRow () +1 ));
450
+ max_height = std::max (max_height, (int )(tile.getRow () + 1 ));
449
451
loc_to_tile_[location (tile.getCol () + 1 , tile.getRow () + 1 )] = tile.getName ();
450
452
}
451
453
/* tile with name -1 is assosiated with constant source tile */
@@ -463,7 +465,7 @@ struct RR_Graph_Builder {
463
465
int tile_id = tile.getName ();
464
466
auto tile_type = ar_.getTileTypeList ()[tile.getType ()];
465
467
auto wires = tile_type.getWires ();
466
- for (const auto & constant : tile_type.getConstants ()){
468
+ for (const auto & constant : tile_type.getConstants ()) {
467
469
int const_id = constant.getConstant () == Device::ConstantType::VCC ? 1 : 0 ;
468
470
for (const auto wire_id : constant.getWires ()) {
469
471
wire_to_node_[std::make_tuple (tile_id, wires[wire_id])] = const_id;
@@ -493,37 +495,37 @@ struct RR_Graph_Builder {
493
495
494
496
void create_uniq_node_ids () {
495
497
/*
496
- Process constant sources
497
- */
498
+ * Process constant sources
499
+ */
498
500
process_const_nodes ();
499
501
/*
500
- Process nodes
501
- */
502
+ * Process nodes
503
+ */
502
504
int id = 2 ;
503
505
bool constant_node;
504
506
int node_id;
505
507
for (const auto & node : ar_.getNodes ()) {
506
508
constant_node = false ;
507
509
/*
508
- Nodes connected to constant sources should be combined into single constant node
509
- */
510
+ * Nodes connected to constant sources should be combined into single constant node
511
+ */
510
512
for (const auto & wire_id_ : node.getWires ()) {
511
513
const auto & wire = ar_.getWires ()[wire_id_];
512
514
int tile_id = wire.getTile ();
513
515
int wire_id = wire.getWire ();
514
- if (wire_to_node_.find (std::make_tuple (tile_id, wire_id)) != wire_to_node_.end () &&
515
- wire_to_node_[std::make_tuple (tile_id, wire_id)] < 2 ) {
516
+ if (wire_to_node_.find (std::make_tuple (tile_id, wire_id)) != wire_to_node_.end () && wire_to_node_[std::make_tuple (tile_id, wire_id)] < 2 ) {
516
517
constant_node = true ;
517
518
node_id = wire_to_node_[std::make_tuple (tile_id, wire_id)];
518
519
}
519
520
}
520
- if (!constant_node){
521
+ if (!constant_node) {
521
522
node_id = id++;
522
523
}
523
524
float capacitance = 0.0 , resistance = 0.0 ; // Some random data
524
525
if (node_to_RC_.find (node_id) == node_to_RC_.end ()) {
525
526
node_to_RC_[node_id] = std::pair<float , float >(0 , 0 );
526
- capacitance = 0.000000001 ; resistance = 5.7 ;
527
+ capacitance = 0.000000001 ;
528
+ resistance = 5.7 ;
527
529
}
528
530
if (ar_.hasNodeTimings ()) {
529
531
auto model = ar_.getNodeTimings ()[node.getNodeTiming ()];
@@ -536,7 +538,7 @@ struct RR_Graph_Builder {
536
538
if (constant_node) {
537
539
const auto & wires = ar_.getWires ();
538
540
std::tuple<int , int > base_wire_ (wires[node.getWires ()[0 ]].getTile (), wires[node.getWires ()[0 ]].getWire ());
539
- VTR_LOG (" Constant_node: %s\n " , wire_to_node_[base_wire_] == 1 ? " VCC\0 " : " GND\0 " );
541
+ VTR_LOG (" Constant_node: %s\n " , wire_to_node_[base_wire_] == 1 ? " VCC\0 " : " GND\0 " );
540
542
for (const auto & wire_id_ : node.getWires ()) {
541
543
const auto & wire = ar_.getWires ()[wire_id_];
542
544
int tile_id = wire.getTile ();
@@ -583,7 +585,7 @@ struct RR_Graph_Builder {
583
585
node0 = wire_to_node_[std::make_tuple (tile_id, wire0_name)];
584
586
node1 = wire_to_node_[std::make_tuple (tile_id, wire1_name)];
585
587
// Allow for pseudopips that connect from/to VCC/GND
586
- if (pip.isPseudoCells () && (node0 > 1 && node1> 1 ))
588
+ if (pip.isPseudoCells () && (node0 > 1 && node1 > 1 ))
587
589
continue ;
588
590
589
591
used_by_pip_.emplace (node0, loc);
@@ -1102,10 +1104,10 @@ struct RR_Graph_Builder {
1102
1104
bool ry, rx;
1103
1105
for (auto i : nodes_in_chanys) {
1104
1106
location node = i;
1105
- if (nodes_in_chanxs.find (i) != nodes_in_chanxs.end ()){
1107
+ if (nodes_in_chanxs.find (i) != nodes_in_chanxs.end ()) {
1106
1108
ry = local_redirect_y.find (node) != local_redirect_y.end ();
1107
1109
rx = local_redirect_x.find (node) != local_redirect_x.end ();
1108
- location x,y;
1110
+ location x, y;
1109
1111
if (rx)
1110
1112
x = node;
1111
1113
else
@@ -1256,10 +1258,10 @@ struct RR_Graph_Builder {
1256
1258
}
1257
1259
}
1258
1260
/*
1259
- Add constant ource
1260
- */
1261
+ * Add constant ource
1262
+ */
1261
1263
sink_source_loc_map_[-1 ].resize (2 );
1262
- for ( auto i : {0 , 1 }) {
1264
+ for (auto i : {0 , 1 }) {
1263
1265
location loc = tile_to_loc_[-1 ];
1264
1266
used_by_pin_.insert (std::make_tuple (i, loc));
1265
1267
usefull_node_.insert (i);
@@ -1502,7 +1504,7 @@ struct RR_Graph_Builder {
1502
1504
1503
1505
device_ctx_.rr_graph_builder .emplace_back_edge (RRNodeId (src),
1504
1506
RRNodeId (sink_src),
1505
- src == track_id ? 1 :0 );
1507
+ src == track_id ? 1 : 0 );
1506
1508
device_ctx_.rr_graph_builder .emplace_back_edge (RRNodeId (sink_src),
1507
1509
RRNodeId (sink),
1508
1510
sink == track_id ? 1 : 0 );
0 commit comments