PageRenderTime 48ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wattch/power.hh

https://bitbucket.org/musleh123/gem5_cetus
C++ Header | 558 lines | 342 code | 88 blank | 128 comment | 0 complexity | 13532baa6e3c846e021dbc60fbdbe99b MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  1. #ifndef POWER_H
  2. #define POWER_H
  3. /*------------------------------------------------------------
  4. * Copyright 1994 Digital Equipment Corporation and Steve Wilton
  5. * All Rights Reserved
  6. *
  7. * Permission to use, copy, and modify this software and its documentation is
  8. * hereby granted only under the following terms and conditions. Both the
  9. * above copyright notice and this permission notice must appear in all copies
  10. * of the software, derivative works or modified versions, and any portions
  11. * thereof, and both notices must appear in supporting documentation.
  12. *
  13. * Users of this software agree to the terms and conditions set forth herein,
  14. * and hereby grant back to Digital a non-exclusive, unrestricted, royalty-
  15. * free right and license under any changes, enhancements or extensions
  16. * made to the core functions of the software, including but not limited to
  17. * those affording compatibility with other hardware or software
  18. * environments, but excluding applications which incorporate this software.
  19. * Users further agree to use their best efforts to return to Digital any
  20. * such changes, enhancements or extensions that they make and inform Digital
  21. * of noteworthy uses of this software. Correspondence should be provided
  22. * to Digital at:
  23. *
  24. * Director of Licensing
  25. * Western Research Laboratory
  26. * Digital Equipment Corporation
  27. * 100 Hamilton Avenue
  28. * Palo Alto, California 94301
  29. *
  30. * This software may be distributed (but not offered for sale or transferred
  31. * for compensation) to third parties, provided such third parties agree to
  32. * abide by the terms and conditions of this notice.
  33. *
  34. * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
  35. * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
  36. * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
  37. * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  38. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  39. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  40. * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  41. * SOFTWARE.
  42. *------------------------------------------------------------*/
  43. //#include "stats.hh"
  44. // Malek
  45. #include "sim/core.hh"
  46. #include "wattch/host.hh"
  47. #include "wattch-interact.hh"
  48. //#define RADGATE
  49. /* The following are things you might want to change
  50. * when compiling
  51. */
  52. /*
  53. * The output can be in 'long' format, which shows everything, or
  54. * 'short' format, which is just what a program like 'grap' would
  55. * want to see
  56. */
  57. #define LONG 1
  58. #define SHORT 2
  59. #define OUTPUTTYPE LONG
  60. /*
  61. * Address bits in a word, and number of output bits from the cache
  62. */
  63. #define ADDRESS_BITS 64
  64. #define BITOUT 64
  65. /* limits on the various N parameters */
  66. #define MAXN 8 /* Maximum for Ndwl,Ntwl,Ndbl,Ntbl */
  67. #define MAXSUBARRAYS 8 /* Maximum subarrays for data and tag arrays */
  68. #define MAXSPD 8 /* Maximum for Nspd, Ntspd */
  69. /*===================================================================*/
  70. /*
  71. * The following are things you probably wouldn't want to change.
  72. */
  73. #define TRUE 1
  74. #define FALSE 0
  75. #define OK 1
  76. #define ERROR 0
  77. #define BIGNUM 1e30
  78. #define DIVIDE(a,b) ((b)==0)? 0:(a)/(b)
  79. #ifndef MAX
  80. #define MAX(a,b) (((a)>(b))?(a):(b))
  81. #endif
  82. /* Used to communicate with the horowitz model */
  83. #define RISE 1
  84. #define FALL 0
  85. #define NCH 1
  86. #define PCH 0
  87. /*
  88. * The following scale factor can be used to scale between technologies.
  89. * To convert from 0.8um to 0.5um, make FUDGEFACTOR = 1.6
  90. */
  91. #define FUDGEFACTOR 6.1538
  92. /*===================================================================*/
  93. /*
  94. * Cache layout parameters and process parameters
  95. * Thanks to Glenn Reinman for the technology scaling factors
  96. */
  97. #define GEN_POWER_FACTOR 1.31
  98. /* Trial run for 70nm! */
  99. #if defined(TECH_POINT07)
  100. #define CSCALE (84.2172) /* wire capacitance scaling factor */
  101. /* linear: 51.7172, predicted: 84.2172 */
  102. #define RSCALE (80.0000) /* wire resistance scaling factor */
  103. #define LSCALE 0.1250 /* length (feature) scaling factor */
  104. #define ASCALE (LSCALE*LSCALE) /* area scaling factor */
  105. #define VSCALE 0.38 /* voltage scaling factor */
  106. #define VTSCALE 0.49 /* threshold voltage scaling factor */
  107. #define SSCALE 0.80 /* sense voltage scaling factor */
  108. #define GEN_POWER_SCALE (1/(GEN_POWER_FACTOR*GEN_POWER_FACTOR))
  109. #undef FUDGEFACTOR
  110. #define FUDGEFACTOR 11.4286
  111. #undef LEAK_K1
  112. #define LEAK_K1 0.000267538
  113. #undef LEAK_K2
  114. #define LEAK_K2 1487.595377
  115. #elif defined(TECH_POINT10)
  116. #define CSCALE (84.2172) /* wire capacitance scaling factor */
  117. /* linear: 51.7172, predicted: 84.2172 */
  118. #define RSCALE (80.0000) /* wire resistance scaling factor */
  119. #define LSCALE 0.1250 /* length (feature) scaling factor */
  120. #define ASCALE (LSCALE*LSCALE) /* area scaling factor */
  121. #define VSCALE 0.38 /* voltage scaling factor */
  122. #define VTSCALE 0.49 /* threshold voltage scaling factor */
  123. #define SSCALE 0.80 /* sense voltage scaling factor */
  124. #define GEN_POWER_SCALE (1/GEN_POWER_FACTOR)
  125. #elif defined(TECH_POINT18)
  126. #define CSCALE (19.7172) /* wire capacitance scaling factor */
  127. #define RSCALE (20.0000) /* wire resistance scaling factor */
  128. #define LSCALE 0.2250 /* length (feature) scaling factor */
  129. #define ASCALE (LSCALE*LSCALE) /* area scaling factor */
  130. #define VSCALE 0.4 /* voltage scaling factor */
  131. #define VTSCALE 0.5046 /* threshold voltage scaling factor */
  132. #define SSCALE 0.85 /* sense voltage scaling factor */
  133. #define GEN_POWER_SCALE 1
  134. #elif defined(TECH_POINT25)
  135. #define CSCALE (10.2197) /* wire capacitance scaling factor */
  136. #define RSCALE (10.2571) /* wire resistance scaling factor */
  137. #define LSCALE 0.3571 /* length (feature) scaling factor */
  138. #define ASCALE (LSCALE*LSCALE) /* area scaling factor */
  139. #define VSCALE 0.45 /* voltage scaling factor */
  140. #define VTSCALE 0.5596 /* threshold voltage scaling factor */
  141. #define SSCALE 0.90 /* sense voltage scaling factor */
  142. #define GEN_POWER_SCALE GEN_POWER_FACTOR
  143. #elif defined(TECH_POINT35a)
  144. #define CSCALE (5.2197) /* wire capacitance scaling factor */
  145. #define RSCALE (5.2571) /* wire resistance scaling factor */
  146. #define LSCALE 0.4375 /* length (feature) scaling factor */
  147. #define ASCALE (LSCALE*LSCALE) /* area scaling factor */
  148. #define VSCALE 0.5 /* voltage scaling factor */
  149. #define VTSCALE 0.6147 /* threshold voltage scaling factor */
  150. #define SSCALE 0.95 /* sense voltage scaling factor */
  151. #define GEN_POWER_SCALE (GEN_POWER_FACTOR*GEN_POWER_FACTOR)
  152. #elif defined(TECH_POINT35)
  153. #define CSCALE (5.2197) /* wire capacitance scaling factor */
  154. #define RSCALE (5.2571) /* wire resistance scaling factor */
  155. #define LSCALE 0.4375 /* length (feature) scaling factor */
  156. #define ASCALE (LSCALE*LSCALE) /* area scaling factor */
  157. #define VSCALE 0.5 /* voltage scaling factor */
  158. #define VTSCALE 0.6147 /* threshold voltage scaling factor */
  159. #define SSCALE 0.95 /* sense voltage scaling factor */
  160. #define GEN_POWER_SCALE (GEN_POWER_FACTOR*GEN_POWER_FACTOR)
  161. #elif defined(TECH_POINT40)
  162. #define CSCALE 1.0 /* wire capacitance scaling factor */
  163. #define RSCALE 1.0 /* wire resistance scaling factor */
  164. #define LSCALE 0.5 /* length (feature) scaling factor */
  165. #define ASCALE (LSCALE*LSCALE) /* area scaling factor */
  166. #define VSCALE 1.0 /* voltage scaling factor */
  167. #define VTSCALE 1.0 /* threshold voltage scaling factor */
  168. #define SSCALE 1.0 /* sense voltage scaling factor */
  169. #define GEN_POWER_SCALE (GEN_POWER_FACTOR*GEN_POWER_FACTOR*GEN_POWER_FACTOR)
  170. #else /* TECH_POINT80 */
  171. /* scaling factors */
  172. #define CSCALE 1.0 /* wire capacitance scaling factor */
  173. #define RSCALE 1.0 /* wire resistance scaling factor */
  174. #define LSCALE 1.0 /* length (feature) scaling factor */
  175. #define ASCALE (LSCALE*LSCALE) /* area scaling factor */
  176. #define VSCALE 1.0 /* voltage scaling factor */
  177. #define VTSCALE 1.0 /* threshold voltage scaling factor */
  178. #define SSCALE 1.0 /* sense voltage scaling factor */
  179. #define GEN_POWER_SCALE (GEN_POWER_FACTOR*GEN_POWER_FACTOR*GEN_POWER_FACTOR*GEN_POWER_FACTOR)
  180. #endif
  181. #ifndef LEAK_K1
  182. #define LEAK_K1 0.000546059
  183. #endif
  184. #ifndef LEAK_K2
  185. #define LEAK_K2 2426.260497
  186. #endif
  187. /*
  188. * CMOS 0.8um model parameters
  189. * - from Appendix II of Cacti tech report
  190. */
  191. /* corresponds to 8um of m3 @ 225ff/um */
  192. #define Cwordmetal (1.8e-15 * (CSCALE * ASCALE))
  193. /* corresponds to 16um of m2 @ 275ff/um */
  194. #define Cbitmetal (4.4e-15 * (CSCALE * ASCALE))
  195. /* corresponds to 1um of m2 @ 275ff/um */
  196. #define Cmetal Cbitmetal/16
  197. #define CM3metal Cbitmetal/16
  198. #define CM2metal Cbitmetal/16
  199. /* #define Cmetal 1.222e-15 */
  200. /* fF/um2 at 1.5V */
  201. #define Cndiffarea 0.137e-15 /* FIXME: ??? */
  202. /* fF/um2 at 1.5V */
  203. #define Cpdiffarea 0.343e-15 /* FIXME: ??? */
  204. /* fF/um at 1.5V */
  205. #define Cndiffside 0.275e-15 /* in general this does not scale */
  206. /* fF/um at 1.5V */
  207. #define Cpdiffside 0.275e-15 /* in general this does not scale */
  208. /* fF/um at 1.5V */
  209. #define Cndiffovlp 0.138e-15 /* FIXME: by depth??? */
  210. /* fF/um at 1.5V */
  211. #define Cpdiffovlp 0.138e-15 /* FIXME: by depth??? */
  212. /* fF/um assuming 25% Miller effect */
  213. #define Cnoxideovlp 0.263e-15 /* FIXME: by depth??? */
  214. /* fF/um assuming 25% Miller effect */
  215. #define Cpoxideovlp 0.338e-15 /* FIXME: by depth??? */
  216. /* um */
  217. #define Leff (0.8 * LSCALE)
  218. /* fF/um2 */
  219. #define Cgate 1.95e-15 /* FIXME: ??? */
  220. /* fF/um2 */
  221. #define Cgatepass 1.45e-15 /* FIXME: ??? */
  222. /* note that the value of Cgatepass will be different depending on
  223. whether or not the source and drain are at different potentials or
  224. the same potential. The two values were averaged */
  225. /* fF/um */
  226. #define Cpolywire (0.25e-15 * CSCALE * LSCALE)
  227. /* ohms*um of channel width */
  228. #define Rnchannelstatic (25800 * LSCALE)
  229. /* ohms*um of channel width */
  230. #define Rpchannelstatic (61200 * LSCALE)
  231. #define Rnchannelon (9723 * LSCALE)
  232. #define Rpchannelon (22400 * LSCALE)
  233. /* corresponds to 16um of m2 @ 48mO/sq */
  234. #define Rbitmetal (0.320 * (RSCALE * ASCALE))
  235. /* corresponds to 8um of m3 @ 24mO/sq */
  236. #define Rwordmetal (0.080 * (RSCALE * ASCALE))
  237. /* other stuff (from tech report, appendix 1) */
  238. #define Period (1/(double)Mhz)
  239. #define krise (0.4e-9 * LSCALE)
  240. #define tsensedata (5.8e-10 * LSCALE)
  241. #define tsensetag (2.6e-10 * LSCALE)
  242. #define tfalldata (7e-10 * LSCALE)
  243. #define tfalltag (7e-10 * LSCALE)
  244. #define Vbitpre (3.3 * SSCALE)
  245. #define Vt (1.09 * VTSCALE)
  246. #define Vbitsense (0.10 * SSCALE)
  247. #define Powerfactor (Mhz)*Vdd*Vdd
  248. #define SensePowerfactor3 (Mhz)*(Vbitsense)*(Vbitsense)
  249. #define SensePowerfactor2 (Mhz)*(Vbitpre-Vbitsense)*(Vbitpre-Vbitsense)
  250. #define SensePowerfactor (Mhz)*(Vdd/2)*(Vdd/2)
  251. #define AF .5
  252. #define POPCOUNT_AF (23.9/64.0)
  253. /* Threshold voltages (as a proportion of Vdd)
  254. If you don't know them, set all values to 0.5 */
  255. #define VSINV 0.456
  256. #define VTHINV100x60 0.438 /* inverter with p=100,n=60 */
  257. #define VTHNAND60x90 0.561 /* nand with p=60 and three n=90 */
  258. #define VTHNOR12x4x1 0.503 /* nor with p=12, n=4, 1 input */
  259. #define VTHNOR12x4x2 0.452 /* nor with p=12, n=4, 2 inputs */
  260. #define VTHNOR12x4x3 0.417 /* nor with p=12, n=4, 3 inputs */
  261. #define VTHNOR12x4x4 0.390 /* nor with p=12, n=4, 4 inputs */
  262. #define VTHOUTDRINV 0.437
  263. #define VTHOUTDRNOR 0.431
  264. #define VTHOUTDRNAND 0.441
  265. #define VTHOUTDRIVE 0.425
  266. #define VTHCOMPINV 0.437
  267. #define VTHMUXDRV1 0.437
  268. #define VTHMUXDRV2 0.486
  269. #define VTHMUXDRV3 0.437
  270. #define VTHEVALINV 0.267
  271. #define VTHSENSEEXTDRV 0.437
  272. /* transistor widths in um (as described in tech report, appendix 1) */
  273. #define Wdecdrivep (57.0 * LSCALE)
  274. #define Wdecdriven (40.0 * LSCALE)
  275. #define Wdec3to8n (14.4 * LSCALE)
  276. #define Wdec3to8p (14.4 * LSCALE)
  277. #define WdecNORn (5.4 * LSCALE)
  278. #define WdecNORp (30.5 * LSCALE)
  279. #define Wdecinvn (5.0 * LSCALE)
  280. #define Wdecinvp (10.0 * LSCALE)
  281. #define Wworddrivemax (100.0 * LSCALE)
  282. #define Wmemcella (2.4 * LSCALE)
  283. #define Wmemcellr (4.0 * LSCALE)
  284. #define Wmemcellw (2.1 * LSCALE)
  285. #define Wmemcellbscale 2 /* means 2x bigger than Wmemcella */
  286. #define Wbitpreequ (10.0 * LSCALE)
  287. #define Wbitmuxn (10.0 * LSCALE)
  288. #define WsenseQ1to4 (4.0 * LSCALE)
  289. #define Wcompinvp1 (10.0 * LSCALE)
  290. #define Wcompinvn1 (6.0 * LSCALE)
  291. #define Wcompinvp2 (20.0 * LSCALE)
  292. #define Wcompinvn2 (12.0 * LSCALE)
  293. #define Wcompinvp3 (40.0 * LSCALE)
  294. #define Wcompinvn3 (24.0 * LSCALE)
  295. #define Wevalinvp (20.0 * LSCALE)
  296. #define Wevalinvn (80.0 * LSCALE)
  297. #define Wcompn (20.0 * LSCALE)
  298. #define Wcompp (30.0 * LSCALE)
  299. #define Wcomppreequ (40.0 * LSCALE)
  300. #define Wmuxdrv12n (30.0 * LSCALE)
  301. #define Wmuxdrv12p (50.0 * LSCALE)
  302. #define WmuxdrvNANDn (20.0 * LSCALE)
  303. #define WmuxdrvNANDp (80.0 * LSCALE)
  304. #define WmuxdrvNORn (60.0 * LSCALE)
  305. #define WmuxdrvNORp (80.0 * LSCALE)
  306. #define Wmuxdrv3n (200.0 * LSCALE)
  307. #define Wmuxdrv3p (480.0 * LSCALE)
  308. #define Woutdrvseln (12.0 * LSCALE)
  309. #define Woutdrvselp (20.0 * LSCALE)
  310. #define Woutdrvnandn (24.0 * LSCALE)
  311. #define Woutdrvnandp (10.0 * LSCALE)
  312. #define Woutdrvnorn (6.0 * LSCALE)
  313. #define Woutdrvnorp (40.0 * LSCALE)
  314. #define Woutdrivern (48.0 * LSCALE)
  315. #define Woutdriverp (80.0 * LSCALE)
  316. #define Wcompcellpd2 (2.4 * LSCALE)
  317. #define Wcompdrivern (400.0 * LSCALE)
  318. #define Wcompdriverp (800.0 * LSCALE)
  319. #define Wcomparen2 (40.0 * LSCALE)
  320. #define Wcomparen1 (20.0 * LSCALE)
  321. #define Wmatchpchg (10.0 * LSCALE)
  322. #define Wmatchinvn (10.0 * LSCALE)
  323. #define Wmatchinvp (20.0 * LSCALE)
  324. #define Wmatchnandn (20.0 * LSCALE)
  325. #define Wmatchnandp (10.0 * LSCALE)
  326. #define Wmatchnorn (20.0 * LSCALE)
  327. #define Wmatchnorp (10.0 * LSCALE)
  328. #define WSelORn (10.0 * LSCALE)
  329. #define WSelORprequ (40.0 * LSCALE)
  330. #define WSelPn (10.0 * LSCALE)
  331. #define WSelPp (15.0 * LSCALE)
  332. #define WSelEnn (5.0 * LSCALE)
  333. #define WSelEnp (10.0 * LSCALE)
  334. #define Wsenseextdrv1p (40.0*LSCALE)
  335. #define Wsenseextdrv1n (24.0*LSCALE)
  336. #define Wsenseextdrv2p (200.0*LSCALE)
  337. #define Wsenseextdrv2n (120.0*LSCALE)
  338. /* bit width of RAM cell in um */
  339. #define BitWidth (16.0 * LSCALE)
  340. /* bit height of RAM cell in um */
  341. #define BitHeight (16.0 * LSCALE)
  342. #define Cout (0.5e-12 * LSCALE)
  343. /* Sizing of cells and spacings */
  344. #define RatCellHeight (40.0 * LSCALE)
  345. #define RatCellWidth (70.0 * LSCALE)
  346. #define RatShiftRegWidth (120.0 * LSCALE)
  347. #define RatNumShift 4
  348. #define BitlineSpacing (6.0 * LSCALE)
  349. #define WordlineSpacing (6.0 * LSCALE)
  350. #define RegCellHeight (16.0 * LSCALE)
  351. #define RegCellWidth (8.0 * LSCALE)
  352. #define CamCellHeight (40.0 * LSCALE)
  353. #define CamCellWidth (25.0 * LSCALE)
  354. #define MatchlineSpacing (6.0 * LSCALE)
  355. #define TaglineSpacing (6.0 * LSCALE)
  356. /*===================================================================*/
  357. /* ALU POWER NUMBERS for .18um 733Mhz */
  358. /* normalize to cap from W */
  359. #define NORMALIZE_SCALE (1.0/(733.0e6*1.45*1.45))
  360. /* normalize .18um cap to other gen's cap, then xPowerfactor */
  361. #define POWER_SCALE (GEN_POWER_SCALE * NORMALIZE_SCALE * Powerfactor)
  362. #define I_ADD ((.37 - .091) * POWER_SCALE)
  363. #define I_ADD32 (((.37 - .091)/2)*POWER_SCALE)
  364. #define I_MULT16 ((.31-.095)*POWER_SCALE)
  365. #define I_SHIFT ((.21-.089)*POWER_SCALE)
  366. #define I_LOGIC ((.04-.015)*POWER_SCALE)
  367. #define F_ADD ((1.307-.452)*POWER_SCALE)
  368. #define F_MULT ((1.307-.452)*POWER_SCALE)
  369. #define I_ADD_CLOCK (.091*POWER_SCALE)
  370. #define I_MULT_CLOCK (.095*POWER_SCALE)
  371. #define I_SHIFT_CLOCK (.089*POWER_SCALE)
  372. #define I_LOGIC_CLOCK (.015*POWER_SCALE)
  373. #define F_ADD_CLOCK (.452*POWER_SCALE)
  374. #define F_MULT_CLOCK (.452*POWER_SCALE)
  375. /* Used to pass values around the program */
  376. /*
  377. typedef struct {
  378. int tech;
  379. int iw;
  380. int winsize;
  381. int nvreg;
  382. int npreg;
  383. int nvreg_width;
  384. int npreg_width;
  385. int data_width;
  386. } wattch_parameter_type;
  387. */
  388. /* Used to pass values around the program */
  389. typedef struct {
  390. int cache_size;
  391. int number_of_sets;
  392. int associativity;
  393. int block_size;
  394. } time_parameter_type;
  395. typedef struct {
  396. double access_time,cycle_time;
  397. int best_Ndwl,best_Ndbl;
  398. int best_Nspd;
  399. int best_Ntwl,best_Ntbl;
  400. int best_Ntspd;
  401. double decoder_delay_data,decoder_delay_tag;
  402. double dec_data_driver,dec_data_3to8,dec_data_inv;
  403. double dec_tag_driver,dec_tag_3to8,dec_tag_inv;
  404. double wordline_delay_data,wordline_delay_tag;
  405. double bitline_delay_data,bitline_delay_tag;
  406. double sense_amp_delay_data,sense_amp_delay_tag;
  407. double senseext_driver_delay_data;
  408. double compare_part_delay;
  409. double drive_mux_delay;
  410. double selb_delay;
  411. double data_output_delay;
  412. double drive_valid_delay;
  413. double precharge_delay;
  414. } time_result_type;
  415. double logtwo(double x);
  416. double gatecap(double width,double wirelength);
  417. double gatecappass(double width,double wirelength);
  418. double draincap(double width,int nchannel,int stack);
  419. double restowidth(double res,int nchannel);
  420. double simple_array_power(int rows,int cols,int rports,int wports,int cache);
  421. double simple_array_decoder_power(int rows,int cols,int rports,int wports,int cache);
  422. double simple_array_bitline_power(int rows,int cols,int rports,int wports,int cache);
  423. double simple_array_wordline_power(int rows,int cols,int rports,int wports,int cache);
  424. double squarify_new(int rows,int cols);
  425. /* register power stats */
  426. void power_reg_stats(struct stat_sdb_t *sdb);/* stats database */
  427. void calculate_time(time_result_type*, time_parameter_type*);
  428. void output_data(time_result_type*, time_parameter_type*);
  429. int pop_count(qword_t bits);
  430. int pop_count_slow(qword_t bits);
  431. void iq_power_recalculate(); /* lym */
  432. void fpq_power_recalculate(); /* lym */
  433. void rob_power_recalculate(); /* lym */
  434. void lsq_power_recalculate(); /* lym */
  435. /*for HotSpot*/
  436. extern int reg_counter;
  437. extern int int_window_counter;
  438. extern int fp_window_counter;
  439. extern counter_t shadow_sim_cycle;
  440. extern counter_t shadow_sim_num_insn;
  441. /* container for any per-structure stats */
  442. struct power_stats
  443. {
  444. double total;
  445. double queues;
  446. double int_queues;
  447. double fp_queues;
  448. double lsq_queues;
  449. double window;
  450. double int_window;
  451. double int_mapper;
  452. double fp_mapper;
  453. double fpadd, fpmul;
  454. double fp_window;
  455. double regfile;
  456. double bpred;
  457. double icache;
  458. double itlb;
  459. double dcache;
  460. double dtlb;
  461. double alu;
  462. double cachel2;
  463. double clock;
  464. };
  465. double leak2dynamic_ratio(double curKelvin, double V);
  466. extern double Vdd;
  467. extern int fp_mul_or_sqrt, fp_add_or_div;
  468. void clear_lots_of_stats();
  469. #define MD_NUM_IREGS 32
  470. #endif