Overview

Flash-DBSim is a simulator for flash-based research. It's developed by C++, and open source. The code license of Flash-DBSim system is GNU General Public License v2.

Here, we will describe how to config and use Flash-DBSim system in detail, at the meanwhile, the way that how to use the interfaces of Flash-DBSim to develop new modules so that researchers can implement their own algorithms will be introduced, too.

Get Ready

You can download the latest version of source codes and components of Flash-DBSim from "Download" page. Depending on your requirements, different files are needed.

Note: Please ensure that Flash-DBSim system has already had the corresponding modules to be used in your researches. (All modules of Flash-DBSim system are described detailedly in "Module"), otherwise, you may need to develop new modules for your researches (See also "How to Develop New Flash-DBSim Modules").

How to Config Flash-DBSim Component

After your download, three files are

Flash-DBSim Component Files

These 3 files are:

The step of config Flash-DBSim system component file is shown as below:

  1. Create a new C++ project;
  2. Copy FlashDBSimDll.dll to the folder where the compiled EXE file are (Default to Debug or Release in Visual Studio).
  3. Copy FlashDBSimDll.lib to the project directory, and import flashdbsim_i.h to your project.
  4. Chect the correctness of the path configuration of FlashDBSimDll.lib in flashdbsim_i.h.

The path configuration of FlashDBSimDll.lib in flashdbsim_i.h defaults to:

#pragma comment(lib, "FlashDBSimDll.lib")

Note: A compile-time error will be occurred if the path configuration of FlashDBSimDll.lib is incorrect.

How to Use Flash-DBSim Component

All declarations of API functions in Flash-DBSim system have been written in flashdbsim_i.h. See also "API" for more information about these functions.

There are two function: f_initialize, f_release should be noticed. They are used to initialize and release the whole Flash-DBSim system, respectively. The general process of using Flash-DBSim system is like below:

  1. Calling f_initialize function to initialize the whole Flash-DBSim system, and binding with the specified VFD/FTL modules.
  2. Calling other public API interfaces defined in Flash-DBSim to manipulate the system after your initialization.
  3. Calling f_release function to release the resources and data occupied by Flash-DBSim system.

How to Develop New Flash-DBSim Modules

If you wanna do the secondary development for Flash-DBSim system in your researches, follow these steps:

  1. Download the source codes of Flash-DBSim system.
  2. Program your function module, and please make sure that the module is inherited from the specified interfaces (IVFD_MODULE, IFTL_MODULE);
  3. Add a new ID for your module in enum VFD_ID, FTL_ID in stdafx.h, and ensure the ID is unique.
  4. Add initialization codes of your new module in the function "FlashDBSim::Initialize" in FlashDBSim.cpp.

  5. switch (vfdInfo.id) {
      case ID_NAND_DEVICE_01:
        flashDevice = new NandDevice01();
        break;
      case ID_NAND_DEVICE_02:
        flashDevice = new NandDevice02();
        break;
      ...
      << Add new initialization codes of VFD modules here!! >>
      default:
        break;
    }

    switch (ftlInfo.id) {
      case ID_FTL_01:
        ftl = new FTL01();
        break;
      ...
      << Add new initialization codes of FTL modules here!! >>
      default:
        break;
    }
  6. Rebuild the source code of Flash-DBSim system, then get the new FlashDBSimDll.dll, FlashDBSimDll.lib Files;
  7. Add the same ID of your new module in enum VFD_ID, FTL_ID in flashdbsim_i.h.
  8. Update FlashDBSimDll.dll, FlashDBSimDll.lib, flashdbsim_i.h files follow the steps in "How to Config Flash-DBSim Component".