Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

3.11.3. Memory Initialization Files for User-Defined Memories

Generating memory initialization files requires detailed information about the physical memory devices, such as device names and data widths. Normally, the Nios® II SBT extracts this information from the .sopcinfo file. However, in the case of a user-defined memory, the .sopcinfo file does not contain information about the data memory, which is outside the system. Therefore, you must provide this information manually.

You specify memory device information when you add the user-defined memory device to your BSP. The device information persists in the BSP settings file, allowing you to regenerate memory initialization files at any time, exactly as if the memory device were part of the hardware system.

Specify the memory device information in the Advanced tab of the Add Memory Device dialog box. Settings in this tab control makefile variables in mem_init.mk. On the Advanced tab, you can control the following memory characteristics:
  • The physical memory width. The device’s name in the hardware system.
  • The memory initialization file parameter name. Every memory device can have an HDL parameter specifying the name of the initialization file. The Nios® II ModelSim launch configuration overrides the HDL parameter to specify the memory initialization filename. When available, this method is preferred for setting the memory initialization filename.
  • The Mem init filename parameter can be used in Nios® II systems as an alternative method of specifying the memory initialization filename. The Mem init filename parameter directly overrides any filename specified in the HDL.
  • Connectivity to processor master ports. These parameters are used when creating the linker script.
  • The memory type: volatile, CFI flash or EPCS flash.
  • Byte lanes.
  • You can also enable and disable generation of the following memory initialization file types:
    • .hex file
    • .dat and .sym files
    • .flash file