00001 #include <stdio.h>
00002
00003
00004
00005 #define MaxPMWindows 512
00006
00007
00008
00009 typedef struct _fu_lv1_Ceffs_t {
00010 double iCeff;
00011 double eCeff;
00012 } fu_lv1_Ceffs_t;
00013
00014
00015
00016
00017 fu_lv1_pwr_frame_t *
00018 init_pwr_frame();
00019
00020
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
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
00036
00037
00038 buffer_t *
00039 create_buffer_t(
00040 void *val,
00041 int bsize );
00042
00043
00044 void
00045 copy_buffer_t(
00046 buffer_t *ibus,
00047 buffer_t *jbus,
00048 unsigned bsize );
00049
00050
00051 unsigned
00052 obtain_nswitchings(
00053 buffer_t *ibus,
00054 buffer_t *jbus,
00055 unsigned bsize );
00056
00057
00058 void
00059 initialize_fu_lv1_pdissipation(
00060 fu_lv1_pdissipation_t *pdissipation );
00061
00062
00063 void
00064 initialize_fu_lv1_pmwindow(
00065 unsigned pmwindex,
00066 fu_lv1_pdissipation_t *pmwindow );
00067
00068
00069
00070 double
00071 integrate_fu_lv1_pdissipation(
00072 unsigned pmwindex,
00073 fu_lv1_pdissipation_t *pmwindow,
00074 fu_lv1_pdissipation_t *pdissipation );
00075
00076
00077
00078 double
00079 summate_fu_lv1_pdissipation(
00080 unsigned pmwindex,
00081 fu_lv1_pdissipation_t *pmwindow );
00082
00083
00084
00085 double
00086 estimate_pdissipation(
00087 double Ceff,
00088 double opfreq,
00089 double svolt );
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
00118 void
00119 lv1_panalyzer_reg_stats(
00120 struct stat_sdb_t *sdb );
00121
00122
00123
00124 void lv1_panalyzer(enum pspec_component pa_type,int user_data);
00125
00126
00127 void sim_lv1_panalyzer_stats(FILE *fd, int cycle);
00128
00129
00130
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
00141
00142
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
00152 double SSTlv1_panalyzerReadCurPower(enum pspec_component pa_type);