Permalink
Browse files

add debug feature in Makefile. update NVM read power model.

  • Loading branch information...
cxxz committed Sep 23, 2013
1 parent 320ef5c commit 7438330e285fcc69005c19e0c28a821e9fd50788
Showing with 52 additions and 42 deletions.
  1. +6 −2 Makefile
  2. +33 −29 MemCell.cpp
  3. +2 −1 MemCell.h
  4. +2 −2 Result.cpp
  5. +6 −6 SubArray.cpp
  6. +3 −2 sample_STTRAM.cell
View
@@ -18,22 +18,26 @@ LDLIBS :=
# construct list of .cpp and their corresponding .o and .d files
SRC := $(wildcard *.cpp)
INC :=
DBG :=
OBJ := $(SRC:.cpp=.o)
DEP := Makefile.dep
# file disambiguity is achieved via the .PHONY directive
.PHONY : all clean
.PHONY : all clean dbg
all : $(target)
dbg: DBG += -ggdb -g
dbg: $(target)
$(target) : $(OBJ)
$(CXX) $(LDFLAGS) $^ $(LDLIBS) -o $@
clean :
$(RM) $(target) $(dep_file) $(OBJ)
.cpp.o :
$(CXX) $(CXXFLAGS) $(INC) -c $< -o $@
$(CXX) $(CXXFLAGS) $(DBG) $(INC) -c $< -o $@
depend $(DEP):
@echo Makefile - creating dependencies for: $(SRC)
View
@@ -43,28 +43,29 @@
MemCell::MemCell() {
// TODO Auto-generated constructor stub
memCellType = PCRAM;
area = 0;
aspectRatio = 0;
resistanceOn = 0;
resistanceOff = 0;
readMode = true;
readVoltage = 0;
readCurrent = 0;
readEnergy = 0;
resetMode = true;
resetVoltage = 0;
resetCurrent = 0;
minSenseVoltage = 0.08;
resetPulse = 0;
resetEnergy = 0;
setMode = true;
setVoltage = 0;
setCurrent = 0;
setPulse = 0;
accessType = CMOS_access;
processNode = 0;
setEnergy = 0;
memCellType = PCRAM;
area = 0;
aspectRatio = 0;
resistanceOn = 0;
resistanceOff = 0;
readMode = true;
readVoltage = 0;
readCurrent = 0;
readPower = 0;
wordlineBoostRatio = 1.0;
resetMode = true;
resetVoltage = 0;
resetCurrent = 0;
minSenseVoltage = 0.08;
resetPulse = 0;
resetEnergy = 0;
setMode = true;
setVoltage = 0;
setCurrent = 0;
setPulse = 0;
accessType = CMOS_access;
processNode = 0;
setEnergy = 0;
/* Optional */
stitching = 0;
@@ -225,9 +226,13 @@ void MemCell::ReadCellFromFile(const string & inputFile)
readCurrent /= 1e6;
continue;
}
if (!strncmp("-ReadEnergy", line, strlen("-ReadEnergy"))) {
sscanf(line, "-ReadEnergy (pJ): %lf", &readEnergy);
readEnergy /= 1e12;
if (!strncmp("-ReadPower", line, strlen("-ReadPower"))) {
sscanf(line, "-ReadPower (uW): %lf", &readPower);
readPower /= 1e6;
continue;
}
if (!strncmp("-WordlineBoostRatio", line, strlen("-WordlineBoostRatio"))) {
sscanf(line, "-WordlineBoostRatio: %lf", &wordlineBoostRatio);
continue;
}
if (!strncmp("-MinSenseVoltage", line, strlen("-MinSenseVoltage"))) {
@@ -564,16 +569,15 @@ void MemCell::CalculateWriteEnergy() {
}
double MemCell::CalculateReadPower() { /* TO-DO consider charge pumped read voltage */
if (readEnergy == 0) {
if (readPower == 0) {
if (cell->readMode) { /* voltage-sensing */
if (readVoltage == 0) { /* Current-in voltage sensing */
return tech->vdd * readCurrent;
}
if (readCurrent == 0) { /*Voltage-divider sensing */
double resInSerialForSenseAmp, resEquivalentOn, maxBitlineCurrent;
double resInSerialForSenseAmp, maxBitlineCurrent;
resInSerialForSenseAmp = sqrt(resistanceOn * resistanceOff);
resEquivalentOn = resistanceOn * resInSerialForSenseAmp / (resistanceOn + resInSerialForSenseAmp);
maxBitlineCurrent = (readVoltage - voltageDropAccessDevice) / resEquivalentOn;
maxBitlineCurrent = (readVoltage - voltageDropAccessDevice) / (resistanceOn + resInSerialForSenseAmp);
return tech->vdd * maxBitlineCurrent;
}
} else { /* current-sensing */
View
@@ -75,7 +75,8 @@ class MemCell {
double readVoltage; /* Read voltage */
double readCurrent; /* Read current */
double minSenseVoltage; /* Minimum sense voltage */
double readEnergy; /* Read energy per cell (pJ)*/
double wordlineBoostRatio; /*TO-DO: function not realized: ratio of boost wordline voltage to vdd */
double readPower; /* Read power per bitline (uW)*/
bool resetMode; /* true = voltage-mode, false = current-mode */
double resetVoltage; /* Reset voltage */
double resetCurrent; /* Reset current */
View
@@ -413,7 +413,7 @@ void Result::print() {
+ bank->mat.subarray.senseAmpMuxLev1Decoder.readDynamicEnergy
+ bank->mat.subarray.senseAmpMuxLev2Decoder.readDynamicEnergy) << endl;
if (cell->memCellType == PCRAM || cell->memCellType == FBRAM || cell->memCellType == MRAM || cell->memCellType == memristor ) {
cout << " |--- Cell Read Dynamic Energy = " << TO_JOULE(bank->mat.subarray.cellReadEnergy) << endl;
cout << " |--- Bitline & Cell Read Energy = " << TO_JOULE(bank->mat.subarray.cellReadEnergy) << endl;
}
if (inputParameter->internalSensing)
cout << " |--- Senseamp Dynamic Energy = " << TO_JOULE(bank->mat.subarray.senseAmp.readDynamicEnergy) << endl;
@@ -534,7 +534,7 @@ void Result::print() {
+ bank->mat.subarray.senseAmpMuxLev1.writeDynamicEnergy
+ bank->mat.subarray.senseAmpMuxLev2.writeDynamicEnergy) << endl;
if (cell->memCellType == MRAM) {
cout << " |--- Cell Write Dynamic Energy = " << TO_JOULE(bank->mat.subarray.cellResetEnergy) << endl;
cout << " |--- Bitline & Cell Write Energy= " << TO_JOULE(bank->mat.subarray.cellResetEnergy) << endl;
}
}
View
@@ -240,9 +240,9 @@ void SubArray::Initialize(long long _numRow, long long _numColumn, bool _multipl
/* Caclulate the load resistance and capacitance for Mux Decoders */
double capMuxLoad, resMuxLoad;
resMuxLoad = resWordline;
capMuxLoad = CalculateGateCap(minBitlineMuxWidth, *tech) * numColumn;
capMuxLoad += capWordline;
resMuxLoad = resWordline;
capMuxLoad = CalculateGateCap(minBitlineMuxWidth, *tech) * numColumn;
capMuxLoad += capWordline;
/* Add transistor resistance/capacitance */
if (cell->memCellType == SRAM) {
@@ -710,10 +710,10 @@ void SubArray::CalculatePower() {
(voltagePrecharge * voltagePrecharge - voltageMemCellOn * voltageMemCellOn ) * numColumn;
}
if (cell->readEnergy == 0) {
if (cell->readPower == 0)
cellReadEnergy = 2 * cell->CalculateReadPower() * senseAmp.readLatency; /* x2 is because of the reference cell */
} else
cellReadEnergy = 2 * cell->readEnergy;
else
cellReadEnergy = 2 * cell->readPower * senseAmp.readLatency;
cellReadEnergy *= numColumn / muxSenseAmp / muxOutputLev1 / muxOutputLev2;
/* Ignore the dynamic transition during the SET/RESET operation */
View
@@ -8,14 +8,15 @@
-ReadMode: current
-ReadVoltage (V): 0.25
-MinSenseVoltage (mV): 25
-ReadPower (uW): 23.4
-ResetMode: current
-ResetCurrent (uA): 40.82
-ResetPulse (ns): 5
-ResetEnergy (pJ): 0.193895
-ResetEnergy (pJ): 0.252
-SetMode: current
-SetCurrent (uA): 40.82
-SetPulse (ns): 5
-SetEnergy (pJ): 0.193895
-SetEnergy (pJ): 0.252
-AccessType: CMOS
-VoltageDropAccessDevice (V): 0.15
-AccessCMOSWidth (F): 8.5

0 comments on commit 7438330

Please sign in to comment.