@@ -36,8 +36,6 @@ void print_clb_placement(const char* fname);
3636static bool is_cube_bb (const e_place_bounding_box_mode place_bb_mode,
3737 const RRGraphView& rr_graph);
3838
39- static void free_placement_structs ();
40-
4139/* ****************************************************************************/
4240void try_place (const Netlist<>& net_list,
4341 const t_placer_opts& placer_opts,
@@ -96,8 +94,12 @@ void try_place(const Netlist<>& net_list,
9694
9795 placer.place ();
9896
99- free_placement_structs ( );
97+ vtr::release_memory (place_ctx. compressed_block_grids );
10098
99+ /* The placer object has its own copy of block locations and doesn't update
100+ * the global context directly. We need to copy its internal data structures
101+ * to the global placement context before it goes out of scope.
102+ */
101103 placer.copy_locs_to_global_state (place_ctx);
102104}
103105
@@ -126,13 +128,6 @@ static bool is_cube_bb(const e_place_bounding_box_mode place_bb_mode,
126128 return cube_bb;
127129}
128130
129- /* Frees the major structures needed by the placer (and not needed
130- * elsewhere). */
131- static void free_placement_structs () {
132- auto & place_ctx = g_vpr_ctx.mutable_placement ();
133- vtr::release_memory (place_ctx.compressed_block_grids );
134- }
135-
136131#ifdef VERBOSE
137132void print_clb_placement (const char * fname) {
138133 /* Prints out the clb placements to a file. */
0 commit comments