Nios® V Processor Software Developer Handbook

ID 743810
Date 2/14/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

7.8.5.2.5. Specifying Source Files

Using the Tcl command interface, you must specify each source file in your driver or software package that you want in the generated BSP. The commands discussed in this section add driver source files and specify their location in the file system and generated BSP.

The add_sw_property command’s c_source and asm_source arguments add a single .c or Nios® V processor assembly language source file (.s or .S) to your driver or software package. You must express path information to the source relative to the driver root (the location of the Tcl file). add_sw_property copies source files to BSPs that incorporate the driver, using the path information specified, and adds them to source file list in the generated BSP CMakeLists.txt. When you build the BSP using make, the driver source files are compiled as follows:

add_sw_property c_source HAL/src/my_driver.c

The add_sw_property command’s include_source argument adds a single header file in the path specified to the driver. The paths are relative to the driver root. add_sw_property copies header files to the BSP during generation, using the path information specified at generation time. It does not include header files in the CMakeLists.txt.

add_sw_property include_source inc/my_custom_component_regs.h
add_sw_property include_source HAL/inc/my_custom_component.h