1818#include < fstream>
1919#include " vpr_constraints_writer.h"
2020#include " region.h"
21+ #include " re_cluster_util.h"
2122
2223void write_vpr_floorplan_constraints (const char * file_name, int expand, bool subtile, int horizontal_partitions, int vertical_partitions) {
2324 VprConstraints constraints;
@@ -46,7 +47,6 @@ void write_vpr_floorplan_constraints(const char* file_name, int expand, bool sub
4647void setup_vpr_floorplan_constraints_one_loc (VprConstraints& constraints, int expand, bool subtile) {
4748 auto & cluster_ctx = g_vpr_ctx.clustering ();
4849 auto & place_ctx = g_vpr_ctx.placement ();
49- ClusterAtomsLookup atoms_lookup;
5050
5151 int part_id = 0 ;
5252 /*
@@ -77,9 +77,9 @@ void setup_vpr_floorplan_constraints_one_loc(VprConstraints& constraints, int ex
7777 part.set_part_region (pr);
7878 constraints.add_partition (part);
7979
80- std::vector <AtomBlockId> atoms = atoms_lookup. atoms_in_cluster (blk_id);
80+ std::unordered_set <AtomBlockId>* atoms = cluster_to_atoms (blk_id);
8181
82- for (auto atom_id : atoms) {
82+ for (auto atom_id : * atoms) {
8383 constraints.add_constrained_atom (atom_id, partid);
8484 }
8585 part_id++;
@@ -90,7 +90,6 @@ void setup_vpr_floorplan_constraints_cutpoints(VprConstraints& constraints, int
9090 auto & cluster_ctx = g_vpr_ctx.clustering ();
9191 auto & place_ctx = g_vpr_ctx.placement ();
9292 auto & device_ctx = g_vpr_ctx.device ();
93- ClusterAtomsLookup atoms_lookup;
9493
9594 // calculate the cutpoint values according to the grid size
9695 // load two arrays - one for horizontal cutpoints and one for vertical
@@ -151,7 +150,7 @@ void setup_vpr_floorplan_constraints_cutpoints(VprConstraints& constraints, int
151150 * appropriate region accordingly
152151 */
153152 for (auto blk_id : cluster_ctx.clb_nlist .blocks ()) {
154- std::vector <AtomBlockId> atoms = atoms_lookup. atoms_in_cluster (blk_id);
153+ std::unordered_set <AtomBlockId>* atoms = cluster_to_atoms (blk_id);
155154 int x = place_ctx.block_locs [blk_id].loc .x ;
156155 int y = place_ctx.block_locs [blk_id].loc .y ;
157156 int width = device_ctx.grid .width ();
@@ -183,7 +182,7 @@ void setup_vpr_floorplan_constraints_cutpoints(VprConstraints& constraints, int
183182
184183 VTR_ASSERT (got != region_atoms.end ());
185184
186- for (auto atom_id : atoms) {
185+ for (auto atom_id : * atoms) {
187186 got->second .push_back (atom_id);
188187 }
189188 }
0 commit comments