Specifications

Nios II Hardware Design Concepts
This section discusses some basic concepts behind the Altera Qsys and SOPC Builder system integration
tools. These concepts can enhance your understanding of the driver development process. You do not
normally need to use a system integration tool when developing Nios II device drivers.
The Relationship Between the .sopcinfo File and system.h
The system.h header file provides a complete software description of the Nios II system hardware. The
system.h system description is a fundamental part of developing drivers. Because drivers interact with
hardware at the lowest level, it is worth understanding the relationship between the .sopcinfo file and
system.h.
The system generation tool, Qsys or SOPC Builder, generates the Nios II processor system hardware.
Hardware designers use the system generation tool to specify the architecture of the Nios II processor
system and integrate the necessary peripherals and memory. Therefore, the definitions in system.h, such as
the name and configuration of each peripheral, are a direct reflection of design choices made in the
system generation tool. These design choices are encapsulated in the .sopcinfo file. system.h is derived
from the .sopcinfo file.
For more information about the system.h header file, refer to the "Developing Programs Using the
Hardware Abstraction Layer" chapter.
Related Information
Developing Programs Using the Hardware Abstraction Layer on page 6-1
Using the System Generation Tool to Optimize Hardware
If you find less-than-optimal definitions in system.h, remember that you can modify the contents of
system.h by changing the underlying hardware with the system generation tool, Qsys or SOPC Builder.
Before you write a device driver to accommodate imperfect hardware, it is worth considering whether the
hardware can be improved easily with the system generation tool.
Components, Devices, and Peripherals
The Qsys and SOPC Builder system generation tools use the term “component” to describe hardware
modules included in the system. In the context of Nios II software development, components are devices,
such as peripherals or memories. In the following sections, “component” is used interchangeably with
“device” and “peripheral” when the context is closely related to the system generation tool.
Accessing Hardware
Software accesses the hardware with macros that abstract the memory-mapped interface to the device.
This section describes the macros that define the hardware interface for each device.
All components provide a directory that defines the device hardware and software. For example, each
component provided in the Quartus
®
II software has its own directory in the <Altera installation>/ip/
altera/sopc_builder_ip directory. Many components provide a header file that defines their hardware
interface. The header file is named <component name>_regs.h, included in the inc subdirectory for the
specific component. For example, the Altera-provided JTAG UART component defines its hardware
interface in the file <Altera installation>/ip/altera/sopc_builder_ip/altera_avalon_jtag_uart/inc/altera_avalon_
jtag_uart_regs.h.
NII5V2
2015.05.14
Nios II Hardware Design Concepts
7-3
Developing Device Drivers for the Hardware Abstraction Layer
Altera Corporation
Send Feedback