@@ -172,11 +172,17 @@ static void sync_pb_routes_to_routing(void) {
172
172
for (ClusterBlockId clb_blk_id : cluster_ctx.clb_nlist .blocks ()) {
173
173
/* Don't erase entries for nets without routing in place (clocks, globals...) */
174
174
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 ;
176
176
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 */
179
184
continue ;
185
+ }
180
186
pins_to_erase.push_back (pin);
181
187
}
182
188
@@ -266,7 +272,7 @@ static void sync_clustered_netlist_to_routing(void) {
266
272
267
273
for (auto net_id : clb_netlist.nets ()) {
268
274
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])
270
276
continue ;
271
277
272
278
nets_to_remove.push_back (net_id);
@@ -279,7 +285,7 @@ static void sync_clustered_netlist_to_routing(void) {
279
285
for (auto pin_id : clb_netlist.port_pins (port_id)) {
280
286
ClusterNetId clb_net_id = clb_netlist.pin_net (pin_id);
281
287
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]) {
283
289
skipped_pins++;
284
290
} else {
285
291
pins_to_remove.push_back (pin_id);
0 commit comments