Nios® V Processor Software Developer Handbook

ID 743810
Date 4/01/2024
Public
Document Table of Contents

5. Overview of the Hardware Abstraction Layer

The HAL is a lightweight embedded runtime environment that provides a simple device driver interface for connecting programs to the underlying hardware. The HAL application program interface (API) is integrated with the ANSI C standard library. The HAL API allows you to access devices and files using familiar C library functions, such as printf() , fopen(), and fwrite().

The HAL serves as a device driver package for Nios® V processor systems, providing a consistent interface to the peripherals in your system. The Nios® V processor software development tools extract system information from the Platform Designer System File (.qsys). The Board Support Package (BSP) Editor generates a custom HAL BSP specific to your hardware configuration. Changes in the hardware configuration automatically propagate to the HAL device driver configuration, eliminating bugs that emerge as a result of driver or IP configuration mismatch.

HAL device driver abstraction provides a clear distinction between application and device driver software. This driver abstraction promotes reusable application code that is resistant to changes in the underlying hardware. In addition, the HAL standard makes it straightforward to write drivers for new hardware peripherals that are consistent with existing peripheral drivers.