33
33
* The output of clustering is 400 t_pb of type BLE which represent the clustered user netlist.
34
34
* Each of the 400 t_pb will reference one of the 4 BLE-type t_pb_graph_nodes.
35
35
*/
36
+ #include " cluster.h"
37
+
38
+ #include < algorithm>
36
39
#include < cstdio>
37
40
#include < cstdlib>
38
41
#include < cstring>
39
42
#include < ctime>
40
43
#include < map>
41
- #include < algorithm>
42
- #include < fstream>
43
-
44
- #include " vtr_assert.h"
45
- #include " vtr_log.h"
46
- #include " vtr_math.h"
47
- #include " vtr_memory.h"
48
44
49
- #include " vpr_types.h"
50
- #include " vpr_error.h"
51
-
52
- #include " globals.h"
45
+ #include " PreClusterDelayCalculator.h"
53
46
#include " atom_netlist.h"
54
- #include " pack_types.h"
55
- #include " cluster.h"
56
- #include " cluster_util.h"
57
- #include " output_clustering.h"
58
- #include " SetupGrid.h"
59
- #include " read_xml_arch_file.h"
60
- #include " vpr_utils.h"
61
- #include " cluster_placement.h"
62
- #include " echo_files.h"
63
47
#include " cluster_router.h"
64
- #include " lb_type_rr_graph.h"
65
-
66
- #include " timing_info.h"
67
- #include " timing_reports.h"
68
- #include " PreClusterDelayCalculator.h"
69
- #include " PreClusterTimingGraphResolver.h"
70
- #include " tatum/echo_writer.hpp"
71
- #include " tatum/report/graphviz_dot_writer.hpp"
72
- #include " tatum/TimingReporter.hpp"
73
-
74
- #include " re_cluster_util.h"
48
+ #include " cluster_util.h"
75
49
#include " constraints_report.h"
50
+ #include " globals.h"
51
+ #include " pack_types.h"
52
+ #include " prepack.h"
53
+ #include " timing_info.h"
54
+ #include " vpr_types.h"
55
+ #include " vpr_utils.h"
56
+ #include " vtr_assert.h"
57
+ #include " vtr_log.h"
76
58
77
59
/*
78
60
* When attraction groups are created, the purpose is to pack more densely by adding more molecules
@@ -87,10 +69,9 @@ static constexpr int ATTRACTION_GROUPS_MAX_REPEATED_MOLECULES = 500;
87
69
std::map<t_logical_block_type_ptr, size_t > do_clustering (const t_packer_opts& packer_opts,
88
70
const t_analysis_opts& analysis_opts,
89
71
const t_arch* arch,
90
- t_pack_molecule* molecule_head ,
72
+ Prepacker& prepacker ,
91
73
const std::unordered_set<AtomNetId>& is_clock,
92
74
const std::unordered_set<AtomNetId>& is_global,
93
- const std::unordered_map<AtomBlockId, t_pb_graph_node*>& expected_lowest_cost_pb_gnode,
94
75
bool allow_unrelated_clustering,
95
76
bool balance_block_type_utilization,
96
77
std::vector<t_lb_type_rr_node>* lb_type_rr_graphs,
@@ -173,11 +154,11 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
173
154
helper_ctx.max_cluster_size = 0 ;
174
155
max_pb_depth = 0 ;
175
156
176
- const t_molecule_stats max_molecule_stats = calc_max_molecules_stats (molecule_head );
157
+ const t_molecule_stats max_molecule_stats = prepacker. calc_max_molecule_stats (atom_ctx. nlist );
177
158
178
- mark_all_molecules_valid (molecule_head );
159
+ prepacker. mark_all_molecules_valid ();
179
160
180
- cluster_stats.num_molecules = count_molecules (molecule_head );
161
+ cluster_stats.num_molecules = prepacker. get_num_molecules ( );
181
162
182
163
get_max_cluster_size_and_pb_depth (helper_ctx.max_cluster_size , max_pb_depth);
183
164
@@ -193,7 +174,7 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
193
174
check_for_duplicate_inputs ();
194
175
#endif
195
176
alloc_and_init_clustering (max_molecule_stats,
196
- &(helper_ctx.cluster_placement_stats ), &(helper_ctx.primitives_list ), molecule_head ,
177
+ &(helper_ctx.cluster_placement_stats ), &(helper_ctx.primitives_list ), prepacker ,
197
178
clustering_data, net_output_feeds_driving_block_input,
198
179
unclustered_list_head_size, cluster_stats.num_molecules );
199
180
@@ -213,7 +194,7 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
213
194
vtr::vector<AtomBlockId, float > atom_criticality (atom_ctx.nlist .blocks ().size (), 0 .);
214
195
215
196
if (packer_opts.timing_driven ) {
216
- calc_init_packing_timing (packer_opts, analysis_opts, expected_lowest_cost_pb_gnode ,
197
+ calc_init_packing_timing (packer_opts, analysis_opts, prepacker ,
217
198
clustering_delay_calc, timing_info, atom_criticality);
218
199
}
219
200
0 commit comments