Thread Safe EEPROM Simulator

Specifications

EEPROM is of 64Kb with 8192 words of 8 bits. The memory has 32 bytes page access. There are total 256 pages.

There are 2 API functions.

The offset is the total memory offset, size is buffer size that is to be read or written. *buf is the pointer to the start of the buffer. In read operation, data is read from eeprom and copied to buf. In write operation, data from buf is written to the eeprom.

Code Architecture and Assumptions

Compilations and Usage

Assuming we are in the directory of the project.

Testing

Apple clang version 11.0.3 (clang-1103.0.32.62) Target: x86_64-apple-darwin19.6.0 Thread model: posix.

Multiple memory trace files are generated that simulated read and writes of various sizes. It also tests for some of the edge cases that might occur in real life executions.