const.h revision 10152
1/*****************************************************************************
2 *                                McPAT/CACTI
3 *                      SOFTWARE LICENSE AGREEMENT
4 *            Copyright 2012 Hewlett-Packard Development Company, L.P.
5 *                          All Rights Reserved
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met: redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer;
11 * redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution;
14 * neither the name of the copyright holders nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.”
29 *
30 ***************************************************************************/
31
32#ifndef __CONST_H__
33#define __CONST_H__
34
35#include <math.h>
36#include <stdint.h>
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>
40
41/*  The following are things you might want to change
42 *  when compiling
43 */
44
45/*
46 * Address bits in a word, and number of output bits from the cache
47 */
48
49/*
50was: #define ADDRESS_BITS 32
51now: I'm using 42 bits as in the Power4,
52since that's bigger then the 36 bits on the Pentium 4
53and 40 bits on the Opteron
54*/
55const int ADDRESS_BITS = 42;
56
57/*dt: In addition to the tag bits, the tags also include 1 valid bit, 1 dirty bit, 2 bits for a 4-state
58  cache coherency protocoll (MESI), 1 bit for MRU (change this to log(ways) for full LRU).
59  So in total we have 1 + 1 + 2 + 1 = 5 */
60const int EXTRA_TAG_BITS = 5;
61
62/* limits on the various N parameters */
63
64const unsigned int MAXDATAN     = 512;      // maximum for Ndwl and Ndbl
65const unsigned int MAXSUBARRAYS = 1048576;  // maximum subarrays for data and tag arrays
66const unsigned int MAXDATASPD   = 256;      // maximum for Nspd
67const unsigned int MAX_COL_MUX  = 256;
68
69
70
71#define ROUTER_TYPES 3
72#define WIRE_TYPES 6
73
74const double Cpolywire = 0;
75
76
77/* Threshold voltages (as a proportion of Vdd)
78   If you don't know them, set all values to 0.5 */
79#define VTHFA1         0.452
80#define VTHFA2         0.304
81#define VTHFA3         0.420
82#define VTHFA4         0.413
83#define VTHFA5         0.405
84#define VTHFA6         0.452
85#define VSINV          0.452
86#define VTHCOMPINV     0.437
87#define VTHMUXNAND     0.548  // TODO : this constant must be revisited
88#define VTHEVALINV     0.452
89#define VTHSENSEEXTDRV 0.438
90
91
92//WmuxdrvNANDn and WmuxdrvNANDp are no longer being used but it's part of the old
93//delay_comparator function which we are using exactly as it used to be, so just setting these to 0
94const double WmuxdrvNANDn = 0;
95const double WmuxdrvNANDp = 0;
96
97
98/*===================================================================*/
99/*
100 * The following are things you probably wouldn't want to change.
101 */
102
103#define BIGNUM 1e30
104#define INF 9999999
105#define MAX(a,b) (((a)>(b))?(a):(b))
106#define MIN(a,b) (((a)<(b))?(a):(b))
107
108/* Used to communicate with the horowitz model */
109#define RISE 1
110#define FALL 0
111#define NCH  1
112#define PCH  0
113
114
115#define EPSILON 0.5 //v4.1: This constant is being used in order to fix floating point -> integer
116//conversion problems that were occuring within CACTI. Typical problem that was occuring was
117//that with different compilers a floating point number like 3.0 would get represented as either
118//2.9999....or 3.00000001 and then the integer part of the floating point number (3.0) would
119//be computed differently depending on the compiler. What we are doing now is to replace
120//int (x) with (int) (x+EPSILON) where EPSILON is 0.5. This would fix such problems. Note that
121//this works only when x is an integer >= 0.
122/*
123 * Sheng thinks this is more a solution to solve the simple truncate problem
124 * (http://www.cs.tut.fi/~jkorpela/round.html) rather than the problem mentioned above.
125 * Unfortunately, this solution causes nasty bugs (different results when using O0 and O3).
126 * Moreover, round is not correct in CACTI since when an extra fraction of bit/line is needed,
127 * we need to provide a complete bit/line even the fraction is just 0.01.
128 * So, in later version than 6.5 we use (int)ceil() to get double to int conversion.
129 */
130
131#define EPSILON2 0.1
132#define EPSILON3 0.6
133
134
135#define MINSUBARRAYROWS 16 //For simplicity in modeling, for the row decoding structure, we assume
136//that each row predecode block is composed of at least one 2-4 decoder. When the outputs from the
137//row predecode blocks are combined this means that there are at least 4*4=16 row decode outputs
138#define MAXSUBARRAYROWS 262144 //Each row predecode block produces a max of 2^9 outputs. So
139//the maximum number of row decode outputs will be 2^9*2^9
140#define MINSUBARRAYCOLS 2
141#define MAXSUBARRAYCOLS 262144
142
143
144#define INV 0
145#define NOR 1
146#define NAND 2
147
148
149#define NUMBER_TECH_FLAVORS 4
150
151#define NUMBER_INTERCONNECT_PROJECTION_TYPES 2 //aggressive and conservative
152//0 = Aggressive projections, 1 = Conservative projections
153#define NUMBER_WIRE_TYPES 4 //local, semi-global and global
154//1 = 'Semi-global' wire type, 2 = 'Global' wire type
155
156
157const int dram_cell_tech_flavor = 3;
158
159
160#define VBITSENSEMIN 0.08 //minimum bitline sense voltage is fixed to be 80 mV.
161
162#define fopt 4.0
163
164#define INPUT_WIRE_TO_INPUT_GATE_CAP_RATIO 0
165#define BUFFER_SEPARATION_LENGTH_MULTIPLIER 1
166#define NUMBER_MATS_PER_REDUNDANT_MAT 8
167
168#define NUMBER_STACKED_DIE_LAYERS 1
169
170// this variable can be set to carry out solution optimization for
171// a maximum area allocation.
172#define STACKED_DIE_LAYER_ALLOTED_AREA_mm2 0 //6.24 //6.21//71.5
173
174// this variable can also be employed when solution optimization
175// with maximum area allocation is carried out.
176#define MAX_PERCENT_AWAY_FROM_ALLOTED_AREA 50
177
178// this variable can also be employed when solution optimization
179// with maximum area allocation is carried out.
180#define MIN_AREA_EFFICIENCY 20
181
182// this variable can be employed when solution with a desired
183// aspect ratio is required.
184#define STACKED_DIE_LAYER_ASPECT_RATIO 1
185
186// this variable can be employed when solution with a desired
187// aspect ratio is required.
188#define MAX_PERCENT_AWAY_FROM_ASPECT_RATIO 101
189
190// this variable can be employed to carry out solution optimization
191// for a certain target random cycle time.
192#define TARGET_CYCLE_TIME_ns 1000000000
193
194#define NUMBER_PIPELINE_STAGES 4
195
196// this can be used to model the length of interconnect
197// between a bank and a crossbar
198#define LENGTH_INTERCONNECT_FROM_BANK_TO_CROSSBAR 0 //3791 // 2880//micron
199
200#define IS_CROSSBAR 0
201#define NUMBER_INPUT_PORTS_CROSSBAR 8
202#define NUMBER_OUTPUT_PORTS_CROSSBAR 8
203#define NUMBER_SIGNALS_PER_PORT_CROSSBAR 256
204
205
206#define MAT_LEAKAGE_REDUCTION_DUE_TO_SLEEP_TRANSISTORS_FACTOR 1
207#define LEAKAGE_REDUCTION_DUE_TO_LONG_CHANNEL_HP_TRANSISTORS_FACTOR 1
208
209#define PAGE_MODE 0
210
211#define MAIN_MEM_PER_CHIP_STANDBY_CURRENT_mA 60
212// We are actually not using this variable in the CACTI code. We just want to acknowledge that
213// this current should be multiplied by the DDR(n) system VDD value to compute the standby power
214// consumed during precharge.
215
216
217const double VDD_STORAGE_LOSS_FRACTION_WORST = 0.125;
218const double CU_RESISTIVITY = 0.022; //ohm-micron
219const double BULK_CU_RESISTIVITY = 0.018; //ohm-micron
220const double PERMITTIVITY_FREE_SPACE = 8.854e-18; //F/micron
221
222const static uint32_t sram_num_cells_wl_stitching_ = 16;
223const static uint32_t dram_num_cells_wl_stitching_ = 64;
224const static uint32_t comm_dram_num_cells_wl_stitching_ = 256;
225const static double num_bits_per_ecc_b_          = 8.0;
226
227const double    bit_to_byte  = 8.0;
228
229#define MAX_NUMBER_GATES_STAGE 20
230#define MAX_NUMBER_HTREE_NODES 20
231#define NAND2_LEAK_STACK_FACTOR 0.2
232#define NAND3_LEAK_STACK_FACTOR 0.2
233#define NOR2_LEAK_STACK_FACTOR 0.2
234#define INV_LEAK_STACK_FACTOR  0.5
235#define MAX_NUMBER_ARRAY_PARTITIONS 1000000
236
237// abbreviations used in this project
238// ----------------------------------
239//
240//  num  : number
241//  rw   : read/write
242//  rd   : read
243//  wr   : write
244//  se   : single-ended
245//  sz   : size
246//  F    : feature
247//  w    : width
248//  h    : height or horizontal
249//  v    : vertical or velocity
250
251
252enum ram_cell_tech_type_num
253{
254  itrs_hp   = 0,
255  itrs_lstp = 1,
256  itrs_lop  = 2,
257  lp_dram   = 3,
258  comm_dram = 4
259};
260
261const double pppm[4]      = {1,1,1,1};
262const double pppm_lkg[4]  = {0,1,1,0};
263const double pppm_dyn[4]  = {1,0,0,0};
264const double pppm_Isub[4] = {0,1,0,0};
265const double pppm_Ig[4]   = {0,0,1,0};
266const double pppm_sc[4]   = {0,0,0,1};
267
268
269
270#endif
271