-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCAM_RowNand.cpp
117 lines (103 loc) · 3.8 KB
/
CAM_RowNand.cpp
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
#include "CAM_RowNand.h"
#include "RowDecoder.h"
#include "formula.h"
#include "global.h"
CAM_RowNand::CAM_RowNand() : RowDecoder(){
// TODO Auto-generated constructor stub
initialized = false;
invalid = false;
driverInv = true;
}
CAM_RowNand::~CAM_RowNand() {
// TODO Auto-generated destructor stub
}
void CAM_RowNand::Initialize(int _numRow, double _capLoad, double _resLoad,
bool _multipleRowPerSet, bool _inv, BufferDesignTarget _areaOptimizationLevel, double _minDriverCurrent) {
if (initialized)
cout << "[Row Decoder] Warning: Already initialized!" << endl;
numRow = _numRow;
capLoad = _capLoad;
resLoad = _resLoad;
multipleRowPerSet = _multipleRowPerSet;
areaOptimizationLevel = _areaOptimizationLevel;
minDriverCurrent = _minDriverCurrent;
driverInv = _inv;
if (numRow <= 8) { /* The predecoder output is used directly */
if (multipleRowPerSet)
numNandInput = 2; /* NAND way-select with predecoder output */
else
numNandInput = 0; /* no circuit needed */
} else {
if (multipleRowPerSet)
numNandInput = 3; /* NAND way-select with two predecoder outputs */
else
numNandInput = 2; /* just NAND two predecoder outputs */
}
if (numNandInput > 0) {
double logicEffortNand;
double capNand;
if (numNandInput == 2) { /* NAND2 */
widthNandN = 2 * MIN_NMOS_SIZE * tech->featureSize;
logicEffortNand = (2+tech->pnSizeRatio) / (1+tech->pnSizeRatio);
} else { /* NAND3 */
widthNandN = 3 * MIN_NMOS_SIZE * tech->featureSize;
logicEffortNand = (3+tech->pnSizeRatio) / (1+tech->pnSizeRatio);
}
widthNandP = tech->pnSizeRatio * MIN_NMOS_SIZE * tech->featureSize;
capNand = CalculateGateCap(widthNandN, *tech) + CalculateGateCap(widthNandP, *tech);
// begin_change
//outputDriver.Initialize(logicEffortNand, capNand, capLoad, resLoad, true, areaOptimizationLevel, minDriverCurrent);
outputDriver.Initialize(logicEffortNand, capNand, capLoad, resLoad, driverInv, areaOptimizationLevel, minDriverCurrent);
// end_change
} else {
/* we only need an 1-level output buffer to driver the wordline */
double capInv;
widthNandN = MIN_NMOS_SIZE * tech->featureSize;
widthNandP = tech->pnSizeRatio * MIN_NMOS_SIZE * tech->featureSize;
capInv = CalculateGateCap(widthNandN, *tech) + CalculateGateCap(widthNandP, *tech);
// begin_change
//outputDriver.Initialize(1, capInv, capLoad, resLoad, true, areaOptimizationLevel, minDriverCurrent);
outputDriver.Initialize(1, capInv, capLoad, resLoad, driverInv, areaOptimizationLevel, minDriverCurrent);
// end_change
}
if (outputDriver.invalid) {
invalid = true;
return;
}
initialized = true;
}
CAM_RowNand & CAM_RowNand::operator=(const CAM_RowNand &rhs) {
height = rhs.height;
width = rhs.width;
area = rhs.area;
readLatency = rhs.readLatency;
writeLatency = rhs.writeLatency;
readDynamicEnergy = rhs.readDynamicEnergy;
writeDynamicEnergy = rhs.writeDynamicEnergy;
resetLatency = rhs.resetLatency;
setLatency = rhs.setLatency;
resetDynamicEnergy = rhs.resetDynamicEnergy;
setDynamicEnergy = rhs.setDynamicEnergy;
cellReadEnergy = rhs.cellReadEnergy;
cellSetEnergy = rhs.cellSetEnergy;
cellResetEnergy = rhs.cellResetEnergy;
leakage = rhs.leakage;
initialized = rhs.initialized;
invalid = rhs.invalid;
outputDriver = rhs.outputDriver;
numRow = rhs.numRow;
multipleRowPerSet = rhs.multipleRowPerSet;
numNandInput = rhs.numNandInput;
capLoad = rhs.capLoad;
resLoad = rhs.resLoad;
areaOptimizationLevel = rhs.areaOptimizationLevel;
minDriverCurrent = rhs.minDriverCurrent;
driverInv = rhs.driverInv;
widthNandN = rhs.widthNandN;
widthNandP = rhs.widthNandP;
capNandInput = rhs.capNandInput;
capNandOutput = rhs.capNandOutput;
rampInput = rhs.rampInput;
rampOutput = rhs.rampOutput;
return *this;
}