eCPRI Intel® FPGA IP Design Example User Guide

ID 683837
Date 12/01/2024
Public

1.8. Generating and Downloading the Executable and Linking Format (.elf) Programming File

This task describes how to generate and build a Nios V processor software project. For a streamlined build flow, ensure you create the same directory tree in your design project as in this task..

  1. In your design project directory,, create a directory software.
  2. In the software directory,, create two directories app and bsp.
  3. Copy all the files in <design_example_dir>/synthesis/ed_fw to <design_example_dir>/synthesis/quartus/software/app.
    The design files are:
    c2_reconfig.h
    c3_funtion.c
    c3_recongifg.c
    c3_reconfig.h
    flow.c
    flow.h
    main.c
  4. Generate the BSP:
    1. Launch the Nios V Command Shell
    2. Go to <design_example_dir>/synthesis/quartus/software directory.
    3. Run the following command.
      niosv-bsp -c --quartus-project=../ecpri_ed.qpf --
      qsys=../../ip_components/nios_system.qsys --type=hal ./bsp/settings.bsp
  5. Generate the application project:
    niosv-app --bsp-dir=./bsp --app-dir=./app --srcs=./app/ --elf-name=nios_system.elf 
  6. Build the application project:
    cmake -G "Unix Makefiles" -S ./app -B ./app/build make -C ./app/build
    The nios_system.elf file is generated in the <design_example_dir>/synthesis/quartus/software/app/build directory.
  7. Program the Nios V processor:
    1. Go to <design_example_dir>/synthesis/quartus/software/app/build
    2. Type the following command in the Nios V Command Shell.
      • For Stratix 10 devices:
        niosv-download -g -r nios_system.elf -c 1 -d 1 -i 0
      • For Agilex 7 devices:
        niosv-download -g -r nios_system.elf -c 1 -d 0 -i 0