Embedded Design Handbook

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

5.2.2.2.1. Hardware Design

  1. Create your Intel® Quartus® Prime and Platform Designer project.
  2. Make sure external RAM or onchip memory (OCRAM) is added into your Platform Designer system.
  3. If dual image configuration is required, ensure that the Dual Configuration IP is instantiated in Platform Designer (Configuration Mode is set to Dual Compressed Images).
  4. Refer to the diagram below for example IP connections in Platform Designer.
    Figure 52. Example IP Connections in Platform Designer for Booting Nios® II from On-Chip Flash (UFM)

IP Component Settings

  1. In the Nios® II processor parameter editor, set the reset vector memory to On-Chip Flash and exception vector memory to OCRAM/External RAM or On-Chip Flash according to your design preference.
    Note: Setting the exception vector memory to OCRAM/External RAM is recommended to make the interrupt processing faster.
    1. If exception vector memory is set to On-Chip Flash, the minimum exception vector offset that you can set is 0x20.
      Note: When executing-in-place, the Nios® II processor boots and runs directly from UFM, without copying any code at boot time. Because the Nios® II begins executing at the reset address in this case, exception vectors must be located at a nonzero exception vector offset to allow for 32 bytes instructions between the reset vector and the base of the exception vectors.
    Figure 53.  Nios® II Parameter Editor Settings with Exception Vector Set to OCRAM/External RAM
    Figure 54.  Nios® II Parameter Editor Settings with Exception Vector Set to On-Chip Flash
  2. In the On-chip Flash IP parameter editor, set the Configuration Mode to one of the following, according to your design preference:
    • Single Uncompressed Image
    • Single Compressed Image
    • Dual Compressed Images
    Figure 55. Configuration Mode Selection in On-Chip Flash Parameter Editor
  3. Program the UFM data (HEX file) by using one of the following methods:
    • Method 1: Initialize the UFM data in the SOF Intel® Quartus® Prime includes the UFM initialization data in the SOF during compilation. SOF recompilation is needed if there are changes in the UFM data.
    • Method 2: Combine UFM data with a compiled SOF during programming files (POF) generation 11—UFM data is combined with the compiled SOF during the programming files conversion. SOF recompilation is NOT needed even if there are changes in the UFM data.
  4. Click Generate HDL. The Generation dialog box appears.
  5. Specify output file generation options, and then click Generate.

On-Chip Flash IP Settings for Method 1

  1. Check Initialize flash content.
    Figure 56.  Initialize Flash Contents with Default Initialization File
  2. If the default path is used, add meminit.qip generated during “make mem_init_generate” into Intel® Quartus® Prime project.
    Figure 57. Adding meminit.qip File in Intel® Quartus® Prime

    Make sure the generated HEX naming matches the default naming.

  3. If non-default path is selected, enable the Enable non-default initialization file and specify the path of the HEX file.

On-Chip Flash IP Settings for Method 2

  1. Uncheck Initialize flash content.
    Figure 58. Initialize Flash Content with Non-default Initialization File

Intel® Quartus® Prime Software Settings

  1. In the Intel® Quartus® Prime software, click on Assignment > Device > Device and Pin Options > Configuration. Set Configuration mode to Single Uncompressed Image or Single Compressed Image or Dual Compressed Images.12
    Figure 59. Configuration Mode Selection in Intel® Quartus® Prime Software
    Note: If the configuration mode setting in Intel® Quartus® Prime software and Platform Designer parameter editor is different, the Intel® Quartus® Prime project fails with the following error messages.
  2. Click OK to exit the Device and Pin Options window.
  3. Click OK to exit the Device window.
  4. Click Processing > Start Compilation to compile your project and generate the .sof file.
11 This is the recommended method for application developer. You are not required to recompile SOF file for application changes during development.
12 The size of UFM shown vary according to your device selection.