-
Notifications
You must be signed in to change notification settings - Fork 13
/
temperature_block.h
98 lines (85 loc) · 2.98 KB
/
temperature_block.h
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
#ifndef __TEMPERATURE_BLOCK_H_
#define __TEMPERATURE_BLOCK_H_
#include "temperature.h"
/* functional block layers */
/* total */
#define NL 4
/* silicon is always layer 0 */
/* interface layer */
#define IFACE 1
/* heat spreader */
#define HSP 2
/* heat sink */
#define HSINK 3
/* block thermal model */
typedef struct block_model_t_st
{
/* floorplan */
flp_t *flp;
/* configuration */
thermal_config_t config;
/* main matrices */
/* conductance matrix */
double **b;
/* LUP decomposition of b */
double **lu;
int *p;
/* diagonal capacitance matrix stored as a 1-d vector */
double *a;
/* inverse of the above */
double *inva;
/* c = inva * b */
double **c;
/* package parameters */
package_RC_t pack;
/* intermediate vectors and matrices */
double *gx, *gy;
double *gx_int, *gy_int;
double *gx_sp, *gy_sp;
double *gx_hs, *gy_hs;
double *g_amb;
double *t_vector;
double **len, **g;
int **border;
/* total no. of nodes */
int n_nodes;
/* total no. of blocks */
int n_units;
/* to allow for resizing */
int base_n_units;
/* flags */
int r_ready; /* are the R's initialized? */
int c_ready; /* are the C's initialized? */
}block_model_t;
/* constructor/destructor */
/* placeholder is an empty floorplan frame with only the names of the functional units */
block_model_t *alloc_block_model(thermal_config_t *config, flp_t *placeholder);
void delete_block_model(block_model_t *model);
/* initialization */
void populate_R_model_block(block_model_t *model, flp_t *flp);
void populate_C_model_block(block_model_t *model, flp_t *flp);
/* hotspot main interfaces - temperature.c */
void steady_state_temp_block(block_model_t *model, double *power, double *temp);
void compute_temp_block(block_model_t *model, double *power, double *temp, double time_elapsed);
/* differs from 'dvector()' in that memory for internal nodes is also allocated */
double *hotspot_vector_block(block_model_t *model);
/* copy 'src' to 'dst' except for a window of 'size'
* elements starting at 'at'. useful in floorplan
* compaction
*/
void trim_hotspot_vector_block(block_model_t *model, double *dst, double *src,
int at, int size);
/* update the model's node count */
void resize_thermal_model_block(block_model_t *model, int n_units);
void set_temp_block (block_model_t *model, double *temp, double val);
void dump_temp_block (block_model_t *model, double *temp, char *file);
void copy_temp_block (block_model_t *model, double *dst, double *src);
void read_temp_block (block_model_t *model, double *temp, char *file, int clip);
void dump_power_block(block_model_t *model, double *power, char *file);
void read_power_block (block_model_t *model, double *power, char *file);
double find_max_temp_block(block_model_t *model, double *temp);
double find_avg_temp_block(block_model_t *model, double *temp);
double calc_sink_temp_block(block_model_t *model, double *temp, thermal_config_t *config); //for natural convection package model
/* debug print */
void debug_print_block(block_model_t *model);
#endif