Specifications

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) informa‐
tion 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 in one of the following places:
In any directory included in the SOPC_BUILDER_PATH environment variable, or in any directory
located one level beneath such a directory. This approach is recommended if your driver or
software packages are installed in a distribution you create.
In a directory named ip, one level beneath the Quartus II 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.
Related Information
File Names and Locations on page 7-18
Header Files and alt_sys_init.c on page 7-28
AN 459: Guidelines for Developing a Nios II HAL Device Driver
Nios II Software Build Tools Reference on page 15-1
7-16
Assumptions and Requirements
NII5V2
2015.05.14
Altera Corporation
Developing Device Drivers for the Hardware Abstraction Layer
Send Feedback