Nios® II Software Developer Handbook

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

8.8.2. Assumptions and Requirements

Typically, you are developing a device driver or software package for eventual incorporation in a BSP. The driver or package is to be incorporated in the BSP by an end user who has limited knowledge of the driver or package internal implementation. To add your driver or package to a BSP, the end user must rely on the driver or package settings that you create with the tools described in this section.

For a device driver or software package to work with the Nios® II SBT, it must meet the following criteria:
  • It must have a defining Tcl script. The Tcl script for each driver or software package provides the Nios® II SBT with a complete description of the driver or software. This description includes the following information:
    • Name—A unique name identifying the driver or software package
    • Source files—The location, name, and type of each C/C++ or assembly language source or header file
    • Associated hardware class (device drivers only)—The name of the hardware peripheral class the driver supports
    • Version and compatibility information—The driver or package version, and (for drivers) information about what device core versions it supports.
    • BSP type(s)—The supported operating system(s)
    • Settings—The visible parameters controlling software build and runtime configuration
  • The Tcl script resides in the driver or software package root directory.
  • The Tcl script’s file name ends with _sw.tcl. Example: custom_ip_block_sw.tcl.
  • The root directory of the driver or software package is located in a directory named ip, one level beneath the Intel® Quartus® Prime project directory containing the design your BSP targets. This approach is recommended if your driver or software package is used only once, in a specific hardware project.

For more information on how file names and directory structures conform to certain conventions, refer to the “File Names and Locations” chapter.

If your driver or software package uses the HAL auto initialization mechanism (alt_sys_init()), certain macros must be defined in a header file.

For more information about this header file, refer to the “Header Files and alt_sys_init.c” chapter.

For more information about integrating a HAL device driver, refer to AN 459: Guidelines for Developing a Nios II HAL Device Driver.

For more information about the commands you can use in a driver Tcl script, refer to the " Nios® II Software Build Tools Reference" chapter.