Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
uvahotspot
GitHub Repository: uvahotspot/HotSpot
Path: blob/master/hotspot-iface.h
612 views
1
#ifndef __HOTSPOT_IFACE_H_
2
#define __HOTSPOT_IFACE_H_
3
4
#define STR_SIZE 512
5
#define MAX_UNITS 8192
6
#define NULLFILE "(null)"
7
#define BLOCK_MODEL 0
8
#define GRID_MODEL 1
9
10
/* floorplan structure */
11
typedef struct unit_t_st
12
{
13
char name[STR_SIZE];
14
double width;
15
double height;
16
double leftx;
17
double bottomy;
18
}unit_t;
19
typedef struct flp_t_st
20
{
21
unit_t *units;
22
int n_units;
23
double **wire_density;
24
} flp_t;
25
26
/* floorplan routines */
27
28
/* reads the floorplan from a file and allocates memory.
29
* 'read_connects' is a boolean flag indicating if
30
* connectivity information should also be read (usually
31
* set to FALSE). 'initialize_connects' is a boolean flag indicating
32
* if the connectivity information should be populated at all, as this
33
* can slow down larger simulations.
34
*/
35
flp_t *read_flp(char *file, int read_connects, int initialize_connects);
36
37
/* deletes floorplan from memory. 'compacted' is a
38
* boolean flag indicating if this is a floorplan
39
* compacted by HotFloorplan (usually set to FALSE).
40
*/
41
void free_flp(flp_t *flp, int compacted, int free_connects);
42
43
/* thermal model configuration structure */
44
typedef struct thermal_config_t_st
45
{
46
/* chip specs */
47
double t_chip; /* chip thickness in meters */
48
double k_chip; /* chip thermal conductivity */
49
double p_chip; /* chip specific heat */
50
double thermal_threshold; /* temperature threshold for DTM (Kelvin)*/
51
52
/* heat sink specs */
53
double c_convec; /* convection capacitance in J/K */
54
double r_convec; /* convection resistance in K/W */
55
double s_sink; /* heatsink side in meters */
56
double t_sink; /* heatsink thickness in meters */
57
double k_sink; /* heatsink thermal conductivity */
58
double p_sink; /* heatsink specific heat */
59
60
/* heat spreader specs */
61
double s_spreader; /* spreader side in meters */
62
double t_spreader; /* spreader thickness in meters */
63
double k_spreader; /* spreader thermal conductivity */
64
double p_spreader; /* spreader specific heat */
65
66
/* interface material specs */
67
double t_interface; /* interface material thickness in meters */
68
double k_interface; /* interface material thermal conductivity */
69
double p_interface; /* interface material specific heat */
70
71
/* secondary path specs */
72
int model_secondary;
73
double r_convec_sec;
74
double c_convec_sec;
75
int n_metal;
76
double t_metal;
77
double t_c4;
78
double s_c4;
79
int n_c4;
80
double s_sub;
81
double t_sub;
82
double s_solder;
83
double t_solder;
84
double s_pcb;
85
double t_pcb;
86
87
/* others */
88
double ambient; /* ambient temperature in kelvin */
89
/* initial temperatures from file */
90
char init_file[STR_SIZE];
91
double init_temp; /* if init_file is NULL */
92
/* steady state temperatures to file */
93
char steady_file[STR_SIZE];
94
/* transient grid temperatures to file */
95
char grid_transient_file[STR_SIZE];
96
double sampling_intvl; /* interval per call to compute_temp */
97
double base_proc_freq; /* in Hz */
98
int dtm_used; /* flag to guide the scaling of init Ts */
99
/* model type - block or grid */
100
char model_type[STR_SIZE];
101
102
/* temperature-leakage loop */
103
int leakage_used;
104
int leakage_mode;
105
106
/* package model */
107
int package_model_used; /* flag to indicate whether package model is used */
108
char package_config_file[STR_SIZE]; /* package/fan configurations */
109
110
/* parameters specific to block model */
111
int block_omit_lateral; /* omit lateral resistance? */
112
113
/* parameters specific to grid model */
114
int grid_rows; /* grid resolution - no. of rows */
115
int grid_cols; /* grid resolution - no. of cols */
116
/* layer configuration from file */
117
char grid_layer_file[STR_SIZE];
118
/* output grid temperatures instead of block temperatures */
119
char grid_steady_file[STR_SIZE];
120
/* mapping mode between grid and block models */
121
char grid_map_mode[STR_SIZE];
122
123
int detailed_3D_used; //BU_3D: Added parameter to check for heterogenous R-C model
124
}thermal_config_t;
125
126
// Microchannel configuration structure
127
typedef struct microchannel_config_t_st
128
{
129
// width of an individual cell in m
130
double cell_width;
131
132
// height of an individual cell in m
133
double cell_height;
134
135
// thickness of an individual cell in m
136
double cell_thickness;
137
138
// pumping pressure between inlet(s) and outlet(s) in Pa
139
double pumping_pressure;
140
141
// pump internal resistance in K/W
142
double pump_internal_res;
143
144
// temperature of coolant at inlet in K
145
double inlet_temperature;
146
147
// volumetric heat capacity of coolant in J/m^3-K
148
double coolant_capac;
149
150
// resistivity of coolant in m-K/W
151
double coolant_res;
152
153
// dynamic viscosity of coolant in Pa-s/m^3
154
double coolant_visc;
155
156
// volumetric heat capacity of channel walls in J/m^3-K
157
double wall_capac;
158
159
// resistivity of channel walls in m-K/W
160
double wall_res;
161
162
// Heat Transfer Coefficient from coolant to channel walls in W/m^2-K
163
double htc;
164
165
// csv file containing description of microchannel network
166
char network_file[STR_SIZE];
167
168
// floorplan file created from network_file
169
char floorplan_file[STR_SIZE+3];
170
171
// rows and columns in microchannel network
172
int num_rows;
173
int num_columns;
174
175
// number of fluid cells in microchannel network
176
int n_fluid_cells;
177
178
// array of cell types
179
int **cell_types;
180
181
// mapping from cell indices to pressure circuit node indices
182
int **mapping;
183
184
// For SuperLU
185
double **A;
186
double *b;
187
int nnz;
188
} microchannel_config_t;
189
190
// Individual material properties
191
typedef struct material_t_st
192
{
193
int material_type; // solid or fluid
194
double thermal_conductivity;
195
double volumetric_heat_capacity;
196
double dynamic_viscosity;
197
} material_t;
198
199
// Materials list structure
200
typedef struct materials_list_t_st
201
{
202
// number of materials entries
203
int size;
204
205
// names of all materials
206
char **names;
207
208
// properties of each material
209
material_t *material_properties;
210
} materials_list_t;
211
212
/* thermal configuration routines */
213
214
/* returns a thermal configuration structure with
215
* the default set of parameters
216
*/
217
thermal_config_t default_thermal_config(void);
218
219
/* thermal model structure */
220
struct block_model_t_st;
221
struct grid_model_t_st;
222
typedef struct RC_model_t_st
223
{
224
union
225
{
226
struct block_model_t_st *block;
227
struct grid_model_t_st *grid;
228
};
229
int type;
230
thermal_config_t *config;
231
}RC_model_t;
232
233
/* thermal model routines */
234
235
/* creates a new thermal model. 'config' can be obtained
236
* from the 'default_thermal_config' function and
237
* 'placeholder' can be obtained from the 'read_flp'
238
* function
239
*/
240
RC_model_t *alloc_RC_model(thermal_config_t *config, flp_t *placeholder, microchannel_config_t *microchannel_config, materials_list_t *materials_list,
241
int do_detailed_3D, int use_microchannels);
242
243
/* deletes the thermal model and frees up memory */
244
void delete_RC_model(RC_model_t *model);
245
246
/* populates the thermal resistances of the model. This is
247
* a prerequisite for computing transient or steady state
248
* temperatures.
249
*/
250
void populate_R_model(RC_model_t *model, flp_t *flp);
251
252
/* populates the thermal capacitances of the model. This is
253
* a prerequisite for computing transient temperatures.
254
*/
255
void populate_C_model(RC_model_t *model, flp_t *flp);
256
257
/* memory allocator for the power and temperature vectors */
258
double *hotspot_vector(RC_model_t *model);
259
260
/* destructor for a vector allocated using 'hotspot_vector' */
261
void free_dvector(double *v);
262
263
/* outputs the 'temp' vector onto 'file'. 'temp' must
264
* be allocated using ' hotspot_vector'.
265
*/
266
void dump_temp (RC_model_t *model, double *temp, char *file);
267
268
/* sets all the temperatures of the 'temp' vector to the
269
* value 'val'. 'temp' must be allocated using '
270
* hotspot_vector'.
271
*/
272
void set_temp (RC_model_t *model, double *temp, double val);
273
274
/* read the 'temp' vector from 'file'. The format of the
275
* file should be the same as the one output by the
276
* 'dump_temp' function. 'temp' must be allocated using
277
* 'hotspot_vector'. 'clip' is a boolean flag indicating
278
* whether to clip the peak temperature of the vector to
279
* the thermal threshold 'model->config->thermal_threshold'
280
* (usually set to FALSE).
281
*/
282
void read_temp (RC_model_t *model, double *temp, char *file, int clip);
283
284
/* computation of the steady state temperatures. 'power'
285
* and 'temp' must be allocated using 'hotspot_vector'.
286
* 'populate_R_model' must be called before this.
287
* 'power' should contain the input power numbers. 'temp'
288
* will contain the output temperature numbers after the
289
* call.
290
*/
291
void steady_state_temp(RC_model_t *model, double *power, double *temp);
292
293
/* computation of the transient temperatures. 'power'
294
* and 'temp' must be allocated using 'hotspot_vector'.
295
* 'populate_R_model' and 'populate_C_model' must be
296
* called before this. 'power' should contain the
297
* input power numbers and 'temp' should contain the
298
* current temperatures. 'time_elapsed' is the duration
299
* of the transient simulation. 'temp' will contain the
300
* output temperature numbers after the call.
301
*/
302
void compute_temp(RC_model_t *model, double *power, double *temp, double time_elapsed);
303
304
#endif
305
306