Specifications
No Specific Requests
If no specific device driver is requested, and no compatible device driver is located for a particular
hardware module, the BSP generator issues an informative message visible in either the debug or verbose
generation output. This behavior is normal for many types of hardware, such as memory devices, that do
not have device drivers. If a software package or specific driver is requested and cannot be located, an
error is generated and BSP generation or settings update halts.
Creating a Tcl script allows you to add extra definitions in the system.h file, enable automatic driver
initialization through the alt_sys_init.c structure, and enable the Nios II SBT to control any extra
parameters that might exist.
With the Tcl software definition files in place, the SBT reads in the Tcl file and populate the makefiles and
other support files accordingly.
When the Nios II SBT adds each driver or software package to the system, it uses the data in the Tcl script
defining the driver or software package to control each file copied in to the BSP. This rule also affects
generated BSP files such as the BSP Makefile, public.mk, system.h, and the BSP settings and summary
HTML files.
When you create a new software project, the Nios II SBT generates the contents of alt_sys_init.c to match
the specific hardware contents of the system.
File Names and Locations
The Nios II build tools find a device driver or software package by locating a Tcl script with the file name
ending in _sw.tcl, and sourcing it.
For more information, refer to the “The Nios II BSP Generator” chapter.
Each peripheral in a Nios II system is associated with a specific component directory. This directory
contains a file defining the software interface to the peripheral.
For more information, refer to the “Accessing Hardware” chapter.
To enable the SBT to find your component device driver, place the Tcl script in a directory named ip
under your hardware project directory.
The file hierarchy that is suitable for the Nios II SBT is located in the <Altera installation>/ip/altera/
sopc_builder_ip directory. This example assumes a device driver supporting a hardware component
named custom_component.
Related Information
• The Nios II BSP Generator on page 7-17
• Accessing Hardware on page 7-3
Source Code Discovery
You use Tcl scripts to specify the location of driver source files.
For more information, refer to the “The Nios II BSP Generator” chapter.
Related Information
The Nios II BSP Generator on page 7-17
7-18
No Specific Requests
NII5V2
2015.05.14
Altera Corporation
Developing Device Drivers for the Hardware Abstraction Layer
Send Feedback