@@ -17,7 +17,7 @@ const char* name_suffix = "_m";
17
17
// static void set_atom_pin_mapping(const ClusteredNetlist& clb_nlist, const AtomBlockId atom_blk, const AtomPortId atom_port, const t_pb_graph_pin* gpin);
18
18
static void load_atom_index_for_pb_pin (t_pb_routes& pb_route, int ipin);
19
19
static void load_internal_to_block_net_nums (const t_logical_block_type_ptr type, t_pb_routes& pb_route);
20
- static bool count_children_pbs (const t_pb* pb);
20
+ // static bool count_children_pbs(const t_pb* pb);
21
21
static void fix_atom_pin_mapping (const AtomBlockId blk);
22
22
23
23
static void fix_cluster_pins_after_moving (const ClusterBlockId clb_index);
@@ -36,9 +36,9 @@ static void fix_cluster_net_after_moving(const t_pack_molecule* molecule,
36
36
const ClusterBlockId& new_clb);
37
37
38
38
static void rebuild_cluster_placemet_stats (const ClusterBlockId& clb_index,
39
- const std::vector<AtomBlockId>& clb_atoms,
40
- int type_idx,
41
- int mode);
39
+ const std::vector<AtomBlockId>& clb_atoms,
40
+ int type_idx,
41
+ int mode);
42
42
43
43
/* **************** API functions ***********************/
44
44
ClusterBlockId atom_to_cluster (const AtomBlockId& atom) {
@@ -196,7 +196,6 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule,
196
196
t_logical_block_type_ptr block_type = cluster_ctx.clb_nlist .block_type (new_clb);
197
197
t_pb* temp_pb = cluster_ctx.clb_nlist .block_pb (new_clb);
198
198
199
-
200
199
// re-build cluster placement stats
201
200
rebuild_cluster_placemet_stats (new_clb, new_clb_atoms, cluster_ctx.clb_nlist .block_type (new_clb)->index , cluster_ctx.clb_nlist .block_pb (new_clb)->mode );
202
201
@@ -575,6 +574,7 @@ static void load_atom_index_for_pb_pin(t_pb_routes& pb_route, int ipin) {
575
574
pb_route[driver].sink_pb_pin_ids .push_back (ipin);
576
575
}
577
576
577
+ #if 0
578
578
static bool count_children_pbs(const t_pb* pb) {
579
579
if (pb == nullptr)
580
580
return 0;
@@ -588,11 +588,12 @@ static bool count_children_pbs(const t_pb* pb) {
588
588
}
589
589
return false;
590
590
}
591
+ #endif
591
592
592
593
static void rebuild_cluster_placemet_stats (const ClusterBlockId& clb_index,
593
- const std::vector<AtomBlockId>& clb_atoms,
594
- int type_idx,
595
- int mode) {
594
+ const std::vector<AtomBlockId>& clb_atoms,
595
+ int type_idx,
596
+ int mode) {
596
597
auto & helper_ctx = g_vpr_ctx.mutable_cl_helper ();
597
598
auto & cluster_ctx = g_vpr_ctx.clustering ();
598
599
auto & atom_ctx = g_vpr_ctx.atom ();
@@ -648,4 +649,24 @@ void commit_mol_removal(const t_pack_molecule* molecule,
648
649
cluster_ctx.clb_nlist .block_pb (old_clb)->pb_route .clear ();
649
650
cluster_ctx.clb_nlist .block_pb (old_clb)->pb_route = alloc_and_load_pb_route (router_data->saved_lb_nets , cluster_ctx.clb_nlist .block_pb (old_clb)->pb_graph_node );
650
651
}
652
+ }
653
+
654
+ bool check_type_and_mode_compitability (const ClusterBlockId& old_clb,
655
+ const ClusterBlockId& new_clb,
656
+ int verbosity) {
657
+ auto & cluster_ctx = g_vpr_ctx.clustering ();
658
+
659
+ // Check that the old and new clusters are the same type
660
+ if (cluster_ctx.clb_nlist .block_type (old_clb) != cluster_ctx.clb_nlist .block_type (new_clb)) {
661
+ VTR_LOGV (verbosity > 4 , " Move aborted. New and old cluster blocks are not of the same type" );
662
+ return false ;
663
+ }
664
+
665
+ // Check that the old and new clusters are the mode
666
+ if (cluster_ctx.clb_nlist .block_pb (old_clb)->mode != cluster_ctx.clb_nlist .block_pb (new_clb)->mode ) {
667
+ VTR_LOGV (verbosity > 4 , " Move aborted. New and old cluster blocks are not of the same mode" );
668
+ return false ;
669
+ }
670
+
671
+ return true ;
651
672
}
0 commit comments