Nios® II Software Developer Handbook

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

7.3. The system.h System Description File

The system.h file provides a complete software description of the Nios® II system hardware. Not all information in system.h is useful to you as a programmer, and it is rarely necessary to include it explicitly in your C source files. Nonetheless, system.h holds the answer to the question, “What hardware is present in this system?”

The system.h file describes each peripheral in the system and provides the following details:

  • The hardware configuration of the peripheral
  • The base address
  • Interrupt request (IRQ) information (if any)
  • A symbolic name for the peripheral

The Nios® II SBT generates the system.h file for HAL BSP projects. The contents of system.h depend on both the hardware configuration and the HAL BSP properties.

Note: Do not edit system.h. The SBT provides facilities to manipulate system settings.

For more information about how to control BSP settings, refer to the “HAL BSP Settings” chapter.

Example 6–1. Excerpts from a system.h File Detailing Hardware Configuration Options

/*
* sys_clk_timer configuration
*
*/
#define SYS_CLK_TIMER_NAME "/dev/sys_clk_timer"
#define SYS_CLK_TIMER_TYPE "altera_avalon_timer"
#define SYS_CLK_TIMER_BASE 0x00920800
#define SYS_CLK_TIMER_IRQ 0
#define SYS_CLK_TIMER_ALWAYS_RUN 0
#define SYS_CLK_TIMER_FIXED_PERIOD 0
/*
* jtag_uart configuration
*
*/
#define JTAG_UART_NAME "/dev/jtag_uart"
#define JTAG_UART_TYPE "altera_avalon_jtag_uart"
#define JTAG_UART_BASE 0x00920820
#define JTAG_UART_IRQ 1