For user convenience, NANDFlashSim provides a build script. This build script can compile tree type image: 1) executable image, 2) static library, and 3) shared library.

Specifying Boost Libraries Location

For building NANDFlashSim with Boost libraries, please let build.sh the location (path) of the Boost libraries. For this, you can specify the path of Boost libraries after the NFS_BUILDER_BOOST_PATH flag in the build.sh as follows:

Note that the build.sh script will automatically compile Boost libraries if you didn't build them yet. If you built Boost libraries already, the build.sh script skip to compile libraries and just like them to NANDFlashSim.

Executable image

For building executable image of NANDFlashSim, just type ./build.sh on your command line.

 $> ./build.sh

The build.sh will give you the executable image as follows:

Static library

Since NANDFlashSim originally is designed in order to integrate with other system-level simulator, we provide a way building NANDFlashSim as static library as well as shared library. For building the static library, you need to specify --static-lib option for build.sh.

 $> ./build.sh --static-lib

After compiling, you can see the library, libnfs.a, in the working directory:

Shared library

In the same manner, you can build shared library by specifying --shared-lib option like below:

 $> ./build.sh --shared-lib

The libnfs.so.1.0.1 is the shared library that you built.

Debug Mode

If you want to compile NANDFlashSim as debug mode, please add option -g to NFS_BUILDER_USER_CFLAGS flag, which is defined in build.sh. Otherwise, just let the option blank. The build script will compile NANDFlashSim with release mode.

You can use this debug mode for building any kinds of NANDFlashSim images.

Other Options

You can build NANDFlashSim with different reliability constraints.

 NO_STORAGE

NO_STORAGE option in TypeSystem.h enable you simulate NANDFlashSim without virtual blocks. Even though the virtual blocks allocate mapped file only if hosts or other system-level simulators access physical NAND blocks, the accessing mapped file will degrade simulation performance. To simulate NAND flash without virtual blocks, you can define NO_STORAGE option. We recommend define this option if you don't need to simulate some specific situations like a sudden power-off recovery test.

 NO_ENFORCING_ORDER

Sometimes, you need to make flexible and to loose NAND flash constraints in a development process. NO_ENFORCING_ORDER option in TypeSystem.h enable your NAND flash system to program out-of-order fashion. It should be noted that this out-of-update program method violates NAND flash specification. Thus, please define this macro only the purpose for testing. If you do not specify this option, NANDFlashSim will inform you the out-of-update spec violation.

 NO_ENFORCING_NOP

In the same reason, we recommend you use this option for only development purpose or test purpose. NO_ENFORCING_NOP will allows you can program a page even though it heads to a block, which are not erased yet.