From d5d2372e2b1ae19829f4a95a5598cf54623ca7e1 Mon Sep 17 00:00:00 2001 From: Wang Yuanqi <101231450+Wang-Yuanqi-source@users.noreply.github.com> Date: Mon, 4 Nov 2024 10:30:54 +0800 Subject: [PATCH] Update tileable_rr_graph_node_builder.cpp --- .../tileable_rr_graph_node_builder.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/vpr/src/tileable_rr_graph/tileable_rr_graph_node_builder.cpp b/vpr/src/tileable_rr_graph/tileable_rr_graph_node_builder.cpp index b1bd7101e0..be325cfe35 100644 --- a/vpr/src/tileable_rr_graph/tileable_rr_graph_node_builder.cpp +++ b/vpr/src/tileable_rr_graph/tileable_rr_graph_node_builder.cpp @@ -82,15 +82,15 @@ static size_t estimate_num_grid_rr_nodes_by_type(const DeviceGrid& grids, } static size_t estimate_num_medium_rr_nodes(const DeviceGrid& grids, - const vtr::NdMatrix& vib_grid, + const VibDeviceGrid& vib_grid, const size_t& layer) { size_t num_grid_rr_nodes = 0; - VTR_ASSERT(grids.width() == vib_grid.dim_size(1) && grids.height() == vib_grid.dim_size(2)); + VTR_ASSERT(grids.width() == vib_grid.width() && grids.height() == vib_grid.height()); for (size_t ix = 0; ix < grids.width(); ++ix) { for (size_t iy = 0; iy < grids.height(); ++iy) { - const VibInf* vib = vib_grid[layer][ix][iy]; + const VibInf* vib = vib_grid.get_vib(layer, ix, iy); if (vib == nullptr) { VTR_LOGF_ERROR(__FILE__, __LINE__, "VIB at (%d, %d) is EMPTY!\n", ix, iy); @@ -363,7 +363,7 @@ static size_t estimate_num_chany_rr_nodes(const DeviceGrid& grids, * Estimate the number of nodes by each type in a routing resource graph ***********************************************************************/ static std::vector estimate_num_rr_nodes(const DeviceGrid& grids, - const vtr::NdMatrix& vib_grid, + const VibDeviceGrid& vib_grid, const size_t& layer, const vtr::Point& chan_width, const std::vector& segment_inf_x, @@ -434,7 +434,7 @@ static std::vector estimate_num_rr_nodes(const DeviceGrid& grids, void alloc_tileable_rr_graph_nodes(RRGraphBuilder& rr_graph_builder, vtr::vector& rr_node_driver_switches, const DeviceGrid& grids, - const vtr::NdMatrix& vib_grid, + const VibDeviceGrid& vib_grid, const size_t& layer, const vtr::Point& chan_width, const std::vector& segment_inf_x, @@ -689,13 +689,13 @@ static void load_one_grid_medium_nodes_basic_info(RRGraphBuilder& rr_graph_build std::vector& rr_rc_data, const size_t& layer, const vtr::Point& grid_coordinate, - const vtr::NdMatrix& vib_grid) { + const VibDeviceGrid& vib_grid) { - const VibInf* vib = vib_grid[layer][grid_coordinate.x()][grid_coordinate.y()]; + const VibInf* vib = vib_grid.get_vib(layer, grid_coordinate.x(), grid_coordinate.y()); size_t num_medium_nodes = vib->get_first_stages().size(); for (size_t i_medium = 0; i_medium < num_medium_nodes; i_medium++) { /* Create a new node and fill information */ - RRNodeId node = rr_graph_builder.create_node(layer, grid_coordinate.x(), grid_coordinate.y(), MEDIUM, i_medium, SIDES[0]); + RRNodeId node = rr_graph_builder.create_node(layer, grid_coordinate.x(), grid_coordinate.y(), MEDIUM, i_medium, TOTAL_2D_SIDES[0]); /* node bounding box */ rr_graph_builder.set_node_coordinates(node, grid_coordinate.x(), grid_coordinate.y(), @@ -726,7 +726,7 @@ static void load_grid_nodes_basic_info(RRGraphBuilder& rr_graph_builder, vtr::vector& rr_node_driver_switches, std::vector& rr_rc_data, const DeviceGrid& grids, - const vtr::NdMatrix& vib_grid, + const VibDeviceGrid& vib_grid, const size_t& layer, const RRSwitchId& wire_to_ipin_switch, const RRSwitchId& delayless_switch, @@ -804,15 +804,15 @@ static void load_grid_nodes_basic_info(RRGraphBuilder& rr_graph_builder, if (is_vib_arch) { /* Create medium nodes */ - VTR_ASSERT(grids.width() == vib_grid.dim_size(1) && grids.height() == vib_grid.dim_size(2)); + VTR_ASSERT(grids.width() == vib_grid.width() && grids.height() == vib_grid.height()); for (size_t iy = 0; iy < grids.height(); ++iy) { for (size_t ix = 0; ix < grids.width(); ++ix) { t_physical_tile_loc tile_loc(ix, iy, layer); - VTR_ASSERT(vib_grid[layer][ix][iy]->get_pbtype_name() == grids.get_physical_type(tile_loc)->name); + VTR_ASSERT(vib_grid.vib_pbtype_name(layer, ix, iy) == grids.get_physical_type(tile_loc)->name); vtr::Point grid_coordinate(ix, iy); - rr_graph_builder.node_lookup().reserve_nodes(layer, ix, iy, MEDIUM, vib_grid[layer][ix][iy]->get_first_stages().size(), SIDES[0]); + rr_graph_builder.node_lookup().reserve_nodes(layer, ix, iy, MEDIUM, vib_grid.num_medium_nodes(layer, ix, iy), TOTAL_2D_SIDES[0]); load_one_grid_medium_nodes_basic_info(rr_graph_builder, rr_node_driver_switches, @@ -1299,7 +1299,7 @@ void create_tileable_rr_graph_nodes(const RRGraphView& rr_graph, std::map>& rr_node_track_ids, std::vector& rr_rc_data, const DeviceGrid& grids, - const vtr::NdMatrix& vib_grid, + const VibDeviceGrid& vib_grid, const size_t& layer, const vtr::Point& chan_width, const std::vector& segment_inf_x,