Skip to content

Commit 6700da8

Browse files
update verify_rr_node_indices() to check for CHANZ
1 parent 76cd4fa commit 6700da8

File tree

3 files changed

+22
-59
lines changed

3 files changed

+22
-59
lines changed

libs/librrgraph/src/base/rr_spatial_lookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ std::vector<RRNodeId> RRSpatialLookup::find_grid_nodes_at_all_sides(int layer,
196196
}
197197

198198
std::vector<RRNodeId> nodes;
199-
/* Reserve space to avoid memory fragmentation */
199+
// Reserve space to avoid memory fragmentation
200200
size_t num_nodes = 0;
201201
for (e_side node_side : TOTAL_2D_SIDES) {
202202
num_nodes += find_nodes(layer,x, y, rr_type, node_side).size();

vpr/src/route/rr_graph_generation/rr_graph.cpp

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,6 @@ static void add_pins_rr_graph(RRGraphBuilder& rr_graph_builder,
256256
* the delay of these edges is not necessarily zero. If the primitive block which a SINK/SRC belongs to is a combinational block, the delay of
257257
* the edge is equal to the pin delay. This is done in order to make the router lookahead aware of the different IPIN delays. In this way, more critical
258258
* nets are routed to the pins with less delay.
259-
* @param rr_graph_builder
260-
* @param arch_sw_inf_map
261-
* @param class_num_vec
262-
* @param layer
263-
* @param i
264-
* @param j
265-
* @param rr_edges_to_create
266-
* @param delayless_switch
267-
* @param physical_type_ptr
268259
*/
269260
static void connect_tile_src_sink_to_pins(RRGraphBuilder& rr_graph_builder,
270261
std::map<int, t_arch_switch_inf>& arch_sw_inf_map,
@@ -436,17 +427,6 @@ static void add_pb_edges(RRGraphBuilder& rr_graph_builder,
436427

437428
/**
438429
* Edges going in/out of collapse nodes are not added by the normal routine. This function add those edges
439-
* @param rr_graph_builder
440-
* @param rr_edges_to_create
441-
* @param physical_type
442-
* @param logical_block
443-
* @param cluster_pins
444-
* @param nodes_to_collapse
445-
* @param R_minW_nmos
446-
* @param R_minW_pmos
447-
* @param layer
448-
* @param i
449-
* @param j
450430
* @return Number of the collapsed nodes
451431
*/
452432
static int add_edges_for_collapsed_nodes(RRGraphBuilder& rr_graph_builder,
@@ -462,23 +442,7 @@ static int add_edges_for_collapsed_nodes(RRGraphBuilder& rr_graph_builder,
462442
int j,
463443
bool load_rr_graph);
464444
/**
465-
* @note This function is used to add the fan-in edges of the given chain node to the chain's sink with the modified delay
466-
* @param rr_graph_builder
467-
* @param rr_edges_to_create
468-
* @param num_collapsed_pins
469-
* @param physical_type
470-
* @param logical_block
471-
* @param nodes_to_collapse
472-
* @param cluster_pins
473-
* @param chain_pins
474-
* @param R_minW_nmos
475-
* @param R_minW_pmos
476-
* @param chain_idx
477-
* @param node_idx
478-
* @param sink_pin_num
479-
* @param layer
480-
* @param i
481-
* @param j
445+
* @brief This function is used to add the fan-in edges of the given chain node to the chain's sink with the modified delay
482446
*/
483447
static void add_chain_node_fan_in_edges(RRGraphBuilder& rr_graph_builder,
484448
t_rr_edge_info_set& rr_edges_to_create,
@@ -604,26 +568,12 @@ static RRNodeId pick_best_direct_connect_target_rr_node(const RRGraphView& rr_gr
604568
RRNodeId from_rr,
605569
const std::vector<RRNodeId>& candidate_rr_nodes);
606570

607-
/**
608-
*
609-
* @param cluster_pins
610-
* @param physical_type
611-
* @param logical_block
612-
* @param is_flat
613-
* @return A structure containing
614-
*/
615571
static t_cluster_pin_chain get_cluster_directly_connected_nodes(const std::vector<int>& cluster_pins,
616572
t_physical_tile_type_ptr physical_type,
617573
t_logical_block_type_ptr logical_block,
618574
bool is_flat);
619575

620576
/**
621-
*
622-
* @param physical_type
623-
* @param logical_block
624-
* @param pins_in_cluster
625-
* @param pin_physical_num
626-
* @param is_flat
627577
* @return A chain of nodes starting from pin_physcical_num. All of the pins in this chain has a fan-out of 1
628578
*/
629579
static std::vector<int> get_directly_connected_nodes(t_physical_tile_type_ptr physical_type,
@@ -654,11 +604,6 @@ static int get_chain_idx(const std::vector<int>& pin_idx_vec, const std::vector<
654604

655605
/**
656606
* If pin chain is a part of a chain already added to all_chains, add the new parts to the corresponding chain. Otherwise, add pin_chain as a new chain to all_chains.
657-
* @param pin_chain
658-
* @param chain_idx
659-
* @param pin_index_vec
660-
* @param all_chains
661-
* @param is_new_chain
662607
*/
663608
static void add_pin_chain(const std::vector<int>& pin_chain,
664609
int chain_idx,
@@ -938,7 +883,7 @@ static void add_intra_tile_edges_rr_graph(RRGraphBuilder& rr_graph_builder,
938883
int layer,
939884
int i,
940885
int j) {
941-
auto pin_num_vec = get_flat_tile_pins(physical_tile);
886+
std::vector<int> pin_num_vec = get_flat_tile_pins(physical_tile);
942887
for (int pin_physical_num : pin_num_vec) {
943888
if (is_pin_on_tile(physical_tile, pin_physical_num)) {
944889
continue;

vpr/src/route/rr_graph_generation/rr_node_indices.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ bool verify_rr_node_indices(const DeviceGrid& grid,
466466
for (e_rr_type rr_type : RR_TYPES) {
467467
// Get the list of nodes at a specific location (x, y)
468468
std::vector<RRNodeId> nodes_from_lookup;
469-
if (rr_type == e_rr_type::CHANX || rr_type == e_rr_type::CHANY) {
469+
if (rr_type == e_rr_type::CHANX || rr_type == e_rr_type::CHANY || rr_type == e_rr_type::CHANZ) {
470470
nodes_from_lookup = rr_graph.node_lookup().find_channel_nodes(l, x, y, rr_type);
471471
} else {
472472
nodes_from_lookup = rr_graph.node_lookup().find_grid_nodes_at_all_sides(l, x, y, rr_type);
@@ -515,6 +515,24 @@ bool verify_rr_node_indices(const DeviceGrid& grid,
515515
y,
516516
describe_rr_node(rr_graph, grid, rr_indexed_data, inode, is_flat).c_str());
517517
}
518+
} else if (rr_graph.node_type(inode) == e_rr_type::CHANZ) {
519+
VTR_ASSERT_MSG(rr_graph.node_xlow(inode) == rr_graph.node_xhigh(inode), "CHANZ should move only along layers");
520+
VTR_ASSERT_MSG(rr_graph.node_ylow(inode) == rr_graph.node_yhigh(inode), "CHANZ should move only along layers");
521+
522+
if (x != rr_graph.node_xlow(inode)) {
523+
VPR_ERROR(VPR_ERROR_ROUTE, "RR node x position does not agree between rr_nodes (%d) and rr_node_indices (%d): %s",
524+
rr_graph.node_xlow(inode),
525+
x,
526+
describe_rr_node(rr_graph, grid, rr_indexed_data, inode, is_flat).c_str());
527+
}
528+
529+
if (y != rr_graph.node_ylow(inode)) {
530+
VPR_ERROR(VPR_ERROR_ROUTE, "RR node y position does not agree between rr_nodes (%d) and rr_node_indices (%d): %s",
531+
rr_graph.node_xlow(inode),
532+
y,
533+
describe_rr_node(rr_graph, grid, rr_indexed_data, inode, is_flat).c_str());
534+
}
535+
518536
} else if (rr_graph.node_type(inode) == e_rr_type::SOURCE || rr_graph.node_type(inode) == e_rr_type::SINK) {
519537
// Sources have co-ordinates covering the entire block they are in, but not sinks
520538
if (!rr_graph.x_in_node_range(x, inode)) {

0 commit comments

Comments
 (0)