NAND Flash Simulator

The Flash Simulator allows developers to build applications for unmanaged flash devices without needing physical hardware. Instead, data is stored in memory or in a file. By default, the simulator allocates all emulated flash memory in memory, essentially acting as a RAM disk. In this mode, flash contents can be saved to a file when closing the simulated device and reloaded on the next run.

However, this approach has some drawbacks. If the application crashes, saving the image may not always be possible, and memory constraints could become an issue. To work around this, the simulator supports flash emulation both in memory and in a file. In this case, only a small header containing control structures is stored in memory, while the flash content resides exclusively in the file.

Additionally, the simulator enables performance evaluation of database operations based on user-defined delays for basic flash operations (read, program, erase, and copy).

The simulator is configured using the mco_flashsim_params_t structure, defined in include/mcoflashsim.h.

Usage:

To use the simulator, an application must be linked with the libmcoflashsim.a library:

    gcc -o my_app my_app.c -lmcoflashsim

Support for eXtremeDB/rt Storage Options:

The Flash Simulator provides comprehensive support for both storage approaches in eXtremeDB/rt:

This dual support makes the Flash Simulator an invaluable tool for developing and testing eXtremeDB/rt applications across different storage configurations, from rapid development with file-based storage to mission-critical real-time systems requiring raw flash performance.

See also: