@@ -40,12 +40,17 @@ static void check_locally_used_clb_opins(const t_clb_opins_used& clb_opins_used_
40
40
enum e_route_type route_type,
41
41
bool is_flat);
42
42
43
+ /* *
44
+ * Checks that all non-configurable edges are in a legal configuration.
45
+ * @param net_list The netlist whose routing is to be checked.
46
+ * @param is_flat True if flat routing is enabled; otherwise false.
47
+ */
43
48
static void check_all_non_configurable_edges (const Netlist<>& net_list, bool is_flat);
44
49
45
50
/* *
46
51
* @brief Checks that the specified routing is legal with respect to non-configurable edges.
47
- * For routing to be legal if * any* non-configurable edge is used, so must *all*
48
- * other non-configurable edges in the same set
52
+ * For routing to be valid, if any non-configurable edge is used, all nodes in the same set
53
+ * and the required connecting edges in the set must also be used.
49
54
*
50
55
* @param net_list A reference to the netlist.
51
56
* @param net The net id for which the check is done.
@@ -60,6 +65,7 @@ static bool check_non_configurable_edges(const Netlist<>& net_list,
60
65
const t_non_configurable_rr_sets& non_configurable_rr_sets,
61
66
const vtr::vector<RRNodeId, int >& rrnode_set_id,
62
67
bool is_flat);
68
+
63
69
static void check_net_for_stubs (const Netlist<>& net_list,
64
70
ParentNetId net,
65
71
bool is_flat);
@@ -607,8 +613,6 @@ static void check_node_and_range(RRNodeId inode,
607
613
is_flat);
608
614
}
609
615
610
- // Checks that all non-configurable edges are in a legal configuration
611
- // This check is slow, so it has been moved out of check_route()
612
616
static void check_all_non_configurable_edges (const Netlist<>& net_list, bool is_flat) {
613
617
const auto & rr_graph = g_vpr_ctx.device ().rr_graph ;
614
618
@@ -618,13 +622,15 @@ static void check_all_non_configurable_edges(const Netlist<>& net_list, bool is_
618
622
// Specifies which RR set each node is part of.
619
623
vtr::vector<RRNodeId, int > rrnode_set_ids (rr_graph.num_nodes (), -1 );
620
624
621
- int non_configurable_rr_set_id = 0 ;
622
- for (const auto & node_set : non_configurable_rr_sets.node_sets ) {
625
+ const size_t num_non_cfg_rr_sets = non_configurable_rr_sets.node_sets .size ();
626
+
627
+ // Populate rrnode_set_ids
628
+ for (size_t non_cfg_rr_set_id = 0 ; non_cfg_rr_set_id < num_non_cfg_rr_sets; non_cfg_rr_set_id++) {
629
+ const std::set<RRNodeId>& node_set = non_configurable_rr_sets.node_sets [non_cfg_rr_set_id];
623
630
for (const RRNodeId node_id : node_set) {
624
631
VTR_ASSERT_SAFE (rrnode_set_ids[node_id] == -1 );
625
- rrnode_set_ids[node_id] = non_configurable_rr_set_id ;
632
+ rrnode_set_ids[node_id] = ( int )non_cfg_rr_set_id ;
626
633
}
627
- non_configurable_rr_set_id++;
628
634
}
629
635
630
636
for (auto net_id : net_list.nets ()) {
@@ -647,7 +653,7 @@ static bool check_non_configurable_edges(const Netlist<>& net_list,
647
653
if (!route_ctx.route_trees [net]) // no routing
648
654
return true ;
649
655
650
- // Collect all the nodes, edges, and RR sets ids used by this net's routing
656
+ // Collect all the nodes, edges, and non-configurable RR set ids used by this net's routing
651
657
std::set<t_node_edge> routing_edges;
652
658
std::set<RRNodeId> routing_nodes;
653
659
std::set<int > routing_non_configurable_rr_set_ids;
@@ -658,12 +664,14 @@ static bool check_non_configurable_edges(const Netlist<>& net_list,
658
664
t_node_edge edge = {rt_node.parent ()->inode , rt_node.inode };
659
665
routing_edges.insert (edge);
660
666
661
- if (rrnode_set_id[rt_node.inode ] >= 0 ) {
667
+ if (rrnode_set_id[rt_node.inode ] >= 0 ) { // The node belongs to a non-configurable RR set
662
668
routing_non_configurable_rr_set_ids.insert (rrnode_set_id[rt_node.inode ]);
663
669
}
664
670
}
665
671
666
672
// Copy used non-configurable RR sets
673
+ // This is done to check legality only for used non-configurable RR sets. If a non-configurable RR set
674
+ // is not used by a net's routing, it cannot violate the requirements of using that non-configurable RR set.
667
675
t_non_configurable_rr_sets used_non_configurable_rr_sets;
668
676
used_non_configurable_rr_sets.node_sets .reserve (routing_non_configurable_rr_set_ids.size ());
669
677
used_non_configurable_rr_sets.edge_sets .reserve (routing_non_configurable_rr_set_ids.size ());
0 commit comments