28
28
/* Local Function Declaration */
29
29
/* ***************************************/
30
30
31
- static void load_cluster_placement_stats_for_pb_graph_node (t_cluster_placement_stats * cluster_placement_stats,
31
+ static void load_cluster_placement_stats_for_pb_graph_node (t_intra_cluster_placement_stats * cluster_placement_stats,
32
32
t_pb_graph_node* pb_graph_node);
33
33
34
- static void reset_cluster_placement_stats (t_cluster_placement_stats * cluster_placement_stats);
34
+ static void reset_cluster_placement_stats (t_intra_cluster_placement_stats * cluster_placement_stats);
35
35
36
- static void set_mode_cluster_placement_stats (t_cluster_placement_stats * cluster_placement_stats,
36
+ static void set_mode_cluster_placement_stats (t_intra_cluster_placement_stats * cluster_placement_stats,
37
37
const t_pb_graph_node* pb_graph_node,
38
38
int mode);
39
39
40
- static void update_primitive_cost_or_status (t_cluster_placement_stats * cluster_placement_stats,
40
+ static void update_primitive_cost_or_status (t_intra_cluster_placement_stats * cluster_placement_stats,
41
41
const t_pb_graph_node* pb_graph_node,
42
42
float incremental_cost,
43
43
bool valid);
44
44
45
- static float try_place_molecule (t_cluster_placement_stats * cluster_placement_stats,
45
+ static float try_place_molecule (t_intra_cluster_placement_stats * cluster_placement_stats,
46
46
const t_pack_molecule* molecule,
47
47
t_pb_graph_node* root,
48
48
t_pb_graph_node** primitives_list);
49
49
50
- static bool expand_forced_pack_molecule_placement (t_cluster_placement_stats * cluster_placement_stats,
50
+ static bool expand_forced_pack_molecule_placement (t_intra_cluster_placement_stats * cluster_placement_stats,
51
51
const t_pack_molecule* molecule,
52
52
const t_pack_pattern_block* pack_pattern_block,
53
53
t_pb_graph_node** primitives_list,
@@ -61,17 +61,17 @@ static t_pb_graph_pin* expand_pack_molecule_pin_edge(int pattern_id,
61
61
/* Function Definitions */
62
62
/* ***************************************/
63
63
64
- void t_cluster_placement_stats ::move_inflight_to_tried () {
64
+ void t_intra_cluster_placement_stats ::move_inflight_to_tried () {
65
65
tried.insert (*in_flight.begin ());
66
66
in_flight.clear ();
67
67
}
68
68
69
- void t_cluster_placement_stats ::invalidate_primitive_and_increment_iterator (int pb_type_index, std::unordered_multimap<int , t_cluster_placement_primitive*>::iterator& it) {
69
+ void t_intra_cluster_placement_stats ::invalidate_primitive_and_increment_iterator (int pb_type_index, std::unordered_multimap<int , t_cluster_placement_primitive*>::iterator& it) {
70
70
invalid.insert (*it);
71
71
valid_primitives[pb_type_index].erase (it++);
72
72
}
73
73
74
- void t_cluster_placement_stats ::move_primitive_to_inflight (int pb_type_index, std::unordered_multimap<int , t_cluster_placement_primitive*>::iterator& it) {
74
+ void t_intra_cluster_placement_stats ::move_primitive_to_inflight (int pb_type_index, std::unordered_multimap<int , t_cluster_placement_primitive*>::iterator& it) {
75
75
in_flight.insert (*it);
76
76
valid_primitives[pb_type_index].erase (it);
77
77
}
@@ -81,7 +81,7 @@ void t_cluster_placement_stats::move_primitive_to_inflight(int pb_type_index, st
81
81
*
82
82
* @note that valid status is not changed because if the primitive is not valid, it will get properly collected later
83
83
*/
84
- void t_cluster_placement_stats ::insert_primitive_in_valid_primitives (std::pair<int , t_cluster_placement_primitive*> cluster_placement_primitive) {
84
+ void t_intra_cluster_placement_stats ::insert_primitive_in_valid_primitives (std::pair<int , t_cluster_placement_primitive*> cluster_placement_primitive) {
85
85
int i;
86
86
bool success = false ;
87
87
int null_index = OPEN;
@@ -105,31 +105,31 @@ void t_cluster_placement_stats::insert_primitive_in_valid_primitives(std::pair<i
105
105
}
106
106
}
107
107
108
- void t_cluster_placement_stats ::flush_queue (std::unordered_multimap<int , t_cluster_placement_primitive*>& queue) {
108
+ void t_intra_cluster_placement_stats ::flush_queue (std::unordered_multimap<int , t_cluster_placement_primitive*>& queue) {
109
109
for (auto & it : queue) {
110
110
insert_primitive_in_valid_primitives (it);
111
111
}
112
112
queue.clear ();
113
113
}
114
114
115
- void t_cluster_placement_stats ::flush_intermediate_queues () {
115
+ void t_intra_cluster_placement_stats ::flush_intermediate_queues () {
116
116
flush_queue (in_flight);
117
117
flush_queue (tried);
118
118
}
119
119
120
- void t_cluster_placement_stats ::flush_invalid_queue () {
120
+ void t_intra_cluster_placement_stats ::flush_invalid_queue () {
121
121
flush_queue (invalid);
122
122
}
123
123
124
- bool t_cluster_placement_stats ::in_flight_empty () {
124
+ bool t_intra_cluster_placement_stats ::in_flight_empty () {
125
125
return in_flight.empty ();
126
126
}
127
127
128
- t_pb_type* t_cluster_placement_stats ::in_flight_type () {
128
+ t_pb_type* t_intra_cluster_placement_stats ::in_flight_type () {
129
129
return in_flight.begin ()->second ->pb_graph_node ->pb_type ;
130
130
}
131
131
132
- void t_cluster_placement_stats ::free_primitives () {
132
+ void t_intra_cluster_placement_stats ::free_primitives () {
133
133
for (auto & primitive : tried)
134
134
delete primitive.second ;
135
135
@@ -146,10 +146,10 @@ void t_cluster_placement_stats::free_primitives() {
146
146
}
147
147
}
148
148
149
- t_cluster_placement_stats * alloc_and_load_cluster_placement_stats (t_logical_block_type_ptr cluster_type,
149
+ t_intra_cluster_placement_stats * alloc_and_load_cluster_placement_stats (t_logical_block_type_ptr cluster_type,
150
150
int cluster_mode) {
151
- t_cluster_placement_stats * cluster_placement_stats = new t_cluster_placement_stats ;
152
- *cluster_placement_stats = t_cluster_placement_stats ();
151
+ t_intra_cluster_placement_stats * cluster_placement_stats = new t_intra_cluster_placement_stats ;
152
+ *cluster_placement_stats = t_intra_cluster_placement_stats ();
153
153
// TODO: This initialization may be able to be made more efficient.
154
154
// The reset and setting the mode can be done while loading the placement
155
155
// stats.
@@ -165,14 +165,14 @@ t_cluster_placement_stats* alloc_and_load_cluster_placement_stats(t_logical_bloc
165
165
return cluster_placement_stats;
166
166
}
167
167
168
- void free_cluster_placement_stats (t_cluster_placement_stats * cluster_placement_stats) {
168
+ void free_cluster_placement_stats (t_intra_cluster_placement_stats * cluster_placement_stats) {
169
169
if (cluster_placement_stats != nullptr ) {
170
170
cluster_placement_stats->free_primitives ();
171
171
delete cluster_placement_stats;
172
172
}
173
173
}
174
174
175
- bool get_next_primitive_list (t_cluster_placement_stats * cluster_placement_stats,
175
+ bool get_next_primitive_list (t_intra_cluster_placement_stats * cluster_placement_stats,
176
176
const t_pack_molecule* molecule,
177
177
t_pb_graph_node** primitives_list,
178
178
int force_site) {
@@ -299,7 +299,7 @@ bool get_next_primitive_list(t_cluster_placement_stats* cluster_placement_stats,
299
299
/* *
300
300
* Resets one cluster placement stats by clearing incremental costs and returning all primitives to valid queue
301
301
*/
302
- static void reset_cluster_placement_stats (t_cluster_placement_stats * cluster_placement_stats) {
302
+ static void reset_cluster_placement_stats (t_intra_cluster_placement_stats * cluster_placement_stats) {
303
303
int i;
304
304
305
305
/* Requeue primitives */
@@ -321,7 +321,7 @@ static void reset_cluster_placement_stats(t_cluster_placement_stats* cluster_pla
321
321
* Add any primitives found in pb_graph_nodes to cluster_placement_stats
322
322
* Adds backward link from pb_graph_node to cluster_placement_primitive
323
323
*/
324
- static void load_cluster_placement_stats_for_pb_graph_node (t_cluster_placement_stats * cluster_placement_stats,
324
+ static void load_cluster_placement_stats_for_pb_graph_node (t_intra_cluster_placement_stats * cluster_placement_stats,
325
325
t_pb_graph_node* pb_graph_node) {
326
326
int i, j, k;
327
327
t_cluster_placement_primitive* placement_primitive;
@@ -375,7 +375,7 @@ static void load_cluster_placement_stats_for_pb_graph_node(t_cluster_placement_s
375
375
}
376
376
}
377
377
378
- void commit_primitive (t_cluster_placement_stats * cluster_placement_stats,
378
+ void commit_primitive (t_intra_cluster_placement_stats * cluster_placement_stats,
379
379
const t_pb_graph_node* primitive) {
380
380
t_pb_graph_node *pb_graph_node, *skip;
381
381
float incr_cost;
@@ -417,7 +417,7 @@ void commit_primitive(t_cluster_placement_stats* cluster_placement_stats,
417
417
/* *
418
418
* Set mode of cluster
419
419
*/
420
- static void set_mode_cluster_placement_stats (t_cluster_placement_stats * cluster_placement_stats,
420
+ static void set_mode_cluster_placement_stats (t_intra_cluster_placement_stats * cluster_placement_stats,
421
421
const t_pb_graph_node* pb_graph_node,
422
422
int mode) {
423
423
int i, j, k;
@@ -440,7 +440,7 @@ static void set_mode_cluster_placement_stats(t_cluster_placement_stats* cluster_
440
440
* For modes invalidated by pb_graph_node, invalidate primitive
441
441
* int distance is the distance of current pb_graph_node from original
442
442
*/
443
- static void update_primitive_cost_or_status (t_cluster_placement_stats * cluster_placement_stats,
443
+ static void update_primitive_cost_or_status (t_intra_cluster_placement_stats * cluster_placement_stats,
444
444
const t_pb_graph_node* pb_graph_node,
445
445
const float incremental_cost,
446
446
const bool valid) {
@@ -470,7 +470,7 @@ static void update_primitive_cost_or_status(t_cluster_placement_stats* cluster_p
470
470
/* *
471
471
* Try place molecule at root location, populate primitives list with locations of placement if successful
472
472
*/
473
- static float try_place_molecule (t_cluster_placement_stats * cluster_placement_stats,
473
+ static float try_place_molecule (t_intra_cluster_placement_stats * cluster_placement_stats,
474
474
const t_pack_molecule* molecule,
475
475
t_pb_graph_node* root,
476
476
t_pb_graph_node** primitives_list) {
@@ -516,7 +516,7 @@ static float try_place_molecule(t_cluster_placement_stats* cluster_placement_sta
516
516
* Expand molecule at pb_graph_node
517
517
* Assumes molecule and pack pattern connections have fan-out 1
518
518
*/
519
- static bool expand_forced_pack_molecule_placement (t_cluster_placement_stats * cluster_placement_stats,
519
+ static bool expand_forced_pack_molecule_placement (t_intra_cluster_placement_stats * cluster_placement_stats,
520
520
const t_pack_molecule* molecule,
521
521
const t_pack_pattern_block* pack_pattern_block,
522
522
t_pb_graph_node** primitives_list,
@@ -695,7 +695,7 @@ int get_array_size_of_molecule(const t_pack_molecule* molecule) {
695
695
}
696
696
697
697
/* Given atom block, determines if a free primitive exists for it */
698
- bool exists_free_primitive_for_atom_block (t_cluster_placement_stats * cluster_placement_stats,
698
+ bool exists_free_primitive_for_atom_block (t_intra_cluster_placement_stats * cluster_placement_stats,
699
699
const AtomBlockId blk_id) {
700
700
int i;
701
701
@@ -724,6 +724,6 @@ bool exists_free_primitive_for_atom_block(t_cluster_placement_stats* cluster_pla
724
724
return false ;
725
725
}
726
726
727
- void reset_tried_but_unused_cluster_placements (t_cluster_placement_stats * cluster_placement_stats) {
727
+ void reset_tried_but_unused_cluster_placements (t_intra_cluster_placement_stats * cluster_placement_stats) {
728
728
cluster_placement_stats->flush_intermediate_queues ();
729
729
}
0 commit comments