Nios® V Processor Software Developer Handbook

ID 743810
Date 10/12/2024
Public
Document Table of Contents

4.3.4.5.1. Recommended Development Practice

The safest software development practice for avoiding the software coherency problem is to follow a strict hardware and software project hierarchy and to use Nios V utilities to generate your application and BSP projects.

One best practice is structuring your application hierarchy with parallel application projects and BSP project folders. In the following recommended directory structure, a top-level hardware project folder includes:

  • The Quartus® Prime project file.
  • The Platform Designer-generated files.
  • The Software Project Folder, which contains the following subfolders:
    • Application project

    • BSP project.

Figure 7. Recommended Directory Structure

The complete system generation process, from hardware to BSP and application projects, must be repeated every time a change is made to the system in Platform Designer. Therefore, defining all your settings in your niosv-bsp command Tcl script is more efficient than using the BSP Editor to customize your project.

The system generation process follows:

  1. Hardware files generation: Using Platform Designer, write the updated system description to the <system_name>.qsys file.
  2. Regenerate BSP project: Generates the BSP project with the niosv-bsp command.
  3. Regenerate application project: Generates the application project with the niosv-app command.
  4. Build the system: Builds the system software using the application and BSP CMakeLists.txt file.

To implement this system generation process, Altera recommends that you use the following checklists for handing off responsibility between the hardware and software groups.

Note: This method assumes that the hardware and software engineering groups use the same Quartus® Prime version.
Table 15.   Checklists for Handing Off Responsibility between Groups
To hand off the project from the hardware group to the software group, follow this checklist:
Hardware project hand-off

The hardware group provides copies of the <system_name>.qsys and <system_name>.sof files. The software group copies these files to the software group’s hardware project folder.

Create software project

The software group creates the software application for the new hardware by running the niosv-bsp and niosv-app utilities.

Build software project

The software group runs cmake and make commands in its application project directory to build the software application.

Reconfigure software project

The hardware hands over the updated <system_name>.qsys and <system_name>.sof files. The software group runs the niosv-app and niosv-bsp command to reconfigure the group’s application and BSP projects.

Rebuild software project

The software group runs cmake and make commands in its application project directory to build the software application.

To hand off the project from the software group to the hardware group, follow this checklist:
Software project hand-off The software group builds and provides the hardware group with a copy of the <app_name>.elf software binary. The hardware group then converts the software binary into the relevant format according to Nios® V processor boot methods.