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

sst/core/techModels/libHotSpot/hotspot-iface.h

00001 #ifndef __HOTSPOT_IFACE_H_
00002 #define __HOTSPOT_IFACE_H_
00003 
00004 #define STR_SIZE        512
00005 #define MAX_UNITS       8192
00006 #define NULLFILE        "(null)"
00007 #define BLOCK_MODEL             0
00008 #define GRID_MODEL              1
00009 
00010 /* floorplan structure  */
00011 typedef struct unit_t_st
00012 {
00013         char name[STR_SIZE];
00014         double width;
00015         double height;
00016         double leftx;
00017         double bottomy;
00018 }unit_t;
00019 typedef struct flp_t_st
00020 {
00021         unit_t *units;
00022         int n_units;
00023         double **wire_density;
00024 } flp_t;
00025 
00026 /* floorplan routines   */
00027 
00028 /* reads the floorplan from a file and allocates memory. 
00029  * 'read_connects' is a boolean flag indicating if 
00030  * connectivity information should also be read (usually 
00031  * set to FALSE).
00032  */ 
00033 flp_t *read_flp(char *file, int read_connects);
00034 
00035 /* deletes floorplan from memory. 'compacted' is a 
00036  * boolean flag indicating if this is a floorplan
00037  * compacted by HotFloorplan (usually set to FALSE).
00038  */ 
00039 void free_flp(flp_t *flp, int compacted);
00040 
00041 /* thermal model configuration structure        */
00042 typedef struct thermal_config_t_st
00043 {
00044         double t_chip;
00045         double thermal_threshold;
00046         double c_convec;
00047         double r_convec;
00048         double s_sink;
00049         double t_sink;
00050         double s_spreader;
00051         double t_spreader;
00052         double t_interface;
00053         double ambient;
00054         char init_file[STR_SIZE];
00055         double init_temp;
00056         char steady_file[STR_SIZE];
00057         double sampling_intvl;
00058         double base_proc_freq;
00059         int dtm_used;
00060         char model_type[STR_SIZE];
00061         int block_omit_lateral;
00062         int grid_rows;
00063         int grid_cols;
00064         char grid_layer_file[STR_SIZE];
00065         char grid_steady_file[STR_SIZE];
00066         char grid_map_mode[STR_SIZE];
00067 }thermal_config_t;
00068 
00069 /* thermal configuration routines */
00070 
00071 /* returns a thermal configuration structure with
00072  * the default set of parameters
00073  */ 
00074 thermal_config_t default_thermal_config(void);
00075 
00076 /* thermal model structure      */
00077 struct block_model_t_st;
00078 struct grid_model_t_st;
00079 typedef struct RC_model_t_st
00080 {
00081         union
00082         {
00083                 struct block_model_t_st *block;
00084                 struct grid_model_t_st *grid;
00085         };
00086         int type;
00087         thermal_config_t *config;
00088 }RC_model_t;
00089 
00090 /* thermal model routines */
00091 
00092 /* creates a new thermal model. 'config' can be obtained 
00093  * from the 'default_thermal_config' function and 
00094  * 'placeholder' can be obtained from the 'read_flp' 
00095  * function
00096  */ 
00097 RC_model_t *alloc_RC_model(thermal_config_t *config, flp_t *placeholder);
00098 
00099 /* deletes the thermal model and frees up memory        */
00100 void delete_RC_model(RC_model_t *model);
00101 
00102 /* populates the thermal resistances of the model. This is
00103  * a prerequisite for computing transient or steady state
00104  * temperatures.
00105  */ 
00106 void populate_R_model(RC_model_t *model, flp_t *flp);
00107 
00108 /* populates the thermal capacitances of the model. This is
00109  * a prerequisite for computing transient temperatures.
00110  */ 
00111 void populate_C_model(RC_model_t *model, flp_t *flp);
00112 
00113 /* memory allocator for the power and temperature vectors       */
00114 double *hotspot_vector(RC_model_t *model);
00115 
00116 /* destructor for a vector allocated using 'hotspot_vector'     */
00117 void free_dvector(double *v);
00118 
00119 /* outputs the 'temp' vector onto 'file'. 'temp' must
00120  * be allocated using ' hotspot_vector'.
00121  */
00122 void dump_temp (RC_model_t *model, double *temp, char *file);
00123 
00124 /* sets all the temperatures of the 'temp' vector to the
00125  * value 'val'. 'temp' must be allocated using '
00126  * hotspot_vector'.
00127  */
00128 void set_temp (RC_model_t *model, double *temp, double val);
00129 
00130 /* read the 'temp' vector from 'file'. The format of the 
00131  * file should be the same as the one output by the 
00132  * 'dump_temp' function. 'temp' must be allocated using 
00133  * 'hotspot_vector'. 'clip' is a boolean flag indicating
00134  * whether to clip the peak temperature of the vector to
00135  * the thermal threshold 'model->config->thermal_threshold'
00136  * (usually set to FALSE).
00137  */
00138 void read_temp (RC_model_t *model, double *temp, char *file, int clip);
00139 
00140 /* computation of the steady state temperatures. 'power'
00141  * and 'temp' must be allocated using 'hotspot_vector'.
00142  * 'populate_R_model' must be called before this.
00143  * 'power' should contain the input power numbers. 'temp'
00144  * will contain the output temperature numbers after the 
00145  * call.
00146  */ 
00147 void steady_state_temp(RC_model_t *model, double *power, double *temp);
00148 
00149 /* computation of the transient temperatures. 'power'
00150  * and 'temp' must be allocated using 'hotspot_vector'.
00151  * 'populate_R_model' and 'populate_C_model' must be
00152  * called before this. 'power' should  contain the 
00153  * input power numbers and 'temp' should contain the 
00154  * current temperatures. 'time_elapsed' is the duration
00155  * of the transient simulation. 'temp' will contain the
00156  * output temperature numbers after the call.
00157  */ 
00158 void compute_temp(RC_model_t *model, double *power, double *temp, double time_elapsed);
00159 
00160 #endif

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