Skip to content

Commit dc870aa

Browse files
committed
fix how node layer is shown for rr node
1 parent c036b0b commit dc870aa

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

libs/librrgraph/src/base/rr_graph_view.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,13 @@ class RRGraphView {
242242
std::string start_y; //start y-coordinate
243243
std::string end_x; //end x-coordinate
244244
std::string end_y; //end y-coordinate
245-
std::string start_layer_num; //layer number
246-
std::string end_layer_num; //layer number
245+
std::string start_layer_str; //layer number
246+
std::string end_layer_str; //layer number
247247
std::string arrow; //direction arrow
248248
std::string coordinate_string = node_type_string(node); //write the component's type as a routing resource node
249249
coordinate_string += ":" + std::to_string(size_t(node)) + " "; //add the index of the routing resource node
250+
251+
int node_layer_num = node_layer(node);
250252
if (node_type(node) == OPIN || node_type(node) == IPIN) {
251253
coordinate_string += "side: ("; //add the side of the routing resource node
252254
for (const e_side& node_side : SIDES) {
@@ -260,12 +262,12 @@ class RRGraphView {
260262
// and the end to the lower coordinate
261263
start_x = " (" + std::to_string(node_xhigh(node)) + ","; //start and end coordinates are the same for OPINs and IPINs
262264
start_y = std::to_string(node_yhigh(node)) + ",";
263-
start_layer_num = std::to_string(node_layer(node)) + ")";
265+
start_layer_str = std::to_string(node_layer_num) + ")";
264266
} else if (node_type(node) == SOURCE || node_type(node) == SINK) {
265267
// For SOURCE and SINK the starting and ending coordinate are identical, so just use start
266268
start_x = " (" + std::to_string(node_xhigh(node)) + ",";
267269
start_y = std::to_string(node_yhigh(node)) + ",";
268-
start_layer_num = std::to_string(node_layer(node)) + ")";
270+
start_layer_str = std::to_string(node_layer_num) + ")";
269271
} else if (node_type(node) == CHANX || node_type(node) == CHANY) { //for channels, we would like to describe the component with segment specific information
270272
RRIndexedDataId cost_index = node_cost_index(node);
271273
int seg_index = rr_indexed_data_[cost_index].seg_index;
@@ -279,28 +281,28 @@ class RRGraphView {
279281

280282
start_x = " (" + std::to_string(node_xhigh(node)) + ","; //start coordinates have large value
281283
start_y = std::to_string(node_yhigh(node)) + ",";
282-
start_layer_num = std::to_string(node_layer(node));
284+
start_layer_str = std::to_string(node_layer_num);
283285
end_x = " (" + std::to_string(node_xlow(node)) + ","; //end coordinates have smaller value
284286
end_y = std::to_string(node_ylow(node)) + ",";
285-
end_layer_num = std::to_string(node_layer(node)) + ")";
287+
end_layer_str = std::to_string(node_layer_num) + ")";
286288
}
287289

288290
else { // signal travels in increasing direction, stays at same point, or can travel both directions
289291
start_x = " (" + std::to_string(node_xlow(node)) + ","; //start coordinates have smaller value
290292
start_y = std::to_string(node_ylow(node)) + ",";
291-
start_layer_num = std::to_string(node_layer(node));
293+
start_layer_str = std::to_string(node_layer_num);
292294
end_x = " (" + std::to_string(node_xhigh(node)) + ","; //end coordinates have larger value
293295
end_y = std::to_string(node_yhigh(node)) + ",";
294-
end_layer_num = std::to_string(node_layer(node)) + ")"; //layer number
296+
end_layer_str = std::to_string(node_layer_num) + ")"; //layer number
295297
if (node_direction(node) == Direction::BIDIR) {
296298
arrow = "<->"; //indicate that signal can travel both direction
297299
}
298300
}
299301
}
300302

301-
coordinate_string += start_x + start_y + start_layer_num; //Write the starting coordinates
303+
coordinate_string += start_x + start_y + start_layer_str; //Write the starting coordinates
302304
coordinate_string += arrow; //Indicate the direction
303-
coordinate_string += end_x + end_y + end_layer_num; //Write the end coordinates
305+
coordinate_string += end_x + end_y + end_layer_str; //Write the end coordinates
304306
return coordinate_string;
305307
}
306308

0 commit comments

Comments
 (0)