Simulator Configuration File

Alternatively instead of hardcoding parameters, the simulator allows configuration via a configuration file.

By default, the config file must be named flashsim.cfg and placed in the current directory. The path to the config file can be overridden using the MCO_FLASHSIM_CONFIG environment variable.

Configuration file example

Below is an example of a config file with all parameters specified:

    # Page size in bytes
    page_size = 4096

    # Number of pages in an erase block
    pages_per_block = 64

    # Total number of blocks
    n_blocks = 2048

    # Block erase time (microseconds)
    erase_delay = 2700

    # Page program time (microseconds)
    prog_delay = 1800

    # Page read time (microseconds)
    read_delay = 1900

    # Page copy time (microseconds)
    copy_delay = 700

    # Enforce real-time delays
    realtime_delays = no

    # Place flash content in the image file only
    file_based = no

    # simulate MANAGED flash media
    managed = no

    # Emit bad block error after 'bad_block_ratio' operations
    bad_block_ratio = 1000000

    # Emit ECC error after 'ecc_error_ratio' read operations
    ecc_error_ratio = 1000000

    # seed for random number generator
    random_seed = 112344

    # File to save/load flash content
    image_filename = flash_image.img