Skip to content

Commit 623132e

Browse files
committed
[vpr][pack] remove casting net id
1 parent 3594124 commit 623132e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

vpr/src/pack/sync_netlists_to_routing_flat.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,17 @@ static void sync_pb_routes_to_routing(void) {
172172
for (ClusterBlockId clb_blk_id : cluster_ctx.clb_nlist.blocks()) {
173173
/* Don't erase entries for nets without routing in place (clocks, globals...) */
174174
std::vector<int> pins_to_erase;
175-
auto& pb_routes = cluster_ctx.clb_nlist.block_pb(clb_blk_id)->pb_route;
175+
t_pb_routes& pb_routes = cluster_ctx.clb_nlist.block_pb(clb_blk_id)->pb_route;
176176
for (auto& [pin, pb_route] : pb_routes) {
177-
/* No route tree: no routing in place, it is global or clock */
178-
if (!route_ctx.route_trees[ParentNetId(int(pb_route.atom_net_id))])
177+
/*
178+
* Given that this function is called when flat routing is enabled,
179+
* we can safely assume that the net IDs to index into route_ctx.route_trees
180+
* correspond to the atom net IDs.
181+
*/
182+
if (!route_ctx.route_trees[pb_route.atom_net_id]) {
183+
/* No route tree: no routing in place, it is global or clock */
179184
continue;
185+
}
180186
pins_to_erase.push_back(pin);
181187
}
182188

@@ -266,7 +272,7 @@ static void sync_clustered_netlist_to_routing(void) {
266272

267273
for (auto net_id : clb_netlist.nets()) {
268274
auto atom_net_id = atom_lookup.atom_net(net_id);
269-
if (!route_ctx.route_trees[ParentNetId(int(atom_net_id))])
275+
if (!route_ctx.route_trees[atom_net_id])
270276
continue;
271277

272278
nets_to_remove.push_back(net_id);
@@ -279,7 +285,7 @@ static void sync_clustered_netlist_to_routing(void) {
279285
for (auto pin_id : clb_netlist.port_pins(port_id)) {
280286
ClusterNetId clb_net_id = clb_netlist.pin_net(pin_id);
281287
auto atom_net_id = atom_lookup.atom_net(clb_net_id);
282-
if (atom_net_id && !route_ctx.route_trees[ParentNetId(int(atom_net_id))]) {
288+
if (atom_net_id && !route_ctx.route_trees[atom_net_id]) {
283289
skipped_pins++;
284290
} else {
285291
pins_to_remove.push_back(pin_id);

0 commit comments

Comments
 (0)