Skip to content

Commit 1253595

Browse files
authored
Merge pull request #46 from litghost/reset_illegal_modes
Reset illegal_modes prior to attempting cluster routing.
2 parents 9911b28 + bb1864d commit 1253595

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

vpr/src/pack/cluster.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ std::map<t_type_ptr,size_t> do_clustering(const t_packer_opts& packer_opts, cons
639639
if (detailed_routing_stage == (int)E_DETAILED_ROUTE_AT_END_ONLY) {
640640
// FIXME: is_mode_conflict does not affect this stage. It will be needed when trying to route the packed clusters later on.
641641
bool is_mode_conflict;
642+
reset_intra_lb_route(router_data);
642643
is_cluster_legal = try_intra_lb_route(router_data, packer_opts.pack_verbosity, &is_mode_conflict);
643644
if (is_cluster_legal == true) {
644645
VTR_LOGV(packer_opts.pack_verbosity > 2, "\tPassed route at end.\n");
@@ -1217,6 +1218,7 @@ static enum e_block_pack_status try_pack_molecule(
12171218
bool is_mode_conflict = true;
12181219
bool is_routed = false;
12191220
bool do_detailed_routing_stage = detailed_routing_stage == (int)E_DETAILED_ROUTE_FOR_EACH_ATOM;
1221+
reset_intra_lb_route(router_data);
12201222
while (do_detailed_routing_stage && is_mode_conflict) {
12211223
is_routed = try_intra_lb_route(router_data, verbosity, &is_mode_conflict);
12221224
}

vpr/src/pack/cluster_router.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,3 +1479,14 @@ static std::string describe_congested_rr_nodes(const std::vector<int>& congested
14791479

14801480
return description;
14811481
}
1482+
1483+
void reset_intra_lb_route(t_lb_router_data *router_data) {
1484+
for(auto &node : *router_data->lb_type_graph) {
1485+
auto *pin = node.pb_graph_pin;
1486+
if(pin == nullptr) {
1487+
continue;
1488+
}
1489+
VTR_ASSERT(pin->parent_node != nullptr);
1490+
pin->parent_node->illegal_modes.clear();
1491+
}
1492+
}

vpr/src/pack/cluster_router.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ void add_atom_as_target(t_lb_router_data *router_data, const AtomBlockId blk_id)
2020
void remove_atom_from_target(t_lb_router_data *router_data, const AtomBlockId blk_id);
2121
void set_reset_pb_modes(t_lb_router_data *router_data, const t_pb *pb, const bool set);
2222
bool try_intra_lb_route(t_lb_router_data *router_data, int verbosity, bool *is_mode_conflict);
23+
void reset_intra_lb_route(t_lb_router_data *router_data);
2324

2425
/* Accessor Functions */
2526
t_pb_routes alloc_and_load_pb_route(const vector <t_intra_lb_net> *intra_lb_nets, t_pb_graph_node *pb_graph_head);

0 commit comments

Comments
 (0)