2
2
* @file placement_log_printer.h
3
3
* @brief Declares the PlacementLogPrinter class and associated utilities for logging
4
4
* and reporting placement-related statistics and timing analysis results.
5
- *
6
- * This file provides tools to monitor and report the progress and results of the placement stage.
7
- *
8
- * ### Key Components:
9
- * - **PlacementLogPrinter**:
10
- * - A utility class for logging placement status, resource utilization, and swap statistics.
11
- * - Prints detailed statistics during the placement process, including initial and post-placement states.
12
- * - Supports a "quiet mode" to suppress output.
13
- *
5
+
14
6
* ### Integration:
15
- * The tools in this file integrate with the Placer class to provide information about
7
+ * The PlacementLogPrinter class integrates with the Placer class to provide information about
16
8
* the placement process for debugging, optimization, and analysis purposes.
17
9
*/
18
10
@@ -33,20 +25,54 @@ struct t_swap_stats;
33
25
class BlkLocRegistry ;
34
26
class Placer ;
35
27
28
+ /* *
29
+ * @class PlacementLogPrinter
30
+ * @brief A utility class for logging placement status and
31
+ * updating the screen view when graphics are enabled.
32
+ */
36
33
class PlacementLogPrinter {
37
34
public:
38
- explicit PlacementLogPrinter (const Placer& placer, bool quiet);
35
+ /* *
36
+ * @param placer The placer object from which the placement status is retrieved.
37
+ * @param quiet When set true, the logger doesn't print any information.
38
+ */
39
+ PlacementLogPrinter (const Placer& placer,
40
+ bool quiet);
39
41
42
+ /* *
43
+ * @brief Prints the placement status header that shows which metrics are reported
44
+ * in each iteration of the annealer's outer loop.
45
+ * @details This method should be called once before the first call to print_place_status().
46
+ */
40
47
void print_place_status_header () const ;
48
+
49
+ /* *
50
+ * @brief Print placement metrics and elapsed time after each outer loop iteration of the annealer.
51
+ * If graphics are on, the function will the screen view.
52
+ * @param elapsed_sec Time spent in the latest outer loop iteration.
53
+ */
54
+ void print_place_status (float elapsed_sec) const ;
55
+
56
+ // / Reports the resource utilization for each block type.
41
57
void print_resources_utilization () const ;
58
+ // / Reports the number of tried temperatures, total swaps, and how many were accepted or rejected.
42
59
void print_placement_swaps_stats () const ;
43
- void print_place_status ( float elapsed_sec) const ;
60
+ // / Reports placement metrics after the initial placement.
44
61
void print_initial_placement_stats () const ;
62
+ // / Prints final placement metrics and generates timing reports.
45
63
void print_post_placement_stats () const ;
46
64
47
65
private:
66
+ /* *
67
+ * @brief A constant reference to the Placer object to access the placement status.
68
+ * @details PlacementLogPrinter is a friend class for the Placer class, so it can
69
+ * access all its private data members. This reference is made constant to avoid
70
+ * any accidental modification of the Placer object.
71
+ */
48
72
const Placer& placer_;
73
+ // / Specifies whether this object prints logs and updates the graphics.
49
74
const bool quiet_;
75
+ // / A string buffer to carry the message to shown in the graphical interface.
50
76
mutable std::vector<char > msg_;
51
77
};
52
78
0 commit comments