Skip to content

Commit c74905d

Browse files
committed
Initial commit
0 parents  commit c74905d

16 files changed

+733
-0
lines changed

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
TARGET=oldspot
2+
3+
SRCDIR=src
4+
SRC=$(wildcard $(SRCDIR)/*.cc)
5+
INCDIR=src
6+
OBJDIR=obj
7+
OBJ=$(SRC:$(SRCDIR)/%.cc=$(OBJDIR)/%.o)
8+
9+
OPT=-O3
10+
INCLUDE=-I$(INCDIR)
11+
CXXFLAGS += -std=c++11 -Wall $(INCLUDE) $(OPT)
12+
LIBS=-lm -lpugixml
13+
LFLAGS += $(LIBS) $(OPT)
14+
15+
.PHONY: $(TARGET) debug clean
16+
17+
default: $(TARGET)
18+
19+
$(TARGET): $(OBJ)
20+
$(CXX) $^ -o $@ $(LFLAGS)
21+
22+
$(OBJDIR)/%.o: $(SRCDIR)/%.cc
23+
@mkdir -p $(OBJDIR)
24+
$(CXX) -c $< -o $@ $(CXXFLAGS)
25+
26+
debug: CXXFLAGS += -g
27+
debug: LFLAGS += -g
28+
debug: OPT=-O0
29+
debug: $(TARGET)
30+
31+
clean:
32+
rm -rf $(OBJDIR)
33+
rm -rf $(TARGET)

example/activity.trace

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
time,one
2+
1,0.75

example/config.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" ?>
2+
3+
<group name="system" failures="0">
4+
<unit type="unit" name="one">
5+
<default vdd="1" />
6+
<default temperature="300" />
7+
<default frequency="2000" />
8+
<default peak_power="0.1" />
9+
</unit>
10+
</group>

example/frequency.trace

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
time,one
2+
1,1000

example/power.trace

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
time,one
2+
1,1.0

example/temperature.trace

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
time,one
2+
1,350

example/voltage.trace

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
time,two
2+
1,1

src/failure.cc

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#include "failure.hh"
2+
3+
#include <cmath>
4+
#include <iostream>
5+
#include <memory>
6+
#include <vector>
7+
8+
#include "reliability.hh"
9+
10+
using namespace std;
11+
12+
double FailureMechanism::timeToFailure(const DataPoint& data, double fail) const
13+
{
14+
return timeToFailure(data.vdd, data.temperature, data.activity, data.frequency, fail);
15+
}
16+
17+
double NBTI::degradation(double t, double vdd, double dVth, double temperature, double duty_cycle) const
18+
{
19+
duty_cycle = pow(duty_cycle/(1 + sqrt((1 - duty_cycle)/2)), 1.0/6.0);
20+
double V = vdd - Vt0 - dVth;
21+
if (V < 0)
22+
{
23+
cerr << "warning: subthreshold VDD " << vdd << " not supported" << endl;
24+
cerr << " operating at threshold instead" << endl;
25+
V = 0;
26+
}
27+
double E_AIT = 2.0/3.0*(E_Akf - E_Akr) + E_ADH2/6;
28+
double dN_IT = A*pow(V, Gamma_IT)*exp(-E_AIT/(k_B*temperature))*pow(t, 1.0/6.0);
29+
double dN_HT = B*pow(V, Gamma_HT)*exp(-E_AHT/(k_B*temperature));
30+
double n = eta*pow(V, -Gamma_OT/beta_OT)*exp(E_AOT/(k_B*temperature*beta_OT));
31+
double dN_OT = C*(1 - exp(-pow(t/n, beta_OT)));
32+
return duty_cycle*q/Cox*(dN_IT + dN_HT + dN_OT);
33+
}
34+
35+
double NBTI::timeToFailure(double vdd, double temperature, double duty_cycle, double frequency, double fail) const
36+
{
37+
if (isnan(fail))
38+
fail = fail_default;
39+
40+
// Create a linear approximation of dVth(t)
41+
double dVth_fail = (vdd - Vt0) - (vdd - Vt0)/pow(1 + fail, 1/alpha); // [ExtraTime]
42+
cout << "Fail at " << dVth_fail << endl;
43+
double dVth = 0, dVth_prev = 0;
44+
double t = 0;
45+
for (; dVth < dVth_fail; t += dt)
46+
{
47+
dVth_prev = dVth;
48+
dVth = degradation(t, vdd, dVth, temperature, duty_cycle);
49+
cout << t << '\t' << dVth << endl;
50+
}
51+
t -= dt;
52+
53+
if (dVth == 0)
54+
return 0;
55+
else // Linearly interpolate to find time at which dVth == dVth_fail (MTTF)
56+
return (t - dt) + dt*(dVth_fail - dVth_prev)/(dVth - dVth_prev);
57+
}
58+
59+
shared_ptr<ReliabilityDistribution> NBTI::distribution(const vector<MTTFSegment>& mttfs) const
60+
{
61+
return make_shared<WeibullDistribution>(beta, mttfs);
62+
}

src/failure.hh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#pragma once
2+
3+
#include <limits>
4+
#include <memory>
5+
#include <string>
6+
#include <vector>
7+
8+
#include "reliability.hh"
9+
#include "trace.hh"
10+
11+
class FailureMechanism
12+
{
13+
public:
14+
const std::string name;
15+
16+
FailureMechanism(const std::string& _n) : name(_n) {}
17+
virtual double timeToFailure(double vdd, double temperature, double duty_cycle, double frequency, double fail) const = 0;
18+
double timeToFailure(const DataPoint& data, double fail=std::numeric_limits<double>::signaling_NaN()) const;
19+
virtual std::shared_ptr<ReliabilityDistribution> distribution(const std::vector<MTTFSegment>&) const = 0;
20+
};
21+
22+
class NBTI : public FailureMechanism
23+
{
24+
private:
25+
const double q = 1.60217662e-19; // C
26+
const double k_B = 8.6173303e-5; // eV/K
27+
28+
// Device parameters
29+
const double Vt0 = 0.49158; // V, taken from PTM [1] at 45nm
30+
const double Cox = 5.934e-6; // F
31+
const double alpha = 1.3; // alpha power law [2]
32+
33+
// Low-level parameters (chosen from device D4 [3])
34+
const double A = 9e11;
35+
const double B = 8.5e11;
36+
const double C = 1e16;
37+
const double Gamma_IT = 2.2;
38+
const double Gamma_HT = 2.2;
39+
const double Gamma_OT = 9;
40+
const double E_Akf = 0.175; // eV
41+
const double E_Akr = 0.2; // eV
42+
const double E_ADH2 = 0.58; // eV
43+
const double E_AHT = 0.03; // eV
44+
const double E_AOT = 0.15; // eV
45+
const double eta = 5e12;
46+
const double beta_OT = 0.36;
47+
48+
// High-level parameters
49+
const double beta = 2; // Weibull shape parameter [4]
50+
const double fail_default = 0.01; // Relative delay change [5]
51+
52+
const double dt = 3600; // seconds
53+
54+
public:
55+
NBTI() : FailureMechanism("NBTI") {}
56+
static const std::shared_ptr<FailureMechanism> model() { static NBTI nbti; return std::make_shared<NBTI>(nbti); }
57+
double degradation(double t, double vdd, double dVth, double temperature, double duty_cycle) const;
58+
double timeToFailure(double vdd, double temperature, double duty_cycle, double frequency, double fail=std::numeric_limits<double>::signaling_NaN()) const override;
59+
std::shared_ptr<ReliabilityDistribution> distribution(const std::vector<MTTFSegment>& mttfs) const override;
60+
};
61+
62+
/*
63+
* [1] PTM
64+
*
65+
* [2] K. Joshi, S. Mukhopadhyay, N. Goel, and S. Mahapatra, “A consistent
66+
* physical framework for N and P BTI in HKMG MOSFETs,” in Reliability
67+
* Physics Symposium (IRPS), 2012 IEEE International, 2012, p. 5A.3.1-5A.3.10.
68+
*
69+
* [3]
70+
*
71+
* [4] "Failure Mechanisms and Models for Semiconductor Devices,"" JEDEC Solid
72+
* State Technology Institution, JEP122H, Oct. 2011.
73+
*
74+
* [5] F. Oboril and M. B. Tahoori, “ExtraTime: Modeling and analysis of
75+
* wearout due to transistor aging at microarchitecture-level,” in
76+
* IEEE/IFIP International Conference on Dependable Systems and Networks
77+
* (DSN 2012), 2012, pp. 1–12.
78+
*/

src/main.cc

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#include <cstring>
2+
#include <iostream>
3+
#include <map>
4+
#include <memory>
5+
#include <numeric>
6+
#include <pugixml.hpp>
7+
#include <string>
8+
#include <tclap/CmdLine.h>
9+
#include <utility>
10+
#include <vector>
11+
12+
#include "failure.hh"
13+
#include "trace.hh"
14+
#include "unit.hh"
15+
16+
using namespace std;
17+
18+
int main(int argc, char* argv[])
19+
{
20+
using namespace pugi;
21+
using namespace TCLAP;
22+
23+
try
24+
{
25+
CmdLine cmd("Compute the reliability distribution of a chip", ' ', "0.1");
26+
ValueArg<char> delimiter("", "trace-delimiter", "One-character delimiter for data in input trace files (default: ,)", false, ',', "delim", cmd);
27+
ValueArg<string> ptrace("p", "power", "File containing power traces for all units (W)", false, "", "filename", cmd);
28+
ValueArg<string> ftrace("f", "frequency", "File containing frequency traces for all units (MHz)", false, "", "filename", cmd);
29+
ValueArg<string> ttrace("T", "temperature", "File containing temperature traces for all units (K)", false, "", "filename", cmd);
30+
ValueArg<string> vtrace("v", "vdd", "File containing voltage traces for all units (V)", false, "", "filename", cmd);
31+
ValueArg<string> atrace("a", "activity", "File containing activity traces for all units", false, "", "filename", cmd);
32+
ValueArg<string> config("c", "chip-config", "File containing chip configuration", true, "", "filename", cmd);
33+
cmd.parse(argc, argv);
34+
35+
xml_document doc;
36+
xml_parse_result result = doc.load_file(config.getValue().c_str());
37+
if (!result)
38+
{
39+
cerr << config.getValue() << ": " << result.description()
40+
<< " at offset " << result.offset << endl;
41+
return 1;
42+
}
43+
44+
vector<shared_ptr<Unit>> units;
45+
Group root(doc, units);
46+
47+
trace_t activity, voltage, temperature, frequency, power;
48+
if (!atrace.getValue().empty())
49+
activity = parseTrace(atrace.getValue(), delimiter.getValue());
50+
if (!vtrace.getValue().empty())
51+
voltage = parseTrace(vtrace.getValue(), delimiter.getValue());
52+
if (!ttrace.getValue().empty())
53+
temperature = parseTrace(ttrace.getValue(), delimiter.getValue());
54+
if (!ftrace.getValue().empty())
55+
frequency = parseTrace(ftrace.getValue(), delimiter.getValue());
56+
if (!ptrace.getValue().empty())
57+
power = parseTrace(ptrace.getValue(), delimiter.getValue());
58+
unordered_set<string> names(units.size());
59+
for (const shared_ptr<Unit>& unit: units)
60+
names.insert(unit->name);
61+
map<string, vector<DataPoint>> traces = collectTraces(names, activity, voltage, temperature, frequency, power);
62+
63+
vector<shared_ptr<FailureMechanism>> mechanisms = {NBTI::model()};
64+
for (const shared_ptr<Unit>& unit: units)
65+
unit->computeReliability(mechanisms, traces[unit->name]);
66+
// Compute reliabilities
67+
// Monte Carlo sim to get overall failure distribution
68+
}
69+
catch (ArgException& e)
70+
{
71+
cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
72+
return 1;
73+
}
74+
return 0;
75+
}

0 commit comments

Comments
 (0)