  Inefficient data transfer between computation and memory inspired emerging
processing-in-memory (PIM) technologies. Many PIM solutions enable storage and
processing using memristors in a crossbar-array structure, with techniques such
as memristor-aided logic (MAGIC) used for computation. This approach provides
highly-paralleled logic computation with minimal data movement. However,
memristors are vulnerable to soft errors and standard error-correcting-code
(ECC) techniques are difficult to implement without moving data outside the
memory. We propose a novel technique for efficient ECC implementation along
diagonals to support reliable computation inside the memory without explicitly
reading the data. Our evaluation demonstrates an improvement of over eight
orders of magnitude in reliability (mean time to failure) for an increase of
about 26% in computation latency.
