Specifications

For a user library, the SBT also generates a public makefile, called public.mk. The public makefile is
included in the private makefile for any application (or other user library) that uses the user library.
When you create a makefile for an application or user library, you provide the SBT with a list of source
files and a reference to a BSP directory. The BSP directory is mandatory for applications and optional for
libraries.
Supported Source File Types
The Nios II SBT examines the extension of each source file to determine the programming language.
Table 4-4: Supported Programming Languages with the Corresponding File Extensions
Programming Language File Extensions
(4)
C .c
C++ .cpp, .cxx, .cc
Nios II assembly language; sources are built directly by the
Nios II assembler without preprocessing
.s
Nios II assembly language; sources are preprocessed by the
Nios II C preprocessor, allowing you to include header files
.S
Board Support Packages
A Nios II BSP project is a specialized library containing system-specific support code. A BSP provides a
software runtime environment customized for one processor in a hardware system. The BSP isolates your
application from system-specific details such as the memory map, available devices, and processor
configuration.
A BSP includes a .a file, header files (for example, system.h), and a linker script (linker.x). You use these
BSP files when creating an application.
The Nios II SBT supports two types of BSPs: Altera Hardware Abstraction Layer (HAL) and Micrium
MicroC/OS-II. MicroC/OS-II is a layer on top of the Altera HAL and shares a common structure.
Overview of BSP Creation
The Nios II SBT creates your BSP for you. The tools provide a great deal of power and flexibility, enabling
you to control details of your BSP implementation while maintaining compatibility with a hardware
system that might change.
By default, the tools generate a basic BSP for a Nios II system. If you require more detailed control over
the characteristics of your BSP, the Nios II SBT provides that control, as described in the remaining
sections of this chapter.
Parts of a Nios II BSP
Hardware Abstraction Layer
The HAL provides a single-threaded UNIX-like C/C++ runtime environment. The HAL provides generic
I/O devices, allowing you to write programs that access hardware using the newlib C standard library
routines, such as printf(). The HAL interfaces to HAL device drivers, which access peripheral registers
(4)
All file extensions are case-sensitive.
NII5V2
2015.05.14
Supported Source File Types
4-5
Nios II Software Build Tools
Altera Corporation
Send Feedback