Nios® V Embedded Processor Design Handbook

ID 726952
Date 1/27/2025
Public
Document Table of Contents

4.5.2.1. Hardware Design Flow

The following section describes a step-by-step method for building a bootable system for a Nios® V processor application from On-Chip Flash. The example below is built using MAX® 10 device.

IP Component Settings

  1. Create your Nios® V processor project using Quartus® Prime and Platform Designer.
  2. Make sure external RAM or On-Chip Memory (OCRAM) is added to your Platform Designer system.
    Figure 19. Example IP Connections in Platform Designer for Booting Nios® V from On-Chip Flash (UFM)
  3. 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
    • Single Uncompressed Image with Memory Initialization
    • Single Compressed Image with Memory Initialization
For more information about Dual Compressed Images, refer to the MAX® 10 FPGA Configuration User Guide - Remote System Upgrade.
Figure 20. Configuration Mode Selection in On-Chip Flash Parameter Editor

On-Chip Flash IP Settings - UFM Initialization

You can choose one of the following methods according to your preference:
Note: The steps in the subsequent subchapters (Software Design Flow and Programming) depend on the selection you make here.
  • Method 1: Initialize the UFM data in the SOF during compilation

    Quartus® Prime includes the UFM initialization data in the SOF during compilation. SOF recompilation is needed if there are changes in the UFM data.

    1. Check Initialize flash content and Enable non-default initialization file.
      Figure 21. Initialize Flash Contents and Enable Non-default Initialization File
    2. Specify the path of the generated .hex file (from the elf2hex command) in the User created hex or mif file.
      Figure 22. Adding the .hex File Path
  • Method 2: Combine UFM data with a compiled SOF during POF generation

    UFM data is combined with the compiled SOF when converting programming files. You do not need to recompile the SOF, even if the UFM data changes. During development, you do not have to recompile SOF files for changes in the application. Altera® recommends this method for application developers.

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

Reset Agent Settings for Nios® V Processor Execute-In-Place Method

  1. In the Nios® V processor parameter editor, set the Reset Agent to On-Chip Flash.
    Figure 24.  Nios® V Processor Parameter Editor Settings with Reset Agent Set to On-Chip Flash
  2. Click Generate HDL when the Generation dialog box appears.
  3. Specify output file generation options and click Generate.

Quartus® Prime Software Settings

  1. In the Quartus® Prime software, click Assignments > Device > Device and Pin Options > Configuration. Set the Configuration mode according to the setting in On-Chip Flash IP.
    Figure 25. Configuration Mode Selection in Quartus® Prime Software
  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.
Note: If the configuration mode setting in Quartus® Prime software and Platform Designer parameter editor is different, the Quartus® Prime project fails with the following error message.
Figure 26. Error Message for Different Configuration Mode Setting
Error (14740): Configuration mode on atom "q_sys:q_sys_inst|altera_onchip_flash:onchip_flash_1|altera_onchip_flash_block:
altera_onchip_flash_block|ufm_block" does not match the project setting. Update and regenerate the Qsys system to match 
the project setting.