-
Notifications
You must be signed in to change notification settings - Fork 1
/
HotSpotFloorplanner.hpp
152 lines (128 loc) · 6.51 KB
/
HotSpotFloorplanner.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#include "flp.h"
#include "temperature.h"
#include "hotfloorplan.h"
#include <stdio.h>
#include <stdlib.h>
class HotSpotFloorplanner
{
public:
/************************************************************************/
/* Constructor with several configuration files' name, include:
desc flp file name
average power file name
flp output file name
configuration file name
*/
/************************************************************************/
HotSpotFloorplanner(char* desc_file_name,
char* power_file_name,
char* output_file_name,
char* config_file_name);
/************************************************************************/
/* Release HotSpot objects in deconstructor */
/************************************************************************/
~HotSpotFloorplanner();
private:
/************************************************************************/
/* Setup global config from parameter table */
/************************************************************************/
void hsf_global_config_from_parameter_table(){
global_config_from_strs(&global_config,parameter_table,parameter_size);
}
/************************************************************************/
/* Write global configs back to parameter table */
/************************************************************************/
void hsf_global_config_to_parameter_table(){
global_config_to_strs(&global_config,parameter_table,MAX_ENTRIES);
}
/************************************************************************/
/* Dump result floorplan file */
/************************************************************************/
void hsf_dump_flp(){
dump_flp(flp,global_config.flp_out,FALSE);
}
/************************************************************************/
/* Just use default thermal config first, custom setup can be added then */
/************************************************************************/
void hsf_default_thermal_config(){
thermal_config=default_thermal_config();
}
/***************************************************************************/
/* Just use default floorplan config first, custom setup can be added then */
/***************************************************************************/
void hsf_default_flp_config(){
flp_config=default_flp_config();
}
/************************************************************************/
/* At least these global configuration parameters should be given:
desc flp file
average power file
output destination
config file*/
/************************************************************************/
void initializeGlobalConfigToParameterTable(char* desc_file_name,
char* power_file_name,
char* output_file_name,
char* config_file_name);
/********************************************************************************************/
/* After insert parameters into parameter table, update thermal && flp config respectively */
/********************************************************************************************/
void additional_thermal_config_from_strs(){
thermal_config_add_from_strs(&thermal_config,¶meter_table[parameter_size],MAX_ENTRIES-parameter_size);
}
void additional_flp_config_from_strs(){
flp_config_add_from_strs(&flp_config,¶meter_table[parameter_size],MAX_ENTRIES-parameter_size);
}
public:
/************************************************************************/
/* Tell about myself */
/************************************************************************/
void hsf_print_usage();
/************************************************************************/
/* This is the function you should call
when you want to associate some value with a configuration at your will*/
/************************************************************************/
void insertConfigParameter(char* name, char* value);
/************************************************************************/
/* Do the floorplan algorithm and print informations on console */
/************************************************************************/
int hsf_floorplan();
/************************************************************************/
/* Also you can print extra auxiliary results from floorplan process
with no filename given, it will only show on console
whereas giving a filename redirects stdout into that file*/
/************************************************************************/
void hsf_print_flp(char* flp_file=NULL);
void hsf_print_flp_fig(char* flp_fig_file=NULL);
void hsf_print_flp_stats(char* flp_stats_file=NULL);
void hsf_print_wire_delays(char* wire_delay_file=NULL);
/************************************************************************/
/* For your convenience if you want all auxiliary informations */
/************************************************************************/
void hsf_print_auxilary_results(char* flp_fig_file,char* flp_stats_file,char* wire_delay_file){
hsf_print_flp_fig(flp_fig_file);
hsf_print_flp_stats(flp_stats_file);
hsf_print_wire_delays(wire_delay_file);
}
private:
int compacted;
/************************************************************************/
/* Parameter table stores key-value pair that specifies configuration */
/************************************************************************/
str_pair parameter_table[MAX_ENTRIES];
/************************************************************************/
/* Track the parameter table's size
because you can add in new configurations so that modify default values */
/************************************************************************/
int parameter_size;
/************************************************************************/
/* HotSpot objects needed in floorplanning */
/************************************************************************/
flp_desc_t *flp_desc;
flp_t *flp;
RC_model_t *model;
double *power;
thermal_config_t thermal_config;
flp_config_t flp_config;
global_config_t global_config;
};