Skip to content

Commit 4999259

Browse files
mtdudekacomodi
authored andcommitted
Format code
Signed-off-by: Maciej Dudek <[email protected]>
1 parent 2b07f60 commit 4999259

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

libs/libarchfpga/src/read_fpga_interchange_arch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,7 +2223,7 @@ struct ArchReader {
22232223
// The constant source tile will be placed at (1, max_height)
22242224
t_grid_loc_def constant(const_block_, 1);
22252225
constant.x.start_expr = std::to_string(1);
2226-
constant.y.start_expr = std::to_string(grid_def.height -1);
2226+
constant.y.start_expr = std::to_string(grid_def.height - 1);
22272227

22282228
constant.x.end_expr = constant.x.start_expr + " + w - 1";
22292229
constant.y.end_expr = constant.y.start_expr + " + h - 1";

vpr/src/route/rr_graph_fpga_interchange.cpp

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,13 @@ struct RR_Graph_Builder {
180180

181181
std::unordered_map<std::tuple<int, int>,
182182
int,
183-
hash_tuple::hash<std::tuple<int,int>>> wire_to_node_;
183+
hash_tuple::hash<std::tuple<int, int>>>
184+
wire_to_node_;
184185
std::unordered_map<int, std::set<location>> node_to_locs_;
185186
std::unordered_map<std::tuple<int, int> /*<node, tile_id>*/,
186187
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_;
188190
std::unordered_map<int, std::pair<float, float>> node_to_RC_;
189191
int total_node_count_;
190192

@@ -445,7 +447,7 @@ struct RR_Graph_Builder {
445447
int max_height = 0;
446448
for (const auto& tile : ar_.getTileList()) {
447449
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));
449451
loc_to_tile_[location(tile.getCol() + 1, tile.getRow() + 1)] = tile.getName();
450452
}
451453
/* tile with name -1 is assosiated with constant source tile */
@@ -463,7 +465,7 @@ struct RR_Graph_Builder {
463465
int tile_id = tile.getName();
464466
auto tile_type = ar_.getTileTypeList()[tile.getType()];
465467
auto wires = tile_type.getWires();
466-
for (const auto& constant : tile_type.getConstants()){
468+
for (const auto& constant : tile_type.getConstants()) {
467469
int const_id = constant.getConstant() == Device::ConstantType::VCC ? 1 : 0;
468470
for (const auto wire_id : constant.getWires()) {
469471
wire_to_node_[std::make_tuple(tile_id, wires[wire_id])] = const_id;
@@ -493,37 +495,37 @@ struct RR_Graph_Builder {
493495

494496
void create_uniq_node_ids() {
495497
/*
496-
Process constant sources
497-
*/
498+
* Process constant sources
499+
*/
498500
process_const_nodes();
499501
/*
500-
Process nodes
501-
*/
502+
* Process nodes
503+
*/
502504
int id = 2;
503505
bool constant_node;
504506
int node_id;
505507
for (const auto& node : ar_.getNodes()) {
506508
constant_node = false;
507509
/*
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+
*/
510512
for (const auto& wire_id_ : node.getWires()) {
511513
const auto& wire = ar_.getWires()[wire_id_];
512514
int tile_id = wire.getTile();
513515
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) {
516517
constant_node = true;
517518
node_id = wire_to_node_[std::make_tuple(tile_id, wire_id)];
518519
}
519520
}
520-
if (!constant_node){
521+
if (!constant_node) {
521522
node_id = id++;
522523
}
523524
float capacitance = 0.0, resistance = 0.0; // Some random data
524525
if (node_to_RC_.find(node_id) == node_to_RC_.end()) {
525526
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;
527529
}
528530
if (ar_.hasNodeTimings()) {
529531
auto model = ar_.getNodeTimings()[node.getNodeTiming()];
@@ -536,7 +538,7 @@ struct RR_Graph_Builder {
536538
if (constant_node) {
537539
const auto& wires = ar_.getWires();
538540
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");
540542
for (const auto& wire_id_ : node.getWires()) {
541543
const auto& wire = ar_.getWires()[wire_id_];
542544
int tile_id = wire.getTile();
@@ -583,7 +585,7 @@ struct RR_Graph_Builder {
583585
node0 = wire_to_node_[std::make_tuple(tile_id, wire0_name)];
584586
node1 = wire_to_node_[std::make_tuple(tile_id, wire1_name)];
585587
// 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))
587589
continue;
588590

589591
used_by_pip_.emplace(node0, loc);
@@ -1102,10 +1104,10 @@ struct RR_Graph_Builder {
11021104
bool ry, rx;
11031105
for (auto i : nodes_in_chanys) {
11041106
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()) {
11061108
ry = local_redirect_y.find(node) != local_redirect_y.end();
11071109
rx = local_redirect_x.find(node) != local_redirect_x.end();
1108-
location x,y;
1110+
location x, y;
11091111
if (rx)
11101112
x = node;
11111113
else
@@ -1256,10 +1258,10 @@ struct RR_Graph_Builder {
12561258
}
12571259
}
12581260
/*
1259-
Add constant ource
1260-
*/
1261+
* Add constant ource
1262+
*/
12611263
sink_source_loc_map_[-1].resize(2);
1262-
for ( auto i : {0, 1}) {
1264+
for (auto i : {0, 1}) {
12631265
location loc = tile_to_loc_[-1];
12641266
used_by_pin_.insert(std::make_tuple(i, loc));
12651267
usefull_node_.insert(i);
@@ -1502,7 +1504,7 @@ struct RR_Graph_Builder {
15021504

15031505
device_ctx_.rr_graph_builder.emplace_back_edge(RRNodeId(src),
15041506
RRNodeId(sink_src),
1505-
src == track_id ? 1 :0);
1507+
src == track_id ? 1 : 0);
15061508
device_ctx_.rr_graph_builder.emplace_back_edge(RRNodeId(sink_src),
15071509
RRNodeId(sink),
15081510
sink == track_id ? 1 : 0);

0 commit comments

Comments
 (0)