@@ -79,7 +79,7 @@ void calc_init_packing_timing(const t_packer_opts& packer_opts,
79
79
std::shared_ptr<PreClusterDelayCalculator>& clustering_delay_calc,
80
80
std::shared_ptr<SetupTimingInfo>& timing_info,
81
81
vtr::vector<AtomBlockId, float >& atom_criticality) {
82
- auto & atom_ctx = g_vpr_ctx.atom ();
82
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
83
83
84
84
/*
85
85
* Initialize the timing analyzer
@@ -228,7 +228,7 @@ void rebuild_attraction_groups(AttractionInfo& attraction_groups,
228
228
229
229
/* Determine if atom block is in pb */
230
230
bool is_atom_blk_in_pb (const AtomBlockId blk_id, const t_pb* pb) {
231
- auto & atom_ctx = g_vpr_ctx.atom ();
231
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
232
232
233
233
const t_pb* cur_pb = atom_ctx.lookup .atom_pb (blk_id);
234
234
while (cur_pb) {
@@ -514,7 +514,7 @@ void update_connection_gain_values(const AtomNetId net_id,
514
514
enum e_net_relation_to_clustered_block net_relation_to_clustered_block) {
515
515
/* This function is called when the connectiongain values on the net net_id*
516
516
*require updating. */
517
- auto & atom_ctx = g_vpr_ctx.atom ();
517
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
518
518
519
519
int num_internal_connections, num_open_connections, num_stuck_connections;
520
520
@@ -597,8 +597,8 @@ void try_fill_cluster(ClusterLegalizer& cluster_legalizer,
597
597
const int & unclustered_list_head_size,
598
598
std::unordered_map<AtomNetId, int >& net_output_feeds_driving_block_input,
599
599
std::map<const t_model*, std::vector<t_logical_block_type_ptr>>& primitive_candidate_block_types) {
600
- auto & atom_ctx = g_vpr_ctx.atom ();
601
- auto & device_ctx = g_vpr_ctx.mutable_device ();
600
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
601
+ const DeviceContext & device_ctx = g_vpr_ctx.device ();
602
602
603
603
block_pack_status = cluster_legalizer.add_mol_to_cluster (next_molecule,
604
604
legalization_cluster_id);
@@ -714,7 +714,7 @@ void store_cluster_info_and_free(const t_packer_opts& packer_opts,
714
714
std::vector<int >& le_count,
715
715
const ClusterLegalizer& cluster_legalizer,
716
716
vtr::vector<LegalizationClusterId, std::vector<AtomNetId>>& clb_inter_blk_nets) {
717
- auto & atom_ctx = g_vpr_ctx.atom ();
717
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
718
718
719
719
/* store info that will be used later in packing from pb_stats and free the rest */
720
720
t_pb* cur_pb = cluster_legalizer.get_cluster_pb (legalization_cluster_id);
@@ -746,7 +746,7 @@ void update_timing_gain_values(const AtomNetId net_id,
746
746
*net_id requires updating. */
747
747
float timinggain;
748
748
749
- auto & atom_ctx = g_vpr_ctx.atom ();
749
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
750
750
751
751
/* Check if this atom net lists its driving atom block twice. If so, avoid *
752
752
* double counting this atom block by skipping the first (driving) pin. */
@@ -811,7 +811,7 @@ void mark_and_update_partial_gain(const AtomNetId net_id,
811
811
* cluster. The timinggain is the criticality of the most critical*
812
812
* atom net between this atom block and an atom block in the cluster. */
813
813
814
- auto & atom_ctx = g_vpr_ctx.atom ();
814
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
815
815
t_pb* cur_pb = atom_ctx.lookup .atom_pb (clustered_blk_id)->parent_pb ;
816
816
cur_pb = get_top_level_pb (cur_pb);
817
817
@@ -889,7 +889,7 @@ void update_total_gain(float alpha, float beta, bool timing_driven, bool connect
889
889
/* Updates the total gain array to reflect the desired tradeoff between*
890
890
*input sharing (sharinggain) and path_length minimization (timinggain)
891
891
*input each time a new molecule is added to the cluster.*/
892
- auto & atom_ctx = g_vpr_ctx.atom ();
892
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
893
893
t_pb* cur_pb = pb;
894
894
895
895
cur_pb = get_top_level_pb (cur_pb);
@@ -966,7 +966,7 @@ void update_cluster_stats(const t_pack_molecule* molecule,
966
966
int iblock;
967
967
t_pb *cur_pb, *cb;
968
968
969
- auto & atom_ctx = g_vpr_ctx.mutable_atom ();
969
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
970
970
molecule_size = get_array_size_of_molecule (molecule);
971
971
cb = nullptr ;
972
972
@@ -1079,13 +1079,9 @@ void start_new_cluster(ClusterLegalizer& cluster_legalizer,
1079
1079
* It expands the FPGA if it cannot find a legal cluster for the atom block
1080
1080
*/
1081
1081
1082
- auto & atom_ctx = g_vpr_ctx.atom ();
1083
- auto & device_ctx = g_vpr_ctx.mutable_device ();
1084
- auto & floorplanning_ctx = g_vpr_ctx.mutable_floorplanning ();
1085
-
1086
- /* Cluster's PartitionRegion is empty initially, meaning it has no floorplanning constraints*/
1087
- PartitionRegion empty_pr;
1088
- floorplanning_ctx.cluster_constraints .push_back (empty_pr);
1082
+ const AtomContext& atom_ctx = g_vpr_ctx.atom ();
1083
+ DeviceContext& mutable_device_ctx = g_vpr_ctx.mutable_device ();
1084
+ const DeviceContext& device_ctx = g_vpr_ctx.mutable_device ();
1089
1085
1090
1086
/* Allocate a dummy initial cluster and load a atom block as a seed and check if it is legal */
1091
1087
AtomBlockId root_atom = molecule->atom_block_ids [molecule->root ];
@@ -1177,7 +1173,7 @@ void start_new_cluster(ClusterLegalizer& cluster_legalizer,
1177
1173
}
1178
1174
1179
1175
if (num_used_type_instances[block_type] > num_instances) {
1180
- device_ctx .grid = create_device_grid (device_layout_name, arch->grid_layouts , num_used_type_instances, target_device_utilization);
1176
+ mutable_device_ctx .grid = create_device_grid (device_layout_name, arch->grid_layouts , num_used_type_instances, target_device_utilization);
1181
1177
}
1182
1178
}
1183
1179
@@ -1294,7 +1290,7 @@ void add_cluster_molecule_candidates_by_connectivity_and_timing(t_pb* cur_pb,
1294
1290
AttractionInfo& attraction_groups) {
1295
1291
VTR_ASSERT (cur_pb->pb_stats ->num_feasible_blocks == NOT_VALID);
1296
1292
1297
- auto & atom_ctx = g_vpr_ctx.atom ();
1293
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
1298
1294
1299
1295
cur_pb->pb_stats ->num_feasible_blocks = 0 ;
1300
1296
cur_pb->pb_stats ->explore_transitive_fanout = true ; /* If no legal molecules found, enable exploration of molecules two hops away */
@@ -1322,12 +1318,12 @@ void add_cluster_molecule_candidates_by_highfanout_connectivity(t_pb* cur_pb,
1322
1318
/* Because the packer ignores high fanout nets when marking what blocks
1323
1319
* to consider, use one of the ignored high fanout net to fill up lightly
1324
1320
* related blocks */
1321
+ const AtomContext& atom_ctx = g_vpr_ctx.atom ();
1322
+
1325
1323
reset_tried_but_unused_cluster_placements (cluster_placement_stats_ptr);
1326
1324
1327
1325
AtomNetId net_id = cur_pb->pb_stats ->tie_break_high_fanout_net ;
1328
1326
1329
- auto & atom_ctx = g_vpr_ctx.atom ();
1330
-
1331
1327
int count = 0 ;
1332
1328
for (auto pin_id : atom_ctx.nlist .net_pins (net_id)) {
1333
1329
if (count >= AAPACK_MAX_HIGH_FANOUT_EXPLORE) {
@@ -1366,7 +1362,7 @@ void add_cluster_molecule_candidates_by_attraction_group(t_pb* cur_pb,
1366
1362
const int feasible_block_array_size,
1367
1363
LegalizationClusterId legalization_cluster_id,
1368
1364
std::map<const t_model*, std::vector<t_logical_block_type_ptr>>& primitive_candidate_block_types) {
1369
- auto & atom_ctx = g_vpr_ctx.atom ();
1365
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
1370
1366
1371
1367
auto cluster_type = cluster_legalizer.get_cluster_type (legalization_cluster_id);
1372
1368
@@ -1774,7 +1770,7 @@ std::vector<AtomBlockId> initialize_seed_atoms(const e_cluster_seed seed_type,
1774
1770
t_pack_molecule* get_highest_gain_seed_molecule (int & seed_index,
1775
1771
const std::vector<AtomBlockId>& seed_atoms,
1776
1772
const ClusterLegalizer& cluster_legalizer) {
1777
- auto & atom_ctx = g_vpr_ctx.atom ();
1773
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
1778
1774
1779
1775
while (seed_index < static_cast <int >(seed_atoms.size ())) {
1780
1776
AtomBlockId blk_id = seed_atoms[seed_index++];
@@ -1808,7 +1804,7 @@ float get_molecule_gain(t_pack_molecule* molecule, std::map<AtomBlockId, float>&
1808
1804
float gain;
1809
1805
int i;
1810
1806
int num_introduced_inputs_of_indirectly_related_block;
1811
- auto & atom_ctx = g_vpr_ctx.atom ();
1807
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
1812
1808
1813
1809
gain = 0 ;
1814
1810
float attraction_group_penalty = 0.1 ;
@@ -1873,7 +1869,7 @@ void load_transitive_fanout_candidates(LegalizationClusterId legalization_cluste
1873
1869
const ClusterLegalizer& cluster_legalizer,
1874
1870
vtr::vector<LegalizationClusterId, std::vector<AtomNetId>>& clb_inter_blk_nets,
1875
1871
int transitive_fanout_threshold) {
1876
- auto & atom_ctx = g_vpr_ctx.atom ();
1872
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
1877
1873
1878
1874
// iterate over all the nets that have pins in this cluster
1879
1875
for (const auto net_id : pb_stats->marked_nets ) {
@@ -1915,9 +1911,8 @@ void load_transitive_fanout_candidates(LegalizationClusterId legalization_cluste
1915
1911
1916
1912
std::map<const t_model*, std::vector<t_logical_block_type_ptr>> identify_primitive_candidate_block_types () {
1917
1913
std::map<const t_model*, std::vector<t_logical_block_type_ptr>> model_candidates;
1918
- auto & atom_ctx = g_vpr_ctx.atom ();
1919
- auto & atom_nlist = atom_ctx.nlist ;
1920
- auto & device_ctx = g_vpr_ctx.device ();
1914
+ const AtomNetlist& atom_nlist = g_vpr_ctx.atom ().nlist ;
1915
+ const DeviceContext& device_ctx = g_vpr_ctx.device ();
1921
1916
1922
1917
std::set<const t_model*> unique_models;
1923
1918
// Find all logic models used in the netlist
@@ -1945,7 +1940,7 @@ std::map<const t_model*, std::vector<t_logical_block_type_ptr>> identify_primiti
1945
1940
void print_seed_gains (const char * fname, const std::vector<AtomBlockId>& seed_atoms, const vtr::vector<AtomBlockId, float >& atom_gain, const vtr::vector<AtomBlockId, float >& atom_criticality) {
1946
1941
FILE* fp = vtr::fopen (fname, " w" );
1947
1942
1948
- auto & atom_ctx = g_vpr_ctx.atom ();
1943
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
1949
1944
1950
1945
// For prett formatting determine the maximum name length
1951
1946
int max_name_len = strlen (" atom_block_name" );
@@ -2170,7 +2165,7 @@ t_pb* get_top_level_pb(t_pb* pb) {
2170
2165
}
2171
2166
2172
2167
void init_clb_atoms_lookup (vtr::vector<ClusterBlockId, std::unordered_set<AtomBlockId>>& atoms_lookup) {
2173
- auto & atom_ctx = g_vpr_ctx.atom ();
2168
+ const AtomContext & atom_ctx = g_vpr_ctx.atom ();
2174
2169
auto & cluster_ctx = g_vpr_ctx.clustering ();
2175
2170
2176
2171
atoms_lookup.resize (cluster_ctx.clb_nlist .blocks ().size ());
0 commit comments