-
Notifications
You must be signed in to change notification settings - Fork 1
/
cacti.h
472 lines (401 loc) · 13.3 KB
/
cacti.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
/*------------------------------------------------------------
* CACTI 3.0
* Copyright 2002 Compaq Computer Corporation
* All Rights Reserved
*
* Permission to use, copy, and modify this software and its documentation is
* hereby granted only under the following terms and conditions. Both the
* above copyright notice and this permission notice must appear in all copies
* of the software, derivative works or modified versions, and any portions
* thereof, and both notices must appear in supporting documentation.
*
* Users of this software agree to the terms and conditions set forth herein,
* and hereby grant back to Compaq a non-exclusive, unrestricted, royalty-
* free right and license under any changes, enhancements or extensions
* made to the core functions of the software, including but not limited to
* those affording compatibility with other hardware or software
* environments, but excluding applications which incorporate this software.
* Users further agree to use their best efforts to return to Compaq any
* such changes, enhancements or extensions that they make and inform Compaq
* of noteworthy uses of this software. Correspondence should be provided
* to Compaq at:
*
* Director of Licensing
* Western Research Laboratory
* Compaq Computer Corporation
* 250 University Avenue
* Palo Alto, California 94301
*
* This software may be distributed (but not offered for sale or transferred
* for compensation) to third parties, provided such third parties agree to
* abide by the terms and conditions of this notice.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND COMPAQ COMPUTER CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL COMPAQ COMPUTER
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*------------------------------------------------------------*/
/* The following are things you might want to change
* when compiling
*/
/*
* The output can be in 'long' format, which shows everything, or
* 'short' format, which is just what a program like 'grap' would
* want to see
*/
#define LONG 1
#define SHORT 2
#define OUTPUTTYPE LONG
/*
* Address bits in a word, and number of output bits from the cache
*/
#define ADDRESS_BITS 32
#define BITOUT 64
/* limits on the various N parameters */
#define MAXN 32 /* Maximum for Ndwl,Ntwl,Ndbl,Ntbl */
#define MAXSUBARRAYS 32 /* Maximum subarrays for data and tag arrays */
#define MAXSPD 32 /* Maximum for Nspd, Ntspd */
/*
* The following scale factor can be used to scale between technologies.
* To convert from 0.8um to 0.5um, make FUDGEFACTOR = 1.6
*/
static float FUDGEFACTOR;
#define FEATURESIZE 0.8
/*===================================================================*/
/*
* Cache layout parameters and process parameters
*/
/*
* CMOS 0.8um model parameters
* - directly from Appendix II of tech report
*/
/*#define WORDWIRELENGTH (8+2*WIREPITCH*(EXTRAWRITEPORTS)+2*WIREPITCH*(EXTRAREADPORTS))*/
/*#define BITWIRELENGTH (16+2*WIREPITCH*(EXTRAWRITEPORTS+EXTRAREADPORTS))*/
#define WIRESPACING (2*FEATURESIZE)
#define WIREWIDTH (3*FEATURESIZE)
#define WIREPITCH (WIRESPACING+WIREWIDTH)
#define Cmetal 275e-18
#define Rmetal 48e-3
static double Cwordmetal;
static double Cbitmetal;
static double Rwordmetal;
static double Rbitmetal;
static double FACwordmetal;
static double FACbitmetal;
static double FARwordmetal;
static double FARbitmetal;
static int muxover;
/* fF/um2 at 1.5V */
#define Cndiffarea 0.137e-15
/* fF/um2 at 1.5V */
#define Cpdiffarea 0.343e-15
/* fF/um at 1.5V */
#define Cndiffside 0.275e-15
/* fF/um at 1.5V */
#define Cpdiffside 0.275e-15
/* fF/um at 1.5V */
#define Cndiffovlp 0.138e-15
/* fF/um at 1.5V */
#define Cpdiffovlp 0.138e-15
/* fF/um assuming 25% Miller effect */
#define Cnoxideovlp 0.263e-15
/* fF/um assuming 25% Miller effect */
#define Cpoxideovlp 0.338e-15
/* um */
#define Leff (0.8)
/* fF/um2 */
#define Cgate 1.95e-15
/* fF/um2 */
#define Cgatepass 1.45e-15
/* note that the value of Cgatepass will be different depending on
whether or not the source and drain are at different potentials or
the same potential. The two values were averaged */
/* fF/um */
#define Cpolywire (0.25e-15)
/* ohms*um of channel width */
#define Rnchannelstatic (25800)
/* ohms*um of channel width */
#define Rpchannelstatic (61200)
#define Rnchannelon (8751)
#define Rpchannelon (20160)
#define Vdd 5
static float VddPow;
/* Threshold voltages (as a proportion of Vdd)
If you don't know them, set all values to 0.5 */
#define VTHNAND 0.561
#define VTHFA1 0.452
#define VTHFA2 0.304
#define VTHFA3 0.420
#define VTHFA4 0.413
#define VTHFA5 0.405
#define VTHFA6 0.452
#define VSINV 0.452
#define VTHINV100x60 0.438 /* inverter with p=100,n=60 */
#define VTHINV360x240 0.420 /* inverter with p=360, n=240 */
#define VTHNAND60x90 0.561 /* nand with p=60 and three n=90 */
#define VTHNOR12x4x1 0.503 /* nor with p=12, n=4, 1 input */
#define VTHNOR12x4x2 0.452 /* nor with p=12, n=4, 2 inputs */
#define VTHNOR12x4x3 0.417 /* nor with p=12, n=4, 3 inputs */
#define VTHNOR12x4x4 0.390 /* nor with p=12, n=4, 4 inputs */
#define VTHOUTDRINV 0.437
#define VTHOUTDRNOR 0.379
#define VTHOUTDRNAND 0.63
#define VTHOUTDRIVE 0.425
#define VTHCOMPINV 0.437
#define VTHMUXNAND 0.548
#define VTHMUXDRV1 0.406
#define VTHMUXDRV2 0.334
#define VTHMUXDRV3 0.478
#define VTHEVALINV 0.452
#define VTHSENSEEXTDRV 0.438
#define VTHNAND60x120 0.522
/* transistor widths in um (as described in tech report, appendix 1) */
#define Wdecdrivep (360.0)
#define Wdecdriven (240.0)
#define Wdec3to8n 120.0
#define Wdec3to8p 60.0
#define WdecNORn 2.4
#define WdecNORp 12.0
#define Wdecinvn 20.0
#define Wdecinvp 40.0
#define Wworddrivemax 100.0
#define Wmemcella (2.4)
#define Wmemcellbscale 2 /* means 2x bigger than Wmemcella */
#define Wbitpreequ (80.0)
#define Wbitmuxn (10.0)
#define WsenseQ1to4 (4.0)
#define Wcompinvp1 (10.0)
#define Wcompinvn1 (6.0)
#define Wcompinvp2 (20.0)
#define Wcompinvn2 (12.0)
#define Wcompinvp3 (40.0)
#define Wcompinvn3 (24.0)
#define Wevalinvp (80.0)
#define Wevalinvn (40.0)
#define Wfadriven (50.0)
#define Wfadrivep (100.0)
#define Wfadrive2n (200.0)
#define Wfadrive2p (400.0)
#define Wfadecdrive1n (5.0)
#define Wfadecdrive1p (10.0)
#define Wfadecdrive2n (20.0)
#define Wfadecdrive2p (40.0)
#define Wfadecdriven (50.0)
#define Wfadecdrivep (100.0)
#define Wfaprechn (6.0)
#define Wfaprechp (10.0)
#define Wdummyn (10.0)
#define Wdummyinvn (60.0)
#define Wdummyinvp (80.0)
#define Wfainvn (10.0)
#define Wfainvp (20.0)
#define Waddrnandn (50.0)
#define Waddrnandp (50.0)
#define Wfanandn (20.0)
#define Wfanandp (30.0)
#define Wfanorn (5.0)
#define Wfanorp (10.0)
#define Wdecnandn (10.0)
#define Wdecnandp (30.0)
#define Wcompn (10.0)
#define Wcompp (30.0)
#define Wmuxdrv12n (60.0)
#define Wmuxdrv12p (100.0)
#define WmuxdrvNANDn (60.0)
#define WmuxdrvNANDp (80.0)
#define WmuxdrvNORn (40.0)
#define WmuxdrvNORp (100.0)
#define Wmuxdrv3n (80.0)
#define Wmuxdrv3p (200.0)
#define Woutdrvseln (24.0)
#define Woutdrvselp (40.0)
#define Woutdrvnandn (10.0)
#define Woutdrvnandp (30.0)
#define Woutdrvnorn (5.0)
#define Woutdrvnorp (20.0)
#define Woutdrivern (48.0)
#define Woutdriverp (80.0)
#define Wsenseextdrv1p (80.0)
#define Wsenseextdrv1n (40.0)
#define Wsenseextdrv2p (240.0)
#define Wsenseextdrv2n (160.0)
/* other stuff (from tech report, appendix 1) */
#define krise (0.4e-9)
#define tsensedata (5.8e-10)
// #define psensedata (0.025e-9)
#define psensedata (0.02e-9)
#define tsensescale 0.02e-10
#define tsensetag (2.6e-10)
// #define psensetag (0.01e-9)
#define psensetag (0.016e-9)
#define tfalldata (7e-10)
#define tfalltag (7e-10)
#define Vbitpre (3.3)
static float VbitprePow;
#define Vt (1.09)
#define Vbitsense (0.10)
/* bit width of RAM cell in um */
#define BitWidth (8.0)
/* bit height of RAM cell in um */
#define BitHeight (16.0)
#define Cout (0.5e-12)
/*===================================================================*/
/*
* The following are things you probably wouldn't want to change.
*/
#define TRUE 1
#define FALSE 0
#ifndef NULL
#define NULL 0
#endif
#define OK 1
#define ERROR 0
#define BIGNUM 1e30
#define DIVIDE(a,b) ((b)==0)? 0:(a)/(b)
#define MAX(a,b) (((a)>(b))?(a):(b))
#define WAVE_PIPE 3
#define MAX_COL_MUX 16
/* Used to communicate with the horowitz model */
#define RISE 1
#define FALL 0
#define NCH 1
#define PCH 0
/* Used to pass values around the program */
typedef struct {
int cache_size;
int number_of_sets;
int associativity;
int block_size;
int num_write_ports;
int num_readwrite_ports;
int num_read_ports;
int num_single_ended_read_ports;
char fully_assoc;
float fudgefactor;
float tech_size;
float VddPow;
} parameter_type;
typedef struct {
double access_time,cycle_time;
double senseext_scale;
double total_power;
int best_Ndwl,best_Ndbl;
double max_power, max_access_time;
int best_Nspd;
int best_Ntwl,best_Ntbl;
int best_Ntspd;
int best_muxover;
double total_routing_power;
double total_power_without_routing, total_power_allbanks;
double subbank_address_routing_delay,subbank_address_routing_power;
double decoder_delay_data,decoder_delay_tag;
double decoder_power_data,decoder_power_tag;
double dec_data_driver,dec_data_3to8,dec_data_inv;
double dec_tag_driver,dec_tag_3to8,dec_tag_inv;
double wordline_delay_data,wordline_delay_tag;
double wordline_power_data,wordline_power_tag;
double bitline_delay_data,bitline_delay_tag;
double bitline_power_data,bitline_power_tag;
double sense_amp_delay_data,sense_amp_delay_tag;
double sense_amp_power_data,sense_amp_power_tag;
double total_out_driver_delay_data;
double total_out_driver_power_data;
double compare_part_delay;
double drive_mux_delay;
double selb_delay;
double compare_part_power;
double drive_mux_power;
double selb_power;
double data_output_delay;
double data_output_power;
double drive_valid_delay;
double drive_valid_power;
double precharge_delay;
int data_nor_inputs;
int tag_nor_inputs;
} result_type;
/* From original areadef.h of CACTI*/
double area_all_datasubarrays;
double area_all_tagsubarrays;
double area_all_dataramcells;
double area_all_tagramcells;
double faarea_all_subarrays ;
double aspect_ratio_data;
double aspect_ratio_tag;
double aspect_ratio_subbank;
double aspect_ratio_total;
#define Widthptondiff 4.0
#define Widthtrack 3.2
#define Widthcontact 1.6
#define Wpoly 0.8
#define ptocontact 0.4
#define stitch_ramv 6.0
#define BitHeight16x2 33.6
#define stitch_ramh 12.0
#define BitWidth16x2 192.8
#define WidthNOR1 11.6
#define WidthNOR2 13.6
#define WidthNOR3 20.8
#define WidthNOR4 28.8
#define WidthNOR5 34.4
#define WidthNOR6 41.6
#define Predec_height1 140.8
#define Predec_width1 270.4
#define Predec_height2 140.8
#define Predec_width2 539.2
#define Predec_height3 281.6
#define Predec_width3 584.0
#define Predec_height4 281.6
#define Predec_width4 628.8
#define Predec_height5 422.4
#define Predec_width5 673.6
#define Predec_height6 422.4
#define Predec_width6 718.4
#define Wwrite 1.2
#define SenseampHeight 152.0
#define OutdriveHeight 200.0
#define FAOutdriveHeight 229.2
#define FArowWidth 382.8
#define CAM2x2Height_1p 48.8
#define CAM2x2Width_1p 44.8
#define CAM2x2Height_2p 80.8
#define CAM2x2Width_2p 76.8
#define DatainvHeight 25.6
#define Wbitdropv 30.0
#define decNandWidth 34.4
#define FArowNANDWidth 71.2
#define FArowNOR_INVWidth 28.0
#define FAHeightIncrPer_first_rw_or_w_port 16.0
#define FAHeightIncrPer_later_rw_or_w_port 16.0
#define FAHeightIncrPer_first_r_port 12.0
#define FAHeightIncrPer_later_r_port 12.0
#define FAWidthIncrPer_first_rw_or_w_port 16.0
#define FAWidthIncrPer_later_rw_or_w_port 9.6
#define FAWidthIncrPer_first_r_port 12.0
#define FAWidthIncrPer_later_r_port 9.6
#define tracks_precharge_p 12
#define tracks_precharge_nx2 5
#define tracks_outdrvselinv_p 3
#define tracks_outdrvfanand_p 6
typedef struct {
double height;
double width;
} area_type;
typedef struct {
area_type dataarray_area,datapredecode_area;
area_type datacolmuxpredecode_area,datacolmuxpostdecode_area;
area_type datawritesig_area;
area_type tagarray_area,tagpredecode_area;
area_type tagcolmuxpredecode_area,tagcolmuxpostdecode_area;
area_type tagoutdrvdecode_area;
area_type tagoutdrvsig_area;
double totalarea;
double total_dataarea;
double total_tagarea;
double max_efficiency, efficiency;
double max_aspect_ratio_total, aspect_ratio_total;
} arearesult_type;