@@ -242,10 +242,13 @@ class RRGraphView {
242
242
std::string start_y; // start y-coordinate
243
243
std::string end_x; // end x-coordinate
244
244
std::string end_y; // end y-coordinate
245
- std::string layer_num_str; // layer number
245
+ std::string start_layer_str; // layer number
246
+ std::string end_layer_str; // layer number
246
247
std::string arrow; // direction arrow
247
248
std::string coordinate_string = node_type_string (node); // write the component's type as a routing resource node
248
249
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);
249
252
if (node_type (node) == OPIN || node_type (node) == IPIN) {
250
253
coordinate_string += " side: (" ; // add the side of the routing resource node
251
254
for (const e_side& node_side : SIDES) {
@@ -259,12 +262,12 @@ class RRGraphView {
259
262
// and the end to the lower coordinate
260
263
start_x = " (" + std::to_string (node_xhigh (node)) + " ," ; // start and end coordinates are the same for OPINs and IPINs
261
264
start_y = std::to_string (node_yhigh (node)) + " ," ;
262
- layer_num_str = std::to_string (node_layer (node) ) + " )" ;
265
+ start_layer_str = std::to_string (node_layer_num ) + " )" ;
263
266
} else if (node_type (node) == SOURCE || node_type (node) == SINK) {
264
267
// For SOURCE and SINK the starting and ending coordinate are identical, so just use start
265
268
start_x = " (" + std::to_string (node_xhigh (node)) + " ," ;
266
269
start_y = std::to_string (node_yhigh (node)) + " ," ;
267
- layer_num_str = std::to_string (node_layer (node) ) + " )" ;
270
+ start_layer_str = std::to_string (node_layer_num ) + " )" ;
268
271
} else if (node_type (node) == CHANX || node_type (node) == CHANY) { // for channels, we would like to describe the component with segment specific information
269
272
RRIndexedDataId cost_index = node_cost_index (node);
270
273
int seg_index = rr_indexed_data_[cost_index].seg_index ;
@@ -278,26 +281,28 @@ class RRGraphView {
278
281
279
282
start_x = " (" + std::to_string (node_xhigh (node)) + " ," ; // start coordinates have large value
280
283
start_y = std::to_string (node_yhigh (node)) + " ," ;
284
+ start_layer_str = std::to_string (node_layer_num);
281
285
end_x = " (" + std::to_string (node_xlow (node)) + " ," ; // end coordinates have smaller value
282
286
end_y = std::to_string (node_ylow (node)) + " ," ;
283
- layer_num_str = std::to_string (node_layer (node) ) + " )" ;
287
+ end_layer_str = std::to_string (node_layer_num ) + " )" ;
284
288
}
285
289
286
290
else { // signal travels in increasing direction, stays at same point, or can travel both directions
287
291
start_x = " (" + std::to_string (node_xlow (node)) + " ," ; // start coordinates have smaller value
288
292
start_y = std::to_string (node_ylow (node)) + " ," ;
293
+ start_layer_str = std::to_string (node_layer_num);
289
294
end_x = " (" + std::to_string (node_xhigh (node)) + " ," ; // end coordinates have larger value
290
295
end_y = std::to_string (node_yhigh (node)) + " ," ;
291
- layer_num_str = std::to_string (node_layer (node) ) + " )" ; // layer number
296
+ end_layer_str = std::to_string (node_layer_num ) + " )" ; // layer number
292
297
if (node_direction (node) == Direction::BIDIR) {
293
298
arrow = " <->" ; // indicate that signal can travel both direction
294
299
}
295
300
}
296
301
}
297
302
298
- coordinate_string += start_x + start_y + layer_num_str ; // Write the starting coordinates
303
+ coordinate_string += start_x + start_y + start_layer_str ; // Write the starting coordinates
299
304
coordinate_string += arrow; // Indicate the direction
300
- coordinate_string += end_x + end_y + layer_num_str ; // Write the end coordinates
305
+ coordinate_string += end_x + end_y + end_layer_str ; // Write the end coordinates
301
306
return coordinate_string;
302
307
}
303
308
0 commit comments