@@ -242,10 +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 layer_num_str; // layer number
245+ std::string start_layer_str; // layer number
246+ std::string end_layer_str; // layer number
246247 std::string arrow; // direction arrow
247248 std::string coordinate_string = node_type_string (node); // write the component's type as a routing resource node
248249 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);
249252 if (node_type (node) == OPIN || node_type (node) == IPIN) {
250253 coordinate_string += " side: (" ; // add the side of the routing resource node
251254 for (const e_side& node_side : SIDES) {
@@ -259,12 +262,12 @@ class RRGraphView {
259262 // and the end to the lower coordinate
260263 start_x = " (" + std::to_string (node_xhigh (node)) + " ," ; // start and end coordinates are the same for OPINs and IPINs
261264 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 ) + " )" ;
263266 } else if (node_type (node) == SOURCE || node_type (node) == SINK) {
264267 // For SOURCE and SINK the starting and ending coordinate are identical, so just use start
265268 start_x = " (" + std::to_string (node_xhigh (node)) + " ," ;
266269 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 ) + " )" ;
268271 } else if (node_type (node) == CHANX || node_type (node) == CHANY) { // for channels, we would like to describe the component with segment specific information
269272 RRIndexedDataId cost_index = node_cost_index (node);
270273 int seg_index = rr_indexed_data_[cost_index].seg_index ;
@@ -278,26 +281,28 @@ class RRGraphView {
278281
279282 start_x = " (" + std::to_string (node_xhigh (node)) + " ," ; // start coordinates have large value
280283 start_y = std::to_string (node_yhigh (node)) + " ," ;
284+ start_layer_str = std::to_string (node_layer_num);
281285 end_x = " (" + std::to_string (node_xlow (node)) + " ," ; // end coordinates have smaller value
282286 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 ) + " )" ;
284288 }
285289
286290 else { // signal travels in increasing direction, stays at same point, or can travel both directions
287291 start_x = " (" + std::to_string (node_xlow (node)) + " ," ; // start coordinates have smaller value
288292 start_y = std::to_string (node_ylow (node)) + " ," ;
293+ start_layer_str = std::to_string (node_layer_num);
289294 end_x = " (" + std::to_string (node_xhigh (node)) + " ," ; // end coordinates have larger value
290295 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
292297 if (node_direction (node) == Direction::BIDIR) {
293298 arrow = " <->" ; // indicate that signal can travel both direction
294299 }
295300 }
296301 }
297302
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
299304 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
301306 return coordinate_string;
302307 }
303308
0 commit comments