Specifications
Creating and Naming the Driver or Package
The first command in any driver or software package Tcl script must be the create_driver or
create_sw_package command. The remaining commands can be in any order. Use the appropriate
create command only once per Tcl file. Choose a unique driver or package name. For drivers, Altera
recommends appending _driver to the associated hardware class name. The following example illustrates
this convention:
create_driver my_custom_component_driver
Identifying the Hardware Component Class
Each driver must identify the hardware component class the driver is associated with in the
set_sw_property command’s hw_class_name argument. The following example associates the driver
with a hardware class called my_custom_component:
set_sw_property hw_class_name my_custom_component
Note:
The set_sw_property command accepts several argument types. Each call to set_sw_property
sets or overwrites a property to the value specified in the second argument.
For more information about the set_sw_property command, refer to the "Nios II Software Build Tools
Reference" chapter.
The hw_class_name argument does not apply to software packages.
If you are creating your own driver to use in place of an existing one (for example, a custom UART driver
for the altera_avalon_uart component), specify a driver name different from the standard driver. The
Nios II SBT uses your driver only if you specify it explicitly.
For more information, refer to the "Nios II Software Build Tools Reference" chapter.
Choose a name for your driver or software package that does not conflict with other Altera-supplied
software or IP, or any third-party software or IP installed on your host system. The BSP generator uses the
name you specify to look up the software package or driver during BSP creation. If the Nios II SBT finds
multiple compatible drivers or software packages with the same name, it might pick any of them.
If you intend to distribute your driver or software package, Altera recommends prefixing all names with
your organization’s name.
Related Information
Nios II Software Build Tools Reference on page 15-1
Setting the BSP Type
You must specify each operating system (or BSP type) that your driver or software package supports. Use
the add_sw_property command’s supported_bsp_type argument to specify each compatible operating
system. In most cases, a driver or software package supports both Altera HAL (hal) and Micrium
MicroC/OS-II (ucosii) BSP types, as in the following example:
add_sw_property supported_bsp_type hal
add_sw_property supported_bsp_type ucosii
Note:
The add_sw_property command accepts several argument types. Each call to add_sw_property
adds the final argument to the property specified in the second argument.
Note: Support for additional operating system and BSP types is not present in this release of the Nios II
SBT.
NII5V2
2015.05.14
Creating and Naming the Driver or Package
7-21
Developing Device Drivers for the Hardware Abstraction Layer
Altera Corporation
Send Feedback