Skip to content

Commit

Permalink
Fixed write rr_graph GSB writing
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshgore committed Jan 24, 2025
1 parent 0a8ba7b commit c914b95
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions openfpga/src/annotation/write_xml_device_rr_gsb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,24 @@ static void write_rr_gsb_ipin_connection_to_xml(std::fstream& fp,
continue;
}

enum e_side chan_side = rr_gsb.get_cb_chan_side(gsb_side);
SideManager chan_side_manager(chan_side);

/* For channel node, we do not know the node direction
* But we are pretty sure it is either IN_PORT or OUT_PORT
* So we just try and find what is valid
*/
int driver_node_index =
rr_gsb.get_chan_node_index(chan_side, driver_node);
e_side chan_side;
SideManager chan_side_manager = SideManager();
int driver_node_index = -1;

for (size_t side = 0; side < NUM_2D_SIDES; ++side) {
chan_side_manager.set_side(side);
chan_side = chan_side_manager.get_side();
for (PORTS port_direc : {IN_PORT, OUT_PORT}) {
/* For channel node, we do not know the node direction
* But we are pretty sure it is either IN_PORT or OUT_PORT
* So we just try and find what is valid
*/
driver_node_index = rr_gsb.get_chan_node_index(chan_side, driver_node);
if (-1 != driver_node_index) { break; }
}
if (-1 != driver_node_index) { break;}
}

/* We must have a valide node index */
VTR_ASSERT(-1 != driver_node_index);

Expand Down

0 comments on commit c914b95

Please sign in to comment.