Skip to content

Commit ccb8230

Browse files
committed
[/] first commit
0 parents  commit ccb8230

File tree

3,944 files changed

+1040666
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,944 files changed

+1040666
-0
lines changed

AUTHORS

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
BEER Authors
2+
==============
3+
4+
This is the list of contributing authors to BEER:
5+
6+
+ Minesh Patel

CHANGES

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version 1.0.0 [2020 Oct 10]
2+
+ The first public release of BEER

Doxyfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
PROJECT_NAME = BEER
2+
OUTPUT_DIRECTORY = doxygen
3+
WARNINGS = YES
4+
INPUT = src README.md
5+
FILE_PATTERNS = *.cpp *.h
6+
ENABLE_PREPROCESSING = YES
7+
USE_MDFILE_AS_MAINPAGE = README.md

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2020, SAFARI Research Group at ETH Zurich University
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a
4+
copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included
12+
in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
## Bit-Exact ECC Recovery (BEER):
2+
3+
This software implements BEER as described in [our MICRO 2020 academic
4+
paper](https://people.inf.ethz.ch/omutlu/pub/BEER-bit-exact-ECC-recovery_micro20.pdf)
5+
[1]. BEER uses a SAT solver to identify the parity-check matrix (i.e., H-matrix)
6+
of a linear block code using only uncorrectable error patterns. BEER is useful
7+
when dealing with an invisible or unknown ECC mechanism (e.g., modern DRAM chips
8+
that use on-die ECC).
9+
10+
[Our
11+
paper](https://people.inf.ethz.ch/omutlu/pub/BEER-bit-exact-ECC-recovery_micro20.pdf)
12+
[1] shows that knowing the parity-check matrix of an ECC code allows predicting
13+
the ECC code's post-correction error characteristics, enabling:
14+
15+
- System designers to make informed decisions when using third-party products with unknown ECC codes.
16+
- Test and validation engineers to diagnose the root-causes for observed post-correction errors and craft test patterns that target pre-correction error properties.
17+
- Scientific researchers to tie post-correction error characteristics to those of the pre-correction errors.
18+
19+
To learn about BEER and its potential applications in much greater detail, please see any of:
20+
- [Our paper](https://people.inf.ethz.ch/omutlu/pub/BEER-bit-exact-ECC-recovery_micro20.pdf)
21+
- [15-minute conference talk](https://www.youtube.com/watch?v=D97oAbCaJWk)
22+
(slides in
23+
[pptx](https://people.inf.ethz.ch/omutlu/pubBEER-bit-exact-ECC-recovery_micro20-talk.pptx)
24+
or
25+
[pdf](https://people.inf.ethz.ch/omutlu/pub/BEER-bit-exact-ECC-recovery_micro20-talk.pdf))
26+
- [90-second lightning talk](https://www.youtube.com/watch?v=hgSziiRTUY4)
27+
(slides in
28+
[pptx](https://people.inf.ethz.ch/omutlu/pub/BEER-bit-exact-ECC-recovery_micro20-lightning-talk.pptx)
29+
or
30+
[pdf](https://people.inf.ethz.ch/omutlu/pub/BEER-bit-exact-ECC-recovery_micro20-lightning-talk.pdf))
31+
32+
*Please send questions to Minesh Patel at minesh.patelh@gmail.com*
33+
34+
## BEER High-Level Overview
35+
36+
[Our
37+
paper](https://people.inf.ethz.ch/omutlu/pub/BEER-bit-exact-ECC-recovery_micro20.pdf)
38+
[1] provides a detailed overview of BEER's purpose and design, and we highly
39+
recommend the interested user to refer to it when delving deeply into BEER.
40+
41+
At a high level, BEER consists of three phases:
42+
1. BEER induces uncorrectable errors in a real DRAM chip by pausing DRAM refresh
43+
and allowing data-retention errors to occur (in this software, we simulate
44+
doing so using the [EINSim DRAM error-correction
45+
simulator](https://github.com/CMU-SAFARI/EINSim) [2, 3]). When inducing
46+
data-retention errors, BEER uses carefully-chosen test patterns that restrict
47+
errors to specific codeword bit positions. This is possible due to the
48+
inherent asymmetry of data-retention errors: data-retention errors typically
49+
occur only in bits whose values are programmed to specific hardware-dependent
50+
values (i.e., such that the underlying DRAM cell capacitor is set to its
51+
fully-charged state). Designing and using these test patterns is motivated
52+
and discussed in our paper [1].
53+
2. For each test pattern, BEER aggregates the bit-positions of uncorrectable
54+
errors that were observed. The particular bit-positions depend on the
55+
specific parity-check matrix that the ECC code uses.
56+
3. Using a SAT solver, BEER computes the unique parity-check matrix that can
57+
cause the observed uncorrectable error pattern.
58+
59+
This software implements the aforementioned three steps and can optionally use
60+
the [EINSim simulator](https://github.com/CMU-SAFARI/EINSim) [2, 3] to
61+
substitute the functionality of real experiments with physical DRAM chips.
62+
63+
## Codebase Overview
64+
65+
BEER is a C++ command-line tool set up as a Makefile project. All source files
66+
are contained within the ```src/``` directory and library dependencies are
67+
provided within ```lib/```.
68+
69+
We use Doxygen to document the source code and provide a Doxyfile for building
70+
HTML and LaTeX documentation. To build the documentation, simply issue:
71+
72+
```
73+
$ doxygen
74+
```
75+
when in the project directory, or point ```doxygen``` to the provided Doxyfile.
76+
The HTML documentation will be built under ```doxygen/html/index.html```.
77+
78+
## Dependencies
79+
80+
BEER relies on the [EINSim simulator](https://github.com/CMU-SAFARI/EINSim) [2,
81+
3] to simulate injecting data-retention errors. EINSim must be built separately
82+
and its executable path provided to BEER via the command line.
83+
84+
## Toolchain
85+
86+
Building and running BEER requires a working C++11 toolchain (e.g., GCC, Clang,
87+
MSVC). BEER has been built and tested with:
88+
89+
- GCC 9.1.0
90+
- GCC 7.4.0
91+
- GCC 6.3.0
92+
- Apple LLVM 10.0.0 (clang-1000.11.45.5)
93+
- Apple LLVM 9.1.0 (clang-902.0.39.2)
94+
95+
## Building in Linux
96+
97+
```
98+
$ make [-j <# threads>] [other make options] <target>
99+
```
100+
101+
The makefile has various targets, described as follows:
102+
103+
- ```release``` builds ```beer``` with full optimizations
104+
- ```debug``` builds ```beer.d``` with no optimization and debug symbols
105+
- ```all``` builds both ```release``` and ```debug```
106+
- ```doc``` builds ```doxygen``` documentation using the provided doxyfile
107+
- ```clean``` cleans build and binary files for both ```release``` and ```debug```
108+
109+
Omitting the ```target``` argument defaults to the ```release``` configuration.
110+
111+
## Usage
112+
113+
BEER runs as a command-line tool with several CLI options that are shown when running BEER without options:
114+
115+
```
116+
$ ./path/to/beer
117+
```
118+
119+
BEER has two primary modes that are configured using the ```-m``` flag:
120+
- ```-m f``` file mode, where ECC code parameters are read from a JSON configuration file provided using the ```-f``` option.
121+
- ```-m g``` generation mode, where BEER generates a random ECC code using EINSim with the ECC code parameters provided on the CLI.
122+
123+
For example, the following command line will first generate a random (7,4)
124+
Hamming code, will simulate injecting errors within the 1- and 2-CHARGED test
125+
patterns (discussed in our paper [1]) using EINSim, and will apply BEER to
126+
determine the original ECC function using the Z3 SAT solver:
127+
```
128+
./path/to/beer -m g -k 4 -p 1 -p 2 -l ALL_T path/to/einsim
129+
```
130+
131+
## Licensing
132+
133+
The current version of the simulator is provided as-is under the MIT license.
134+
135+
The following header-only libraries are used and are located under ```lib``` with their own license:
136+
- [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page)
137+
- [cxxopts](https://github.com/jarro2783/cxxopts)
138+
- [rapidjson](https://rapidjson.org/)
139+
140+
BEER requires the Z3 solver built as a library. ```lib``` includes the Z3-v4.8.7
141+
source and a build script to help build Z3 as a library in-directory. However,
142+
you may modify the Makefile to link against a different version (e.g.,
143+
system-wide installation).
144+
- [Z3 Solver](https://github.com/Z3Prover/z3)
145+
146+
## Attribution
147+
148+
Please cite the following paper when using BEER:
149+
150+
[\[1\] Minesh Patel, Jeremie S. Kim, Taha Shahroodi, Hasan Hassan, and Onur Mutlu, "Bit-Exact ECC Recovery (BEER): Determining DRAM On-Die ECC Functions by Exploiting DRAM Data Retention Characteristics", in the Proceedings of the 53rd Annual ACM/IEEE International Symposium on Microarchitecture (MICRO 2020), Virtual, October 2020.](https://people.inf.ethz.ch/omutlu/pub/BEER-bit-exact-ECC-recovery_micro20.pdf)
151+
152+
Other references:
153+
154+
[\[2\] Minesh Patel, Jeremie S. Kim, Hasan Hassan, and Onur Mutlu, "Understanding and Modeling On-Die Error Correction in Modern DRAM: An Experimental Study Using Real Devices", in the Proceedings of the 49th Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN 2019), Portland, OR, USA, June 2019.](https://people.inf.ethz.ch/omutlu/pub/understanding-and-modeling-in-DRAM-ECC_dsn19.pdf)
155+
156+
[\[3\] EINSim Simulator on GitHub](https://github.com/CMU-SAFARI/EINSim)

TODO

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
TODO - list of outstanding tasks for BEER:
2+
3+
Improvements:
4+
+ Thorough testing of different true-/anti-cell layout cases
5+
+ Performance optimization
6+
+ Z3 tweaks
7+
+ Using GF(2) data types / libraries
8+
9+
New features:
10+
+ Wider range of ECC schemes (e.g., BCH, Reed-Solomon)

lib/build_z3.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
3+
cd ${SCRIPT_DIR}/z3-4.8.9
4+
python scripts/mk_make.py --prefix=${SCRIPT_DIR}/z3-4.8.9
5+
cd build
6+
make -j 8
7+
make install

0 commit comments

Comments
 (0)