Nios® II Software Developer Handbook

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

16.5.4.1. add_sw_property

Usage

add_sw_property <property> <value>

Options

  • <property>: Name of property.
  • <value>: Value assigned, or appended to the current value.

Description

This command defines a property for a device driver or software package. A property is a list of values (for example, a list of file names). The add_sw_property command defines a property if it is not already defined. The command appends a new value to the list of values if the property is already defined.

In the case of a property consisting of a file name or directory name, use a relative path. Specify the path relative to the directory containing the Tcl script.

This command supports the following properties:

asm_source

  • Adds a Nios II assembly language source file (.s or .S) to BSPs containing your package. nios2-bsp-generate-files copies assembly source files into a BSP and adds them to the source build list in the BSP makefile. This property is optional.
  • c_source—Adds a C source file (.c) to BSPs containing your package. nios2-bsp-generate-files copies C source files into a BSP and adds them to the source build list in the BSP makefile. This property is optional.
  • cpp_source—Adds a C++ source file (.cpp, .cc, or .cxx) to BSPs containing your package. nios2-bsp-generate-files copies the C++ source files into a BSP and adds them to the source build list in the BSP makefile. This property is optional.
  • include_source—Adds an include file (typically .h) to BSPs containing your package. nios2-bsp-generate-files copies include files into a BSP, but does not add them to the generated makefile. This property is optional.
  • include_directory—Adds a directory to the ALT_INCLUDE_DIRS variable in the BSP's public.mk file. Adding a directory to ALT_INCLUDE_DIRS allows all source files to find include files in this directory. add_sw_property adds the path to the generated public makefile shared by the BSP and applications or libraries referencing it. add_sw_property compiles all files with the include directory listed in the compiler arguments. This property is optional.
  • lib_source—Adds a precompiled library file (typically .a) to each BSP containing the driver or package. nios2-bsp-generate-files copies the precompiled library file into the BSP directory and adds both the library file name and the path (required to locate the library file) into to the BSP's public.mk file. Applications using the BSP link with the library file. The library file name must conform to the following pattern: lib<name>.a where <name> is a nonempty string. Example: add_sw_property lib_source HAL/lib/libcomponent.a This property is optional.
  • specific_compatible_hw_version—Specifies that the device driver only supports the specified component hardware version. See the version property of the set_sw_property command for information about version strings. This property applies only to device drivers (see the create_driver command), not to software packages. If your driver supports all versions of a peripheral after a specific release, use the set_property min_compatible_hw_version command instead. This property is optional. This property is only available for device drivers.
  • supported_bsp_type—Adds a specific BSP type (operating system) to the list of supported operating systems that the driver or software package supports. Specify HAL if the software supports the Intel FPGA HAL, or operating systems that extend it. If your software is operating system-neutral and works on multiple HAL-based operating systems, state HAL only. If your software or driver contains code that depends on a particular operating system, state compatibility with that operating system only, but not HAL.
The name of another operating system to support must match the name of the operating system exactly. This operating system name string is the same as that used to create a BSP with the nios2-bsp-* commands, as well as in the .tcl script that describes the operating system, in its create_os command.
When you create a BSP with an operating system that extends HAL, such as UCOSII, and the BSP tools select a driver for a particular hardware module, precedence is given to drivers which state compatibility with a that specific operating system (OS) before a more generic driver stating HAL compatibility. This property is only available for device drivers and software packages. This property must be set to at least one operating system.
  • alt_cppflags_addition—Adds a line of arbitrary text to the ALT_CPPFLAGS variable in the BSP public.mk file. This technique can be useful if you wish to have a static compilation flag or definition that all BSP, application, and library files receive during software build. This property is optional.
  • excluded_hal_source—Specifies a file to exclude from the a BSP generated with an operating system that extends HAL. The value is the path to a BSP file to exclude, with respect to the BSP root. This property is optional.
  • systemh_generation_script—Specifies a .tcl script to execute during generation of the BSP system.h file. This script runs with the tcl commands available to other BSP settings tcl scripts, and allow you to influence the contents of the system.h file. This property is available only to operating systems, created with the create_os command. This property is optional.
  • txt_source--Adds a text file (.txt) to BSPs. Example: add_sw_property txt_source files.txt.