|
| 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) |
0 commit comments