• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/core/techModels/libHotSpot/temperature_grid.h

00001 #ifndef __TEMPERATURE_GRID_H_
00002 #define __TEMPERATURE_GRID_H_
00003 
00004 /* grid model differs from the block model in its use of
00005  * a mesh of cells whose resolution is configurable. unlike 
00006  * the block model, it can also model a stacked 3-D chip,
00007  * with each layer having a different floorplan. information
00008  * about the floorplan and the properties of each layer is
00009  * input in the form of a layer configuration file. 
00010  */
00011 #include "temperature.h"
00012 
00013 /* layer configuration file constants */
00014 #define LCF_NPARAMS                     7       /* no. of parameters per layer  */
00015 #define LCF_SNO                         0       /* serial number        */
00016 #define LCF_LATERAL                     1       /* has lateral heat flow?       */
00017 #define LCF_POWER                       2       /* dissipates power?    */
00018 #define LCF_SP                          3       /* specific heat capacity       */
00019 #define LCF_RHO                         4       /* resistivity  */
00020 #define LCF_THICK                       5       /* thickness    */
00021 #define LCF_FLP                         6       /* floorplan file       */
00022 
00023 /* vector types - power / temperature   */
00024 #define V_POWER                         0
00025 #define V_TEMP                          1
00026 
00027 /* default no. of chip layers (excluding spreader 
00028  * and sink). used when LCF file is not specified
00029  */
00030 #define DEFAULT_CHIP_LAYERS     2
00031 #define LAYER_SI                        0
00032 #define LAYER_INT                       1
00033 
00034 /* layers of secondary path with same area as die */
00035 #define SEC_CHIP_LAYERS 2
00036 #define LAYER_METAL 0
00037 #define LAYER_C4        1
00038 
00039 /* default no. of package layers        */
00040 #define DEFAULT_PACK_LAYERS     2
00041 #define LAYER_SP                        0
00042 #define LAYER_SINK                      1
00043 
00044 /* additional package layers from secondary path */
00045 #define SEC_PACK_LAYERS 3
00046 #define LAYER_SUB       0
00047 #define LAYER_SOLDER    1
00048 #define LAYER_PCB       2
00049 
00050 /* block list: block to grid mapping data structure.
00051  * list of blocks mapped to a grid cell 
00052  */
00053 typedef struct blist_t_st
00054 {
00055         /* index of the mapped block    */
00056         int idx;
00057         /* ratio of this block's area within the grid cell 
00058          * to the total area of the grid cell
00059          */
00060         double occupancy;
00061         /* next block mapped to the same cell   */
00062         struct blist_t_st *next;
00063 }blist_t;
00064 
00065 /* grid list: grid to block mapping data structure.
00066  * start and end indices of grid cells in a block
00067  * (both in the x and y directions)
00068  */
00069 typedef struct glist_t_st
00070 {
00071         /* start index in the y direction       */
00072         int i1;
00073         /* end index in the y direction + 1     */
00074         int i2;
00075         /* start index in the x direction       */
00076         int j1;
00077         /* end index in the x direction + 1     */
00078         int j2;
00079 } glist_t;
00080 
00081 /* one layer of the grid model. a 3-D chip is a stacked
00082  * set of layers
00083  */
00084 typedef struct layer_t_st 
00085 {
00086         /* floorplan */
00087         flp_t *flp;
00088 
00089         /* configuration parameters     */
00090         int no;                         /* serial number        */
00091         int has_lateral;        /* model lateral spreading of heat?     */
00092         int has_power;          /* dissipates power?    */
00093         double k;                       /* 1/resistivity        */
00094         double k1;      /* thermal conductivity of the other material in some layers, such as C4/underfill */
00095         double thickness;
00096         double sp;                      /* specific heat capacity       */
00097         double sp1; /* specific heat of the other material in some layers, such as C4/underfill */
00098 
00099         /* extracted information        */
00100         double rx, ry, rz;      /* x, y and z resistors */
00101         double rx1, ry1, rz1; /* resistors of the other material in some layers, e.g. c4/underfill*/
00102         double c, c1;                   /* capacitance  */
00103 
00104         /* block-grid map - 2-d array of block lists    */
00105         blist_t ***b2gmap;
00106         /* grid-block map - a 1-d array of grid lists   */
00107         glist_t *g2bmap;
00108 }layer_t;
00109 
00110 /* grid model's internal vector datatype        */
00111 typedef struct grid_model_vector_t_st
00112 {
00113         /* 3-d grid of nodes    */
00114         double ***cuboid;
00115         /* extra spreader and sink  nodes       */
00116         double *extra;
00117 }grid_model_vector_t;
00118 
00119 /* grid thermal model   */
00120 typedef struct grid_model_t_st
00121 {
00122         /* configuration        */
00123         thermal_config_t config;
00124 
00125         /* layer information    */
00126         layer_t *layers;
00127         int n_layers;
00128 
00129         /* grid resolution      */
00130         int rows;
00131         int cols;
00132         /* dimensions   */
00133         double width;
00134         double height;
00135 
00136         /* package parameters   */
00137         package_RC_t pack;
00138 
00139         /* sum total of the functional blocks of all floorplans */
00140         int total_n_blocks;
00141         /* grid-to-block mapping mode   */
00142         int map_mode;
00143 
00144         /* flags        */
00145         int r_ready;    /* are the R's initialized?     */
00146         int c_ready;    /* are the C's initialized?     */
00147         int has_lcf;    /* LCF file specified?          */
00148 
00149         /* internal state - most recently computed 
00150          * steady state temperatures
00151          */
00152         grid_model_vector_t *last_steady;
00153         /* internal state - most recently computed 
00154          * transient temperatures
00155          */
00156         /* grid cell temperatures       */
00157         grid_model_vector_t *last_trans;
00158         /* block temperatures   */
00159         double *last_temp;
00160 
00161         /* to allow for resizing        */
00162         int base_n_units;
00163 }grid_model_t;
00164 
00165 /* constructor/destructor       */
00166 grid_model_t *alloc_grid_model(thermal_config_t *config, flp_t *flp_default);
00167 void delete_grid_model(grid_model_t *model);
00168 
00169 /* initialization       */
00170 void populate_R_model_grid(grid_model_t *model, flp_t *flp);
00171 void populate_C_model_grid(grid_model_t *model, flp_t *flp);
00172 
00173 /* hotspot main interfaces - temperature.c      */
00174 void steady_state_temp_grid(grid_model_t *model, double *power, double *temp);
00175 void compute_temp_grid(grid_model_t *model, double *power, double *temp, double time_elapsed);
00176 
00177 /* differs from 'dvector()' in that memory for internal nodes is also allocated */
00178 double *hotspot_vector_grid(grid_model_t *model);
00179 /* copy 'src' to 'dst' except for a window of 'size'
00180  * elements starting at 'at'. useful in floorplan
00181  * compaction
00182  */
00183 void trim_hotspot_vector_grid(grid_model_t *model, double *dst, double *src, 
00184                                                           int at, int size);
00185 /* update the model's node count        */                                               
00186 void resize_thermal_model_grid(grid_model_t *model, int n_units);
00187 void set_temp_grid (grid_model_t *model, double *temp, double val);
00188 void dump_top_layer_temp_grid(grid_model_t *model, char *file, grid_model_vector_t *temp);
00189 void dump_steady_temp_grid (grid_model_t *model, char *file);
00190 void dump_temp_grid (grid_model_t *model, double *temp, char *file);
00191 void copy_temp_grid (grid_model_t *model, double *dst, double *src);
00192 void read_temp_grid (grid_model_t *model, double *temp, char *file, int clip);
00193 void dump_power_grid(grid_model_t *model, double *power, char *file);
00194 void read_power_grid (grid_model_t *model, double *power, char *file);
00195 double find_max_temp_grid(grid_model_t *model, double *temp);
00196 double find_avg_temp_grid(grid_model_t *model, double *temp);
00197 double calc_sink_temp_grid(grid_model_t *model, double *temp, thermal_config_t *config);
00198 
00199 /* grid_model_vector routines   */
00200 /* constructor  */
00201 grid_model_vector_t *new_grid_model_vector(grid_model_t *model);
00202 /* destructor   */
00203 void free_grid_model_vector(grid_model_vector_t *v);
00204 /* translate power/temperature between block and grid vectors   */
00205 void xlate_vector_b2g(grid_model_t *model, double *b, grid_model_vector_t *g, int type);
00206 /* translate temperature between grid and block vectors */
00207 void xlate_temp_g2b(grid_model_t *model, double *b, grid_model_vector_t *g);
00208 /* debug print  */
00209 void debug_print_grid(grid_model_t *model);
00210 
00211 #endif

Generated on Fri Oct 22 2010 11:02:14 for SST by  doxygen 1.7.1