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

sst/core/techModels/libsim-panalyzer/libpa_lv1/lv1_panalyzer.h

00001 #include <stdio.h>
00002 //#include "lv1_opts.h"
00003 
00004 /* power monitoring windows */
00005 #define MaxPMWindows 512
00006 
00007 
00008 /* effective capacitances type for power dissipation components */
00009 typedef struct _fu_lv1_Ceffs_t {
00010         double iCeff;           /* internal switching effective capacitance */
00011         double eCeff;           /* external switching effective capacitance */
00012 } fu_lv1_Ceffs_t;
00013 
00014 
00015 
00016 /* initialize a frame */  
00017 fu_lv1_pwr_frame_t * 
00018         init_pwr_frame();
00019 
00020 /* create a frame and setup/insert for evaluation */
00021 fu_lv1_pwr_frame_t *
00022 insert_pwr_frame(
00023          fu_lv1_pwr_frame_t *pwr_frame,
00024          tick_t now,
00025          unsigned lat
00026          );
00027 
00028 /* delete a frame */
00029 void 
00030 delete_pwr_frame(
00031         fu_lv1_pwr_frame_t *pwr_frame,
00032         fu_lv1_pwr_frame_t *root_frame
00033         );
00034 
00035 /* create/converte to buffer_t type data structure for various data types.
00036  * return an allocated location pointer.
00037  * caution: please deallocate the memory space  */
00038 buffer_t *
00039 create_buffer_t(
00040         void *val,      /* target conversion value */
00041         int bsize       /* conversion value data type size in bytes */);
00042 
00043 /* copy buffer_t type data structure */
00044 void
00045 copy_buffer_t(
00046         buffer_t *ibus, /* the source bus */ 
00047         buffer_t *jbus, /* the destination bus */
00048         unsigned bsize /* size of the bus in bytes */);
00049 
00050 /* return number of switching for the give previous bus and the current bus */
00051 unsigned
00052 obtain_nswitchings(
00053         buffer_t *ibus, /* the current bus */ 
00054         buffer_t *jbus, /* the previous bus */
00055         unsigned bsize /* size of the bus in bytes */);
00056 
00057 /* initialize pdissipation stat */
00058 void 
00059 initialize_fu_lv1_pdissipation(
00060         fu_lv1_pdissipation_t *pdissipation /* pdissipation stat ptr */);
00061 
00062 /* initialize pmwindow */
00063 void 
00064 initialize_fu_lv1_pmwindow(
00065         unsigned pmwindex, /* fu power monitoring window index */
00066         fu_lv1_pdissipation_t *pmwindow /* fu power monitoring window */);
00067 
00068 /* integrate the current power dissipation of fu from power monitoring windows 
00069  * to pdissipation stat db. */ 
00070 double 
00071 integrate_fu_lv1_pdissipation(
00072         unsigned pmwindex,      /* fu power monitoring window index */
00073         fu_lv1_pdissipation_t *pmwindow,        /* fu power monitoring window */
00074         fu_lv1_pdissipation_t *pdissipation     /* fu power dissipation statistics */);
00075 
00076 /* summate x/y switching + internal + leakage pdissipation of the current cycle.
00077  * return the summated pdissipation */
00078 double 
00079 summate_fu_lv1_pdissipation(
00080         unsigned pmwindex,      /* fu power monitoring window index */
00081         fu_lv1_pdissipation_t *pmwindow /* fu power monitoring window */);
00082 
00083 /* return pdissipation 
00084  * caution: this function must incorporate with ntransitions */
00085 double 
00086 estimate_pdissipation(
00087         double Ceff, /* effective capacitance */
00088         double opfreq, /* operating frequency */
00089         double svolt /* supply voltage */);
00090 
00091 
00092 enum pspec_component {lv1_alu,lv1_fpu,lv1_mult,
00093         lv1_bpred,lv1_rf,lv1_il1,lv1_il2,lv1_dl1,lv1_dl2,
00094         lv1_itlb,lv1_dtlb,lv1_clock,lv1_io,lv1_uarch,lv1_uarch_clear,
00095         lv1_pa_trace,lv1_pa_stats
00096         };
00097 
00098 void sim_lv1_panalyzer_check_options(
00099         double *tech_volt,
00100         double *tech_freq,
00101         double *alu_Ceff,
00102         double *fpu_Ceff,
00103         double *mult_Ceff,
00104         double *rf_Ceff,
00105         double *bpred_Ceff,
00106         double *clock_Ceff,
00107         char *io_option,
00108         int io_access_lat,
00109     int io_burst_lat, 
00110         fu_lv1_cache_Ceff_t *il1_Ceff,
00111         fu_lv1_cache_Ceff_t *il2_Ceff,
00112         fu_lv1_cache_Ceff_t *dl1_Ceff,
00113         fu_lv1_cache_Ceff_t *dl2_Ceff,
00114         fu_lv1_cache_Ceff_t *itlb_Ceff,
00115         fu_lv1_cache_Ceff_t *dtlb_Ceff);
00116 
00117 /* register level 1 power analayzer stats */
00118 void
00119 lv1_panalyzer_reg_stats(
00120         struct stat_sdb_t *sdb /* stats db ptr */);
00121 
00122 /* interface function with sim-panalyzer */
00123 /* Assigns tasks based on */
00124 void lv1_panalyzer(enum pspec_component pa_type,int user_data);
00125 
00126 /* print average power stats */ 
00127 void sim_lv1_panalyzer_stats(FILE *fd, int cycle);
00128 
00129 
00130 //added for SST
00131 void SSTsim_lv1_panalyzer_check_options(
00132         double tech_volt,
00133         double tech_freq,       
00134         double alu_Ceff,
00135         double fpu_Ceff,
00136         double mult_Ceff,
00137         double rf_Ceff,
00138         double bpred_Ceff,
00139         double clock_Ceff,
00140         //char io_option,
00141         //int io_access_lat,
00142         //int io_burst_lat, 
00143         double il1_iCeff, double il1_eCeff,
00144         double il2_iCeff, double il2_eCeff,
00145         double dl1_iCeff, double dl1_eCeff,
00146         double dl2_iCeff, double dl2_eCeff,
00147         double itlb_iCeff, double itlb_eCeff,
00148         double dtlb_iCeff, double dtlb_eCeff
00149         ); 
00150 
00151 /* return current power of pa_type (which should be power per usage as well) */
00152 double SSTlv1_panalyzerReadCurPower(enum pspec_component pa_type);

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